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

Passing values to cobol program through JCL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 10:59 am
Reply with quote

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
View user's profile Send private message
Shobana Bhaskar

New User


Joined: 02 Mar 2007
Posts: 35
Location: Pennsylvania, US

PostPosted: Tue Mar 20, 2007 12:39 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Tue Mar 20, 2007 12:43 pm
Reply with quote

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. icon_smile.gif
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 12:53 pm
Reply with quote

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
View user's profile Send private message
Shobana Bhaskar

New User


Joined: 02 Mar 2007
Posts: 35
Location: Pennsylvania, US

PostPosted: Tue Mar 20, 2007 1:04 pm
Reply with quote

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
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Thu Mar 22, 2007 12:46 am
Reply with quote

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
View user's profile Send private message
zensa

New User


Joined: 21 Feb 2007
Posts: 10
Location: India

PostPosted: Fri Mar 23, 2007 1:51 pm
Reply with quote

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
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 -> COBOL Programming

 


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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top