View previous topic :: View next topic
|
Author |
Message |
gargi koley
New User
Joined: 11 Jan 2008 Posts: 10 Location: satyam gateway,hi-tech citi,hyderabad
|
|
|
|
hi all,
i have got the requirment of executing the command for cics start/stop thru REXX program.
the command that is executable from the spool looks like this
for CICS Start:
/START CICSB1
for CICS Stop:
/C CICSB1
we have included the commands in our rexxx program as follws:
"/START CICSB1"
"/C CICSB1"
while executing the program the errors is thrown in line where the command is getting executed with the RC(-3).
can any one tell me how can one include those commands in my program |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
What sort of address space are you running this REXX exec in? Obviously CICS start/stop commands would not be usable in a TSO/E or ISPF address space. Is this exec running from a console automation environment (i.e. Netview, AutopOperator, OPS/MVS, Tivoli). |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Pedro, would there be a preference of using the CONSOLE command instead of the normal interface (i.e. SDSF, Sysview, or IOF)? My experience has been that normally CONSOLE is off-limits to the casual user, at least not without some audit controls. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
CONSOLE is typically off limits to the normal user. But so should issuing operator commands from SDSF (most other features of SDSF should be free to use).
And commands, to start and stop CICS, in themselves, should be limited to authorized personnel. If the poster's job requires him to issue console commands, then the right permissions should be given. Get the right permissions instead of doing things which seemingly bypass controls.
My normal tack is to do whatever works... if you -have- to, use SDSF. But the first choice should be the most direct option. The poster needs to issue operator commands, so use CONSOLE and the GETMSG() function. |
|
Back to top |
|
|
hrsuprith
New User
Joined: 13 Sep 2008 Posts: 6 Location: bangalore
|
|
|
|
gargi koley wrote: |
hi all,
i have got the requirment of executing the command for cics start/stop thru REXX program.
the command that is executable from the spool looks like this
for CICS Start:
/START CICSB1
for CICS Stop:
/C CICSB1
we have included the commands in our rexxx program as follws:
"/START CICSB1"
"/C CICSB1"
while executing the program the errors is thrown in line where the command is getting executed with the RC(-3).
can any one tell me how can one include those commands in my program |
Hey Why want you try something like this.
This is a rexx & JCL interface where all you need to do is just submit a JCL which would inturn call rexx procedure stored in one of your personal PDS.
You could try with IKJ utilities to execute this rexx.
Code attached below:
/******************************* REXX *******************************/
/* */
/* Ping the cics systems by issuing a CEMT I VTAM command */
/* */
/******************************* REXX *******************************/
/*TRACE A */
"EXECIO * DISKR CICSREG (STEM LINE. FINIS)"
count = 0
do i=1 to line.0
if LEFT(line.i,1) = "*" then iterate i
parse var line.i . "CICSREG(" what ")" .
what = STRIP(what)
if what ª= "" then do
count = count + 1; cics.count = what
end
end
cics.0 = count
/*
Ping each CICS in turn and examine the response
*/
maxcc = 0
do c=1 to cics.0
cicscc = 0
if DOMVSCMD("F "cics.c",CEMT I VTAM") = 0 then do
found = 0
do i=1 to mes.0
select
when POS("DFHAC2015",mes.i) > 0 then do
found = 1
say "*** "cics.c" doesn't have console autoinstall"
cicscc = 8
leave i
end
when POS("Openstatus( Open )",mes.i) > 0 then do
found = 1
leave i
end
when POS("Openstatus(",mes.i) > 0 then do
found = 1
say "*** "cics.c" VTAM not open "mes.i
cicscc = 8
leave i
end
otherwise nop
end
end
if found then do
say "*** "cics.c" already up"
cicscc = 8
end
else cicscc = 4
end
if cicscc = 4 then do
upcmd = 'Y'
DOMVSCMD("S "cics.c" ")
say "*** "cics.c" being started"
cicscc = 0
end
if cicscc > maxcc then maxcc = cicscc
end
/*
Issue an MVS command and get a response back
*/
DOMVSCMD:
/*------------------------------------------------------------------*/
/* Prevent error and non-error tso/E messages from being displayed. */
/*------------------------------------------------------------------*/
status = MSG('OFF')
Arg command
/*
if LENGTH(command) < 1 then do
say 'Command entered can not be blank.'
return 8
end
*/
mdisp1 = SYSVAR("Soldisp") /* Save current message setting. */
mdisp2 = SYSVAR("Unsdisp") /* Save current message setting. */
/*-------------------------------------------------------------------*/
/* */
/* The following commands are used so that solicited and unsolicited */
/* messages are not displayed. This way we can use GETMSG to retrieve*/
/* the command responses. */
/* */
/*-------------------------------------------------------------------*/
"CONSPROF SOLDISPLAY(NO)" /* Inhibit message display (Solicited) */
"CONSPROF UNSOLDISPLAY(NO)" /* Inhibit message display (Unsolicited) */
/* address tso "console Activate Name(CICSHCHK)" */
/* address tso "console Activate Name(E13301CC)" */
address tso "console Activate Name(GOPCUDBA)"
/*-------------------------------------------------------------------*/
/* */
/* 'console ACTIVATE' command Return Code Analysis : */
/* */
/* Here only more important Return Codes are controlled. They are 4,*/
/* 36, and 40. For the other usage of this REXX, it may be necessary*/
/* to know the others. */
/* */
/* ALL POSSIBLE RETURN CODES & ERROR-MESSAGES OF tso console COMAND*/
/* =================================================================*/
/* */
/* note : IKJ prefix has to be added to the message numbers below. */
/* */
/* RC MSG-no MESSAGE TEXT */
/* -- ------ --------------------------------------------------------*/
/* 4 55302I THE console SESSION IS ALREADY ACTIVE. */
/* */
/* 16 55301I THE console command HAS TERMINATED. + THE RECOVERY */
/* ENVIRONMENT COULD noT BE ESTABLISHED. */
/* */
/* 20 55307I THE console command HAS TERMINATED. + A console SESSION */
/* IS noT ACTIVE. */
/* */
/* 24 55310I THE console REQUEST COULD noT BE PROCESSED. + console */
/* DEACTIVATION IS IN PROGRESS. */
/* */
/* 28 55314I A SEVERE ERROR OCCURRED DURING console PROCESSING. + */
/* SYSTEM ABend abend_code, REASON CODE reason_code. */
/* */
/* 28 55308I THE console command HAS TERMINATED. + THE console */
/* command DETECTED AN INTERNAL ERROR xxx */
/* DURING PROCESSING. */
/* */
/* 32 55317I THE console command HAS TERMINATED. + THE PUTGET SERVICE*/
/* ROUTINE RETURN CODE WAS xx. */
/* */
/* 36 55305I THE console command HAS TERMINATED. + USER user_id */
/* doES noT HAVE console command AUTHORITY. */
/* */
/* 40 55303I THE console command HAS TERMINATED. + AN ERROR OCCURRED */
/* or DURING console INITIALIZATION. THE MCSOPER RETURN CODE */
/* 48 WAS rcAND THE REASON CODE WAS rs */
/* */
/* 52 55309I THE console command HAS TERMINATED. + console command */
/* INITIALIZATION FAILED. */
/* */
/* 56 55316I THE NAME KEYWORD IS noT VALID when A console SESSION IS */
/* ACTIVE. + THE CURRENT console NAME IS consname. */
/* */
/* 60 55312I THE console command HAS TERMINATED. + THE command BUFFER*/
/* COULD noT PARSED. */
/* */
/* 64 55319I THE SYSTEM command WAS noT PROCESSED. + THE command IS */
/* TOO LONG. */
/* */
/*-------------------------------------------------------------------*/
select
when RC = 0 then nop /* console has been successfully activated */
when RC = 4 then nop /* A console session is already active. */
/* The processing continues. */
when RC = 36 then do
say 'You dont have console command authority.'
return 8
end
when RC = 40 then do
say "CICSUP may already be running. Try later."
return 8
end
Otherwise do
say 'console command ended with an error.Rc=' Rc
return 8
end
end /*select end */
address console "Cart ATA"
if Rc = -3 then do
say ' '
say 'console session is not active. '
say 'First console ACTIVATE command has to be issued.'
return 8
end
/*--------------------------------------------------------------------*/
/* Issue the command passed to the REXX. */
/*--------------------------------------------------------------------*/
address console command
if Rc = 64 then do
say 'Please enter a command less than 126 ch. in LENGTH'
address tso "console Deactivate"
"CONSPROF SOLDISPLAY("mdisp1")"
"CONSPROF UNSOLDISPLAY("mdisp2")"
return 8
end
/*--------------------------------------------------------------------*/
/* Wait for 30 seconds if the requested message has not yet been */
/* routed to the user's console. */
/*--------------------------------------------------------------------*/
drop Mes.
Getcode = Getmsg('Mes.','Sol','ATA',,30)
/*--------------------------------------------------------------------*/
/* */
/* 'GETMSG' command Return Code Analysis : */
/* */
/* RC=0 : Processing successful;A message has been returned.*/
/* All other RCs : Processing unsuccessful. */
/* */
/*--------------------------------------------------------------------*/
if Getcode ª= 0 then do
say "GETMSG error retrieving message. Return code is" Getcode
address tso "console Deactivate"
"CONSPROF SOLDISPLAY("mdisp1")"
"CONSPROF UNSOLDISPLAY("mdisp2")"
if upcmd = 'Y' then return 0
else return 8
end
else do /* Getcode = 0 */
if Pos('IEE345I',Mes.1) ª= 0 then do
say "You don't have the correct command authority."
say "Enter the command with the proper command authority."
return 8
end
end
address tso "console Deactivate" /* Deactivate the user console. */
"CONSPROF SOLDISPLAY("mdisp1")" /* Restore message setting. */
"CONSPROF UNSOLDISPLAY("mdisp2")" /* Restore message setting. */
return 0
/*-------------------------------------------------------------------*/
VALIDATE_DATE:
arg date
signal on syntax
dummy = DATE(,date,"E")
return 0
syntax:
return 1
/*-------------------------------------------------------------------*/
return 0 |
|
Back to top |
|
|
|