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
 
Passing data from COBOL to JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Prasanna Srinivas D

New User


Joined: 12 Oct 2007
Posts: 9
Location: chennai

PostPosted: Sat May 17, 2008 7:03 pm    Post subject: Passing data from COBOL to JCL
Reply with quote

My requirement is that the name of a file is to be determined in a COBOL program and should be passed back to the JCL executing it, so that it can be used in the subsequent steps.

I know that RETURN-CODE can be used to pass back data from COBOL, but I do not think it is of any use in this case. I am also aware of the technique of setting a global variable in the JCL and passing the reference via PARMS to COBOL, where the value can be modified in the linkage section and can be used in the JCL later.

What I would like to know at this point is

1. What should linkage section variables be to accept the reference, more specifically the data type?

2. Should it be modified in the linkage section itself so that the changes reflect in the JCL or can it be changed in the logic of the COBOL program? I am asking this because the file name is determined by the logic of the program dynamically.
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: Sat May 17, 2008 7:30 pm    Post subject:
Reply with quote

You can not do it.

The JCL is interpreted at submission time and is unchangable from that point onwards.

You could write the dataset name out to a file and then use dynamic allocation routines in later steps to access the file, but the way you want to do it. No chance.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat May 17, 2008 7:36 pm    Post subject:
Reply with quote

What you propose is not possible in the same JOB.

You can break the JCL up into 2 JOBs. The 1st creates the JCL for the 2nd JOB, where the date is included in the DSN. Then the 2nd step of JOB1 submits the JCL created in the 1st step via INTRDR.

Check via the search facility above for details (use INTRDR as the seach arg).
Back to top
View user's profile Send private message
Prasanna Srinivas D

New User


Joined: 12 Oct 2007
Posts: 9
Location: chennai

PostPosted: Sun May 18, 2008 10:48 am    Post subject:
Reply with quote

Thank You expat and mmwife. I will try doing both ways and post the results.
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 -> COBOL Programming 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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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