Automating Console Commands



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Automating Console Commands

Postby Santo » Sat Nov 26, 2011 8:48 pm

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.
Santo
 
Posts: 2
Joined: Fri Nov 25, 2011 6:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Automating Console Commands

Postby mongan » Mon Nov 28, 2011 1:04 pm

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.
User avatar
mongan
 
Posts: 211
Joined: Tue Jan 11, 2011 8:32 pm
Has thanked: 1 time
Been thanked: 5 times

Re: Automating Console Commands

Postby Santo » Mon Nov 28, 2011 7:06 pm

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?
Santo
 
Posts: 2
Joined: Fri Nov 25, 2011 6:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Automating Console Commands

Postby csomai » Tue Nov 29, 2011 12:06 am

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.
csomai
 
Posts: 1
Joined: Mon Nov 28, 2011 11:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Automating Console Commands

Postby mongan » Tue Nov 29, 2011 12:38 pm

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!
User avatar
mongan
 
Posts: 211
Joined: Tue Jan 11, 2011 8:32 pm
Has thanked: 1 time
Been thanked: 5 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post