TSO/E Rexx and JCL to get DSN from DD Name



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

TSO/E Rexx and JCL to get DSN from DD Name

Postby papadilbert » Tue Jan 26, 2016 10:35 pm

I need to submit a job that executes a REXX script. The Rexx routine needs to determine the DSN of a specified DDNAME allocated by the JCL.

In a TSO/E session this could be done using OUTTRAP and parsing the LISTALC information. But OUTTRAP is a TSO/E function and not available when executing the script with IRXJCL.

Maybe there is an alternative? A simpler way?
papadilbert
 
Posts: 8
Joined: Mon Apr 21, 2014 11:05 pm
Has thanked: 1 time
Been thanked: 0 time

Re: TSO/E Rexx and JCL to get DSN from DD Name

Postby papadilbert » Tue Jan 26, 2016 11:20 pm

Clipped from IBM, This allowed me to use the OUTTRAP() function.

You can run a REXX exec in TSO/E background. In the JCL, specify IKJEFT01 as the program name (PGM= ) on the JCL EXEC statement. On the EXEC statement, specify the member name of the exec and any arguments in the PARM field. For example, to execute an exec called TEST4 that is in data set USERID.MYREXX.EXEC, use the following JCL:
//TSOBATCH EXEC PGM=IKJEFT01,DYNAMNBR=30,REGION=4096K,PARM='TEST4'
//SYSEXEC DD DSN=USERID.MYREXX.EXEC,DISP=SHR


I had to add

//SYSTSPRT DD DUMMY
papadilbert
 
Posts: 8
Joined: Mon Apr 21, 2014 11:05 pm
Has thanked: 1 time
Been thanked: 0 time

Re: TSO/E Rexx and JCL to get DSN from DD Name

Postby papadilbert » Thu Mar 24, 2016 3:15 am

I successfully used IKJEFT01 but instead of using OUTTRAP and LISTALC, I used LISTDSI.

parm= DDN1 " FILE"
rc = LISTDSI(parm)
if rc = 0 then
say "DD" DDN1 is allocated to: " sysdsname
exit


In addition to SYSTSPRT DD DUMMY I had to add SYSTSIN DD DUMMY
papadilbert
 
Posts: 8
Joined: Mon Apr 21, 2014 11:05 pm
Has thanked: 1 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post