How to pass value from REXX to JCL



IBM's Command List programming language & Restructured Extended Executor

How to pass value from REXX to JCL

Postby nikesh_rai » Sat Nov 24, 2012 12:20 am

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
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: How to pass value from REXX to JCL

Postby enrico-sorichetti » Sat Nov 24, 2012 12:44 am

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: How to pass value from REXX to JCL

Postby nikesh_rai » Sat Nov 24, 2012 1:50 am

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..
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: How to pass value from REXX to JCL

Postby halfteck » Mon Nov 26, 2012 2:37 pm

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
halfteck
 
Posts: 42
Joined: Tue Nov 08, 2011 8:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass value from REXX to JCL

Postby nikesh_rai » Tue Nov 27, 2012 11:37 pm

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 :)
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post