Page 1 of 1

Automating Console Commands

PostPosted: Sat Nov 26, 2011 8:48 pm
by Santo
Hello Everyone,

I am planning to automate some of our console command like
D R,L
D R,U

My requirement is
Want to issue this commands either through JCL or REXX and Capture the output in a Dataset.

I was able to achive this by executing the below rexx program
------------------------------------------------------------
/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

ISFRC = ISFCALLS("ON")
IF ISFRC <> 0 THEN DO
SAY "ISFCALLS RC" ISFRC
EXIT
END

CMD = "/RO *ALL,D R,U"
ADDRESS SDSF "ISFEXEC '" || CMD || "' "

IF RC <> 0 THEN DO
SAY "ISFEXEC RC" RC
SAY ISFMSG
DO IM = 1 TO ISFMSG2.0
SAY ISFMSG2.IM
END
EXIT
END

CALL ISFCALLS ("OFF" )

OUTDSN='OUTPUT.DATA'
"ALLOC DD(OUTDSN) DA('"OUTDSN"') OLD REU"
"EXECIO * DISKW OUTDSN (STEM ISFULOG. FINIS"
"FREE DD(OUTDSN)"

EXIT
----------------------------------------------------
However, we dont have SDSF in one of our old mainframe, so iam unable to use this code. (TSO and ISPF are avaliable)
Could anyone please help me with the code to execute and capture the console command o/p in a dataset.

FYI.. I dont have console command authority. so i will not be able to activate or deactivate the console through REXX.

Re: Automating Console Commands

PostPosted: Mon Nov 28, 2011 1:04 pm
by mongan
If you don't have console command authority and do not have SDSF how do you expect to submit a console command? You need to find out what possibilies you have in your shop, like a vendor product or have your authorization changed.

Re: Automating Console Commands

PostPosted: Mon Nov 28, 2011 7:06 pm
by Santo
I am able to issue Console Commands by using INTRDR. But iam not sure whether it is a right approach and also i dont know how to capture the command response in a Dataset.

Please find the code below
//ONLINE EXEC PGM=IEBEDIT
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSUT1 DD DATA,DLM='$$'
/*$VS,'D GRS,C'
/*$VS,'D R,L'
$$

Can someone help me how to capture the Command Response in a Dataset?

Re: Automating Console Commands

PostPosted: Tue Nov 29, 2011 12:06 am
by csomai
Hi,
you have to use DSN= instedad off SYSOUT, because sysout send the output to print :
//SYSPRINT DD DSN=yourdatasetname,DISP.....

but as I see you know REXX, use the TSO CONSOLE command to submit system commands under REXX.

Re: Automating Console Commands

PostPosted: Tue Nov 29, 2011 12:38 pm
by mongan
This sounds like a security breach to me. You do not have the authority to issue oper commands yet you want to get around that and use a job that can do it. By realising this you might be in serious trouble for violating security restrictions. Talk to your RACF people and your bosses for your own safety!