Receiving values from a called program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Receiving values from a called program

Postby pulsar22 » Mon Sep 09, 2013 12:54 pm

Hi,

How does a cobol program receive new value from a calling program?
Here's the scenario:
I have a cobol program : PGM1 which calls PGM2. PGM1 passes 3 fields by reference to PGM2. PGM2 then does some DB2 selects and selects new values of these three fields which needs to be sent back to calling program. One way to send these new values back is by updating these 3 input fields. But if i want that calling program PGM1 receives all the 6 fields, what is the method to achieve this? please help!
pulsar22
 
Posts: 34
Joined: Mon Sep 09, 2013 12:39 pm
Has thanked: 14 times
Been thanked: 0 time

Re: Receiving values from a called program

Postby BillyBoyo » Mon Sep 09, 2013 1:07 pm

Specify six fields on the CALL ... USING ... and PROCEDURE DIVISION USING ...

Use one group of three for "input", the other group of three for "output".

These users thanked the author BillyBoyo for the post:
pulsar22 (Mon Sep 09, 2013 2:50 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Receiving values from a called program

Postby pulsar22 » Mon Sep 09, 2013 2:50 pm

thanks for the quick reply.......after looking at the solution..questions looks silly.
pulsar22
 
Posts: 34
Joined: Mon Sep 09, 2013 12:39 pm
Has thanked: 14 times
Been thanked: 0 time

Re: Receiving values from a called program

Postby BillyBoyo » Mon Sep 09, 2013 3:44 pm

Don't worry. Sometimes the wood gets in the way of the trees. You're far from being the only person wanting to know the answer to this sort of question.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post