Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to Include CICS start/stop command in rexx program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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

PostPosted: Fri Sep 05, 2008 5:41 pm    Post subject: How to Include CICS start/stop command in rexx program
Reply with quote

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
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Sep 05, 2008 5:51 pm    Post subject: Reply to: How to Include CICS start/stop command in rexx pro
Reply with quote

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
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2038
Location: Silicon Valley

PostPosted: Fri Sep 05, 2008 10:59 pm    Post subject: Reply to: How to Include CICS start/stop command in rexx pro
Reply with quote

You need to setup and use the CONSOLE command.

See appendix C of the TSO/E REXX Reference manual.
http://www-03.ibm.com/systems/z/os/zos/bkserv/r10pdf/#tsoe
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Sep 05, 2008 11:20 pm    Post subject: Reply to: How to Include CICS start/stop command in rexx pro
Reply with quote

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
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2038
Location: Silicon Valley

PostPosted: Sat Sep 06, 2008 1:25 am    Post subject: Reply to: How to Include CICS start/stop command in rexx pro
Reply with quote

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
View user's profile Send private message
hrsuprith

New User


Joined: 13 Sep 2008
Posts: 6
Location: bangalore

PostPosted: Sat Feb 28, 2009 7:19 am    Post subject: Re: How to Include CICS start/stop command in rexx program
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 3 Mon May 29, 2017 8:10 pm
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us