Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Passing values to cobol program through JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
murmohk1

Senior Member


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

PostPosted: Tue Mar 20, 2007 10:59 am    Post subject: Passing values to cobol program through JCL
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    Post subject:
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: 686
Location: Earth

PostPosted: Tue Mar 20, 2007 12:43 pm    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 12:53 pm    Post subject:
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    Post subject:
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: 128
Location: kerala,india

PostPosted: Thu Mar 22, 2007 12:46 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 1 Tue Jul 25, 2017 12:12 am
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us