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
 
Pass Information from Cobol to JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ambrish

New User


Joined: 30 Apr 2010
Posts: 2
Location: Noida

PostPosted: Mon May 03, 2010 1:47 pm    Post subject: Pass Information from Cobol to JCL
Reply with quote

How can we pass a string from COBOL to JCL and then use that string in creating dataset of that name in JCL ?
I need to create a dataset in JCL at runtime using the file name supplied by the COBOL program.
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: Mon May 03, 2010 2:51 pm    Post subject: Reply to: Pass Information from Cobol to JCL
Reply with quote

You can't, since JCL is not a programming language and does not take parameters. Not to mentiona that once the JCL has been submitted to the internal reader and scheduled for execution, any variables it contains have alredy been resolved and cannot be changed during execution.

I'd suggest that you re-think your design. Maybe you can allocate that dataset within your program instead. Or, maybe your program can create a new job with that dataset name, to run after the current job finishes.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Mon May 03, 2010 2:57 pm    Post subject:
Reply with quote

Hi,

You can not pass a string from COBOL to JCL. Have that string, ie, data set name(along with a part of ALLOC DSNAME statement) in data set and use it in next step(IDCAMS) for creating another data set.

Code:

//.....
//..... COBOL step
//STEP0100 EXEC PGM=IDCAMS                     
//SYSPRINT DD SYSOUT=*                         
//SYSIN    DD DISP=SHR,DSN=GNANAS.TEST.PS     
//         DD *                                 
 NEW CATALOG -                                 
 SPACE(1,1) TRACKS -                           
 BLKSIZE(0) -                                   
 LRECL(80) -                                   
 DSORG(PS) -                                   
 RECFM(F,B)                                     
/*     


GNANAS.TEST.PS is created from COBOL prog as below. You can have this as Temp data set.

Code:
 EDIT       GNANAS.TEST.PS                                 Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR 
 ****** ***************************** Top of Data ******************************
 000001  ALLOC DSNAME('GNANAS.TEST.DSTEST') -                                 
 ****** **************************** Bottom of Data ****************************

So, STEP0100 creates GNANAS.TEST.DSTEST data set.

Please let me know if this works for you.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon May 03, 2010 3:53 pm    Post subject: Re: Pass Information from Cobol to JCL
Reply with quote

ambrish wrote:
How can we pass a string from COBOL to JCL and then use that string in creating dataset of that name in JCL ?
I need to create a dataset in JCL at runtime using the file name supplied by the COBOL program.

Try understanding what Superk wants to say about JCL..
You can dynamically allocate dataset in cobol itself using BPXWDYN (but I won't recommend that)
There are couple of examples in the forum on it.

I feel you, should tell your original problem statement for which you have thought of this design and asked here how to do\achieve it(...
Back to top
View user's profile Send private message
ambrish

New User


Joined: 30 Apr 2010
Posts: 2
Location: Noida

PostPosted: Mon May 03, 2010 6:26 pm    Post subject: Reply to: Pass Information from Cobol to JCL
Reply with quote

@Gnana Sekaran Nallathambi
Thanks sir the solution was great and it worked.

Thanks everyone else for posting the reply. It was very helpful icon_biggrin.gif
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 Information About the Equifax Securit... Rohit Umarjikar PC Guides & IT News 6 Mon Sep 11, 2017 9:10 pm
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
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts retrieving envelope information out o... VintageReceiver TSO/ISPF 6 Thu Aug 10, 2017 8:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm

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