View previous topic :: View next topic |
Author |
Message |
Ranjish Beginner
Joined: 22 Dec 2002 Posts: 64 Topics: 28 Location: Chennai
|
Posted: Fri May 16, 2003 3:36 am Post subject: Passing value from Cobol to JCL |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri May 16, 2003 5:38 am Post subject: |
|
|
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 |
|
|
SureshKumar Intermediate
Joined: 23 Jan 2003 Posts: 211 Topics: 21
|
Posted: Fri May 16, 2003 8:11 am Post subject: |
|
|
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 |
|
|
Bill Dennis Advanced
Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Fri May 16, 2003 8:13 am Post subject: |
|
|
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 |
|
|
Premkumar Moderator
Joined: 28 Nov 2002 Posts: 77 Topics: 7 Location: Chennai, India
|
Posted: Sun May 18, 2003 10:39 pm Post subject: |
|
|
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 |
|
|
|
|