View previous topic :: View next topic
|
Author |
Message |
sarangwagh7
New User
Joined: 15 Mar 2007 Posts: 13 Location: Pune
|
|
|
|
Hi,
Can we pass any value from COBOL program to JCL???
I know we can collect Return code but can we pass any populated value in COBOL program to JCL by collecting it anyhow??? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Nope. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
A fairly succint reply from SuperK there.
The JCL is interpreted when it hits the INTRDR, and once it has been interpreted it can not be changed. |
|
Back to top |
|
|
timburkart
New User
Joined: 17 Mar 2007 Posts: 29 Location: USA
|
|
|
|
Dear sarangwagh7,
I'm curious, even if a program could pass a value other than a return code back to JCL what would you do with it? I have some thoughts but would like to hear from you.
thanks,
tim |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Dang, I was just going to post the exact same question. I'm curious too. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
While it is not directly "to JCL", the data could be written to a file and read where needed (unless if is supposed to modify the already running jcl).
If sarangwagh7 will post the requirement rather than the original question, we can offer better suggestions (or even suggestions at all ).
If there is no actual requirement and this is a "just trying to learn" question, i go with the "Nope". |
|
Back to top |
|
|
sarangwagh7
New User
Joined: 15 Mar 2007 Posts: 13 Location: Pune
|
|
|
|
Hey, Thanks 4 ur reply.
Actually this was the question in my mind from long time ago.
Currently, i am preparing JCL for executing two jobs.
& i am searching for the way by which i want to pass the return value from job one to job two.
Thats the scenario where i want to return the value from cobol prog to JCL.
Thanks,
Sarang |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
i am searching for the way by which i want to pass the return value from job one to job two. |
Are we talking RC, ( return code ) here ???
If so, why would you possibly want to send the return code of one program in one job to another program in another job.
Maybe I am wrong in my interpretation of this question. I do hope so. |
|
Back to top |
|
|
sarangwagh7
New User
Joined: 15 Mar 2007 Posts: 13 Location: Pune
|
|
|
|
i am not talking about return code.
I am talking about the value other than return code..
Thanks,
Sarang |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Then a dataset is the best and easiest way to go |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
But if it is to job2's JCL rather than to a job2 program, then just writing it to a file won't work.
To modify the job2 JCL dynamically, create a JCL SET card in a file and then INCLUDE it in job2; this will pass the job1 value to a symbolic in job2, where it can be used as any symbolic can be used. |
|
Back to top |
|
|
sarangwagh7
New User
Joined: 15 Mar 2007 Posts: 13 Location: Pune
|
|
|
|
Thanks a lot!!
Dataset option is easy,
But Phrzby Phil can u elaborate your views more so that i can try it |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Job1 creates a PDS member HLQ.INCL(SETDATE) with, e.g.:
// SET DATE=070327
or any other value from the job you want to pass to Job2's JCL.
Job2 has this JCL:
// JCLLIB ORDER=(HLQ.INCL)
// INCLUDE MEMBER=SETDATE
which puts the SET statement into Job2's JCL.
Later in Job2:
//DD1 DD DSN=HLQ.TRANS.D&DATE,DISP=(NEW,CATLG),...
uses this value in the dataset name.
So, in this example, whatever date Job1 writes to its file, Job2 will use that date, regardless of when Job2 run. The date could be, e.g., the system date, or from Job1's data. |
|
Back to top |
|
|
sarangwagh7
New User
Joined: 15 Mar 2007 Posts: 13 Location: Pune
|
|
|
|
Thanks Phrzby |
|
Back to top |
|
|
|