I am writing a JCL PROC, and one of the things I need to do is build some control statements on the fly. To build them I would like to use REXX, and I would like to pass all the info required to build the statements to the exec as parms to the rexx exec. E.g.
The problem is that this parm string will blow the limit of 100 characters allowed in the PARM= string on the JCL EXEC statement.
I could get around this if only my rexx exec could interrogate the calling job's JCL symbolic variables. Does anyone know if/how that can be done please?
Joined: 20 Feb 2009 Posts: 108 Location: Kansas City
I think he's wanting to get the SET values at run time. I don't think it's possible because all symbolic substitution is performed when the JCL text is read in. For example: there's an example in the manual that shows SET text altering a line such that what was a comment is turned into part of an executable statement (or the other way around, can't remember). Values are not carried thru to execution time. It's kind of the macro pre process in c/c++ if you're familar with that.
think he's wanting to get the SET values at run time.
the only way is to use SDSF REXX interface to read the JESJCL dataset
and use the info there ...
NO need for the parameters for the rexx script to be interpreted by the converter
it is enough to store the REXX parameters as comment cards and retrieve them from the jesjcl using something like
Code:
EDIT ENRICO.ISPF.EXEC(JESJCL) - 01.17 Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 /*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000002 /* */
000003 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000004 Trace "O"
000005 Parse Source _sys _how _cmd .
000006 parse arg args
000007 args = space(args)
000008 argc = words(args)
000009
000010 jobid = "JOB06970"
000011 say "jobid " jobid
000012
000013 jobid = jobnumbr()
000014 say "jobid " jobid
000015
000016 IsfRC = isfcalls("ON")
000017 if IsfRC ¬= 0 then do
000018 say "isfcalls RC" IsfRC
000019 exit
000020 end
000021
000022 isfprefix = ""
000023 isfowner = "*"
000024 isffilter = ""
000025 isffilter = "JOBID eq" jobid
000026 isfcols = "jname jobid "
000027
000028 Address SDSF "isfexec da"
000029 if RC ¬= 0 then do
000030 say "isfexec RC" RC
000031 exit
000032 end
000033 say "jname.0" jname.0
000034 say "isfrows" isfrows
000035
000036 do jnr = 1 to jname.0
000037 say right(jnr,2) jname.jnr jobid.jnr
000038 if jobid.jnr ¬= jobid then do
000039 say "SKIPPED " right(jnr,2) jname.jnr jobid.jnr
000040 iterate
000041 end
000042 say "PROCESS " right(jnr,2) jname.jnr jobid.jnr
000043 jopts = "(PREFIX J)"
000044 Address SDSF "ISFACT DA TOKEN('"token.jnr"') PARM(NP ?) " jopts
000045 if RC ¬= 0 then do
000046 say "isfact RC" RC
000047 exit
000048 end
000049 jdd = 2
000050 say right(jnr,2) jname.jnr jobid.jnr right(jdd,2) jddname.jdd
000051
000052 Address SDSF "ISFACT da TOKEN('"jtoken.jdd"') PARM(NP SA) "
000053 "EXECIO * DISKR " isfddname.1 " ( OPEN FINIS STEM SPOOL. "
000054 do i = 1 to spool.0
000055 say spool.i
000056 end
000057 leave
000058 end
000059
000060 call isfcalls "OFF"
000061
000062 exit
000063
000064 Psa: Procedure; Return '00'
000065 Tcb: Procedure; Return C2x(Storage(X2x(Psa(), '21C'),4))
000066 Jscb: Procedure; Return C2x(Storage(X2x(Tcb(), 'B4'),4))
000067 Ssib: Procedure; Return C2x(Storage(X2x(Jscb(),'13C'),4))
000068 Jobnumbr: Procedure; Return Storage(X2x(Ssib(), 'C'),8)
000069
000070 X2x: Procedure; Return D2x(X2d(Arg(1))+X2d(Arg(2)))
****** **************************** Bottom of Data ****************************
wich when run with
Code:
****** ***************************** Top of Data ******************************
000001 //ENRICO1 JOB NOTIFY=&SYSUID,
000002 // REGION=0M,
000003 // MSGLEVEL=(1,1),CLASS=A,MSGCLASS=X
000004 //*
000005 //S1 EXEC PGM=IRXJCL,PARM=JESJCL
000006 //SYSEXEC DD DISP=SHR,DSN=ENRICO.ISPF.EXEC
000007 //SYSPRINT DD SYSOUT=*
000008 //SYSTSPRT DD SYSOUT=*
000009 //SYSTSIN DD DUMMY
****** **************************** Bottom of Data ****************************
As a colleague pointed out to me on saturday, the SET variables will have been disposed of by the time the reader/interpreter has finished, and so they won't be available at run time except in the SDSF output.
I think the simplest thing for me to do will be to split up the parms into manageable chunks, and have a couple of steps prior which write them to a temporary dataset. My main exec can then just read them in from there.
I'll consider this thread closed now. Many thanks to all contributors, especially Enrico who seems to have spent quite a lot of effort on it.
Enrico who seems to have spent quite a lot of effort on it.
not too much really, I had already posted some snippets on how to use the REXX SDSF interface
I just had to add ( from my tools chest ) the lines to get the jobnumber
and the couple of statements to add the filter stuff read only the JESJCL dataset
side note ...
it is strange that the redbook downloadable snippets did not use the isffilter variable
but scanned all the jobs comparing the for example jobname and jobnumber (jobid)
we use a jcl extension (a SUBSYS), that allows to cirumvent the 100 char jcl symbol parm-limit. in this case (IRXJCL) i can code the call in DD:SYSTSIN with this special subsys. symbolic substition works. max parm-length is practically unlimited.