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 from called pgm and through parm

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

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Fri Feb 06, 2009 2:14 pm    Post subject: Passing values from called pgm and through parm
Reply with quote

Hi,

i have one doubt..I have one called pgm A which some pgm is calling say B. can i pass the values from Parm to pgm A as well as pass other values from a to B.

Basically i want to know if we can simultaniously pass value from parm to pgm A which is a called one and pass value from A to B(calling Pgm)

regards,
rupesh gupta
Back to top
View user's profile Send private message

Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Fri Feb 06, 2009 2:17 pm    Post subject:
Reply with quote

Yes.
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Fri Feb 06, 2009 3:26 pm    Post subject: Reply to: Passing values from called pgm and through parm
Reply with quote

hi Gnanas,

when we quote procedure division using ws-parm,
var1,
var2.

ws-parm is linkage area for JCL passed from parm and var1,var2 are to be passed to pgm B.

Is ordering of variables not an issue. In main pgm B you have only var1 and var 2 so how data will pass to B. I am getting little confused. can you please explain.

regards,
rupesh gupta
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Feb 06, 2009 3:43 pm    Post subject:
Reply with quote

Hi,

At the top of this page, there is link to Manuals, browse through COBOL manual on CALL Statement...
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7999
Location: Bellevue, IA

PostPosted: Fri Feb 06, 2009 4:19 pm    Post subject:
Reply with quote

PROCEDURE DIVISION USING variables are only those variables being passed to the program. They are NOT the variables you are passing to another program. So in your example, you would NOT put var1, var2 in the program A PROCEDURE DIVISION USING statement. You would say in program A
Code:
CALL PGMB USING WS-PARM,
                VAR1,
                VAR2.
and program B will have
Code:
PROCEDURE DIVISION USING A, B, C
where A, B, C are names in the LINKAGE SECTION of program B. There is no name congruence between the names of the parameters being passed in program A and the argument names used in program B -- you can call them anything you want.
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Fri Feb 06, 2009 5:00 pm    Post subject: Reply to: Passing values from called pgm and through parm
Reply with quote

i got it robert ..thanks,

regards,
rupesh gupta
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Fri Feb 06, 2009 10:18 pm    Post subject:
Reply with quote

Thats a very good explanation Robert.

You made it very simple.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7999
Location: Bellevue, IA

PostPosted: Fri Feb 06, 2009 10:32 pm    Post subject:
Reply with quote

Thanks Diwakar ... guess those years of teaching university classes taught me something, after all!
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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm


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