MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing Variables between PROCS, proograms & JCL ...

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Vodkasoda
Beginner


Joined: 23 Jan 2004
Posts: 19
Topics: 6
Location: Dublin

PostPosted: Fri Jan 23, 2004 5:30 am    Post subject: Passing Variables between PROCS, proograms & JCL ... Reply with quote

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 !!!

Basically I am executing a PROC as follows :

//X10301 EXEC ZPAYREPA,
// PROGID=UNI,
// XZ=Z,
// PAYROLL=MSP,
// COUNTRY=REP,
// MEMBER=APGE005,
// PARMLIB=Z

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 ?

Any help appreciated ...
Back to top
View user's profile Send private message Send e-mail
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Fri Jan 23, 2004 6:35 am    Post subject: Reply with quote

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:

//MYJOB2 (JOB ...),,,,CLASS=X,MSGCLASS=X
//*
// JCLLIB ORDER=MYUSER.MYJCL
//*
// INCLUDE MEMB1
//*

Now, your job can run without a JCL error, since you are supplying the value for the &MEMB1 variable.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Fri Jan 23, 2004 6:59 am    Post subject: Reply with quote

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.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vodkasoda
Beginner


Joined: 23 Jan 2004
Posts: 19
Topics: 6
Location: Dublin

PostPosted: Fri Jan 23, 2004 7:58 am    Post subject: Reply with quote

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 Rolling Eyes !!!

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) !!!!!!!!!
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group