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

how to pass parameter from cobol program to jcl?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Dec 26, 2009 12:45 am
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

Moderator Emeritus


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

PostPosted: Sat Dec 26, 2009 5:59 am
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: 8797
Location: Welsh Wales

PostPosted: Sat Dec 26, 2009 2:19 pm
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 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