Joined: 23 Jan 2004 Posts: 19 Topics: 6 Location: Dublin
Posted: Fri Jan 23, 2004 5:30 am Post subject: Passing Variables between PROCS, proograms & JCL ...
Hi all, hope somebody out there can help ...
I know how to pass variables from my JCL to PROCs and programs & I know how to get Return codes back ... what I want to do, though, is to get data back to replace/update a variable in the JCL !!!
I can't see a way of doing it with EASYTRIEVE but I suspect REXX may be able to do it ... but then again I am guessing here !!!
I want to replace MEMBER=APGE005 with a variable, MEMBER=&MEMB1 and I want the MEMB1 variable to be passed back to the JCL after a file containing the relevant data has been interrogated ... does that make sense ?
I think that the mistake you're making here is that you are atempting to treat JCL like it's a progamming language, which it is not. JCL doesn't support variables, at least not in the usual sense.
Take your example. You want to replace MEMBER=APGE005 with a variable, MEMBER=&MEMB1. That's fine, but your job will get a JCL error until you supply a value for &MEMB1 BEFORE the job is submitted. This is usually handled by including a SET statement at the beginning of the job:
//MYJOB1 (JOB ...),,,,CLASS=X,MSGCLASS=X
//*
// SET MEMB1=somevalue
//*
What would make the most sense for you is to run your job and proc WITHOUT the &MEMB1 variable. As your program reads "a file containing the relevant data", have the program write an output file to a member of a PDS library (as an example, 'MYUSER.MYJCL(MEMB1)', with the following content:
// SET MEMB1=the resolved data
Next, submit another job, this time with a JCLLIB/INCLUDE statement up front:
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Fri Jan 23, 2004 6:59 am Post subject:
superk,
I guess the requirement was to able to dynamically modify the member name based on the data. The only way I can think of doing it is building the JCL and submitting it via INTRDR.
Joined: 23 Jan 2004 Posts: 19 Topics: 6 Location: Dublin
Posted: Fri Jan 23, 2004 7:58 am Post subject:
Yes, Superk's reply looks interesting, but Kolusu has grasped the problem better !!
The problem being that I have a PROC in place that needs a member name passed to it as a parameter, this will update a production PDS with that member & then run a program to 'compile' it to a CICS / VSAM file.
At the moment I'm contemplating creating a new PROC and picking the parameter up differently ... In an ideal world I would be able to submit a job that would run after 23:00 (i.e. the CICS region has gone down and the Batch jobs have finished) abd I could hard-code my member name; unfortunately such simplistic ideas as having an initiator that is Time-specific is considered inappropriate here !!!
Therefore I'm having to set up a job that will be kicked off nightly by OPC and pick up any parameters that I have set up in advance ... long winded and very heavy-handed, but ultimately an improvement on what I have now, which is to take the Production system from the users, request CICS files be closed. request that Change Management run me a special job, wait half an hour for the output from that special job to go to JMR so I can check the output, then ask that the CICS files be re-opened and call the users to give them their system back ... I have to raise numerous "tickets" to get all this approved and it's really not worth the hassle !!!
Sometimes I really wish people would listen to me when I know best 8) !!!!!!!!!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum