Page 1 of 1

How to pass value from REXX to JCL

PostPosted: Sat Nov 24, 2012 12:20 am
by nikesh_rai
Hi,

I need to pass some values from REXX to JCL. I checked lots of topic in this forum, but not getting much more.
Here is my code:

DPFCB.D393990.ISPCLIB(REXX4) - 01.44 Co
>
SAY XINPFLE
SAY XFLELAY
SAY XLAYDST
SAY XOTPFLE
ADDRESS TSO "SUBMIT 'DPFCB.D393990.JCL(FMTFILE)'"

the value of variables in REXX will be received from Panel and I want to pass the value of those variables to JCL FMTFILE for further processing
can anyone please help me out

Re: How to pass value from REXX to JCL

PostPosted: Sat Nov 24, 2012 12:44 am
by enrico-sorichetti
read the ISPF manuals about the FILE TAILORING SERVICES

search the forum for examples

here are some links with examples

http://ibmmainframes.com/about42154.html
http://ibmmainframes.com/about57213.html
http://ibmmainframes.com/about55549.html

Re: How to pass value from REXX to JCL

PostPosted: Sat Nov 24, 2012 1:50 am
by nikesh_rai
Thanks Enrico.. your 2nd links worked for me.. thanks a lot..
i used stack for the JCL.. where i was able to pass the data so easily..

Hi All,

Please check below how it was coded

DPFCB.D393990.ISPCLIB(REXX4) - 01.44 Columns 00001 0
> Scroll ===>
+----1----+----2----+----3----+----4----+----5----+----6----+--
SAY XINPFLE
SAY XFLELAY
SAY XLAYDST
SAY XOTPFLE
ADDRESS TSO "NEWSTACK"
QUEUE "//D393990C JOB (ZPFCB200,$HOTBATCH),'FORMAT FILE',"
QUEUE "// REGION=4M,CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),"
QUEUE "// NOTIFY=&SYSUID"
QUEUE "//STEP01 EXEC PGM=SORT"
QUEUE "//SORTIN DD DSN="XINPFLE","
QUEUE "// DISP=SHR"
QUEUE "//SORTOUT DD DSN="XOTPFLE","
QUEUE "// UNIT=SYSDA,SPACE=(CYL,(10,1)),"
QUEUE "// LABEL=(1,SL,EXPDT=99000),"
QUEUE "// VOL=(,,,35),"
QUEUE "// DISP=(OLD,CATLG,CATLG),"
QUEUE "// DCB=(*.SORTIN)"
.....

and in SPOOL the JESJCL shows output like this:

1 //D393990C JOB (ZPFCB200,$HOTBATCH),'FORMAT FILE',
// REGION=4M,CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
IEFC653I SUBSTITUTION JCL - (ZPFCB200,$HOTBATCH),'FORMAT FILE',REGION=
NOTIFY=D393990
2 //STEP01 EXEC PGM=SORT
3 //SORTIN DD DSN=DPFCB84.C1210.C07T04.SVP022.SRTDBITS,
// DISP=SHR
4 //SORTOUT DD DSN=DPFCB84.C1210.C07T05.SVP022.SRTDBITS.TTS,
// UNIT=SYSDA,SPACE=(CYL,(10,1)),
// LABEL=(1,SL,EXPDT=99000),
// VOL=(,,,35),
// DISP=(OLD,CATLG,CATLG),
// DCB=(*.SORTIN)
//* DCB=(RECFM=FB,LRECL=453)
5 //SYSOUT DD SYSOUT=*

and this is correct..

Re: How to pass value from REXX to JCL

PostPosted: Mon Nov 26, 2012 2:37 pm
by halfteck
I think i am pleased you have your result as expected, but its
(a) not file tailoring as was suggested earlier. and
(b) although not part of the question, the JCL you are using leaves a lot to be desired.
I suspect its been copied from code created many many years ago. Allocating space for a DASD dataset, and specifying a number of JCL parameters specifically designed for TAPE, whilst obviously not syntactically incorrect, are not what would usually be coded.
I am not criticsising anyone here, but a few things are worth considering, for instance
DISP=(OLD,CATLG,CATLG) and DISP=OLD are the same thing.
MSGLEVEL=(1,1) is default
SPACE=(CYL,(10,1) consider coding release or not coding space at all as the dataset exists.
In your example, for SORTOUT all thats needed is DSN= and DISP=OLD the rest are either ignored or not required

Hope that helps, i just hate seeing badly coded JCL

Re: How to pass value from REXX to JCL

PostPosted: Tue Nov 27, 2012 11:37 pm
by nikesh_rai
thanks halfteck,

the code you saw is the test code.. which i have written only for the testing purpose. this is not the actual code. since the code was written only for testing.. and was working as per my expectation.. i didn't check it at all after taking successful run. but thanks for pointing out where i was coded wrongly :)