Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Can we pass any value from COBOL program to JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Can we pass any value from COBOL program to JCL
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

Moderator Team Head


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

PostPosted: Fri Mar 23, 2007 7:08 pm    Post subject: Re: Return value to JCL
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Mar 23, 2007 7:10 pm    Post subject:
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: 30
Location: USA

PostPosted: Fri Mar 23, 2007 7:42 pm    Post subject: Re: Return value to JCL
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

Moderator Team Head


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

PostPosted: Fri Mar 23, 2007 7:45 pm    Post subject: Re: Return value to JCL
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

Site Director


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

PostPosted: Fri Mar 23, 2007 8:47 pm    Post subject:
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    Post subject: Re: Can we pass any value from COBOL program to JCL
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: 8593
Location: Back in jolly old England

PostPosted: Mon Mar 26, 2007 2:02 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Mar 26, 2007 3:01 pm    Post subject:
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

Active Member


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

PostPosted: Mon Mar 26, 2007 8:44 pm    Post subject:
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    Post subject:
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

Active Member


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

PostPosted: Tue Mar 27, 2007 5:31 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us