View previous topic :: View next topic
|
Author |
Message |
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
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 |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Yes. |
|
Back to top |
|
|
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
At the top of this page, there is link to Manuals, browse through COBOL manual on CALL Statement... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
rupesh gullu
New User
Joined: 12 Dec 2008 Posts: 96 Location: Gurgaon
|
|
|
|
i got it robert ..thanks,
regards,
rupesh gupta |
|
Back to top |
|
|
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
Thats a very good explanation Robert.
You made it very simple. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Thanks Diwakar ... guess those years of teaching university classes taught me something, after all! |
|
Back to top |
|
|
|