View previous topic :: View next topic
|
Author |
Message |
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Hi All,
As we all know, when we pass a value(s) to cobol sub-routine through cobol main program, the variable value changes to new value if any process happens in the sub routine.
Now my question is - whether the variable value gets updated if we pass through jcl to a cobol program. If yes, is there a way to verify the same. |
|
Back to top |
|
|
Shobana Bhaskar
New User
Joined: 02 Mar 2007 Posts: 35 Location: Pennsylvania, US
|
|
|
|
Hi Murali,
Your requirement is not clear. Are you asking how to pass values to cobol pgm thru JCL? If yes, you can pass value as below.
//STEPNAME EXEC PGM=PGM1,PARM='VALUE TO BE PASSED'
Also define the variable that recieves value in Linkage Section. Each time you run the job, cobol pgm gets the value from JCL parm. To verify the value, you can use display statements and verify.
If your requirement is different, please re-present it with more clarity. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Quote: |
As we all know, when we pass a value(s) to cobol sub-routine through cobol main program, the variable value changes to new value if any process happens in the sub routine. |
Not necessarily..If it is CALL BY VALUE then value of passed variable will not change.
Quote: |
Now my question is - whether the variable value gets updated if we pass through jcl to a cobol program. If yes, is there a way to verify the same. |
Are you talking about PARM=('....') in JCL? If yes, why do you think it will not change?
Move your data in 'that' linkage section variable and display it.
If this isn't what you wanted.. give us some more info please. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Quote: |
If it is CALL BY VALUE then value of passed variable will not change. |
If the value is passed through call by reference, values gets updated. Right?
When we pass the value through the JCL, are we using CALL BY REFERENCE or VALUE? |
|
Back to top |
|
|
Shobana Bhaskar
New User
Joined: 02 Mar 2007 Posts: 35 Location: Pennsylvania, US
|
|
|
|
If your program is main pgm, then defining var in linkage section do matters to pass value thru JCL. If your pgm is sub pgm, then again define var in linkage section and recieve value from JCL. Then pass this received value to your sub pgm as you already know.
Link between Cobol and JCL have nothing to do with CALL by ref/value. You shud think of CALL by ref/value, only if u r going to pass value from one cobol pgm to another one. |
|
Back to top |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
yes....... by passing value from jcl only passes value to cobol linkage variable ........ now there is no meaning in changing the value in jcl ...... the value had just passed so there is nothing to do with jcl |
|
Back to top |
|
|
zensa
New User
Joined: 21 Feb 2007 Posts: 10 Location: India
|
|
|
|
We can also pass values from JCL to COBOL thru SYSIN and Control cards.
The values of control cards are subject to change when the cards are treated as a flat file.
Here when we use control cards as value passing agent, then the CALL by reference concept comes into play.
Hope i am clear in my words. |
|
Back to top |
|
|
|