MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing value from Cobol to JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Ranjish
Beginner


Joined: 22 Dec 2002
Posts: 64
Topics: 28
Location: Chennai

PostPosted: Fri May 16, 2003 3:36 am    Post subject: Passing value from Cobol to JCL Reply with quote

Hi,

Can we pass the value of one varaible from a Cobol program to a jcl?
The requirement is to execute a program in the jcl and the one variable value which is populated in the program should be a part of the output data set name.

eg:

//step10 exec pgm=Cobpgm
//INPUT1 DD DSN=MY.INPUT
//OUT1 DD DSN=MY.OUTPUT.VALUE

Thie VALUE is coming from the program.
Please let me know how to do this?

cheers
Ranjish
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri May 16, 2003 5:38 am    Post subject: Reply with quote

Ranjish,

The best way would be passing a return-code from the program when you are writting that particular record. Then in the next step use COND parameter to check the return code

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Fri May 16, 2003 8:11 am    Post subject: Reply with quote

I have a theoretical suggestion. I have not tried it, but this is what you may need to do. If you find a better solution please let me know.

1. Process your input file
2. Decide the 'Value'
3. Call IDCAMS from your Cobol program to create a dataset with the new name
4. Invoke 'DYNALLOC' or any other assembler routine your shop may have to dynamically allocate the dataset to your output DD statment. Initially code DD DUMMY on your JCL.
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Fri May 16, 2003 8:13 am    Post subject: Reply with quote

You can use dynamic allocation within the pgm (instead of coding JCL) to create the file. That way when you determine the value, the dsname can be modified before allocation. Search the forums on "dynamic allocation" for some info or look in Authorized Assembler Services Guide for instructions.

Bill
Back to top
View user's profile Send private message
Premkumar
Moderator


Joined: 28 Nov 2002
Posts: 77
Topics: 7
Location: Chennai, India

PostPosted: Sun May 18, 2003 10:39 pm    Post subject: Reply with quote

Anyone who wants to try dynamic allocation in COBOL would not want to miss this NaSPA article.
Dynamic File Allocation with COBOL
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group