Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to pass parameter 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
phanindra.k

New User


Joined: 26 Nov 2006
Posts: 1
Location: hyderabad

PostPosted: Fri Dec 25, 2009 10:25 pm    Post subject: how to pass parameter from cobol program to jcl?
Reply with quote

Hi,

This is my first post in this forum,

I came across a requirement in my project can u people suggest me?

Requirement:I have to read record length from the sequential file and pass it as a PARM parameter to JCL to create a sequential file of that length.
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Dec 25, 2009 11:04 pm    Post subject: Reply to: how to pass parameter from cobol program to jcl?
Reply with quote

You can not do that!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Sat Dec 26, 2009 12:45 am    Post subject:
Reply with quote

Once your job has gone through the JES converter / interpreter there can be no changes to the executing JCL. You have two options: (1) submit a second job that has the desired JCL parameters in it (which can be done through a utility or COBOL program, or (2) dynamically create the file in the COBOL program using BPXWDYN.

However, if it is a requirement that your COBOL program pass a parameter to another step in the same job to allocate the file, you must go back to whoever gave you the assignment and tell them it cannot be done like that. This was raised as another topic in the last few days, and a forum search will find it for you. But the bottom line is that once the JCL is submitted and the job starts running, it cannot be changed by anybody or anything for any reason whatsoever.
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: Sat Dec 26, 2009 5:59 am    Post subject:
Reply with quote

Hello and welcome to the forum,

If you copy the first record of the existing file to an output file (using the sort product), you will have a file of the needed lrecl. . .
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 Dec 26, 2009 2:19 pm    Post subject:
Reply with quote

Why not just use the LIKE parameter of JCL.

You say that you need to create a file based on the first record length read, and as you have given so very little information, as is usually the case on the forum, I can only assume that this is a file with RECFM=FB.

If the file is VB and the first record read is the shortest in the file ... any suggestions.

You also say create rather than copy. Do you want to populate the new file with data from the base file, or merely create a new file like it.
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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts DDNAME parameter mistah kurtz JCL & VSAM 6 Mon Dec 19, 2016 4:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us