IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we pass any value from COBOL program to JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sarangwagh7

New User


Joined: 15 Mar 2007
Posts: 13
Location: Pune

PostPosted: Fri Mar 23, 2007 7:04 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Mar 23, 2007 7:08 pm
Reply with quote

Nope.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 23, 2007 7:10 pm
Reply with quote

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
View user's profile Send private message
timburkart

New User


Joined: 17 Mar 2007
Posts: 29
Location: USA

PostPosted: Fri Mar 23, 2007 7:42 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Mar 23, 2007 7:45 pm
Reply with quote

Dang, I was just going to post the exact same question. I'm curious too.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 23, 2007 8:47 pm
Reply with quote

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 icon_smile.gif ).

If there is no actual requirement and this is a "just trying to learn" question, i go with the "Nope".
Back to top
View user's profile Send private message
sarangwagh7

New User


Joined: 15 Mar 2007
Posts: 13
Location: Pune

PostPosted: Mon Mar 26, 2007 1:58 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Mar 26, 2007 2:02 pm
Reply with quote

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
View user's profile Send private message
sarangwagh7

New User


Joined: 15 Mar 2007
Posts: 13
Location: Pune

PostPosted: Mon Mar 26, 2007 2:16 pm
Reply with quote

i am not talking about return code.
I am talking about the value other than return code..

Thanks,
Sarang
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Mar 26, 2007 3:01 pm
Reply with quote

Then a dataset is the best and easiest way to go
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Mon Mar 26, 2007 8:44 pm
Reply with quote

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
View user's profile Send private message
sarangwagh7

New User


Joined: 15 Mar 2007
Posts: 13
Location: Pune

PostPosted: Tue Mar 27, 2007 2:45 pm
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue Mar 27, 2007 5:31 pm
Reply with quote

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
View user's profile Send private message
sarangwagh7

New User


Joined: 15 Mar 2007
Posts: 13
Location: Pune

PostPosted: Fri Mar 30, 2007 9:32 am
Reply with quote

Thanks Phrzby
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top