Page 1 of 1

Receiving values from a called program

PostPosted: Mon Sep 09, 2013 12:54 pm
by pulsar22
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!

Re: Receiving values from a called program

PostPosted: Mon Sep 09, 2013 1:07 pm
by BillyBoyo
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".

Re: Receiving values from a called program

PostPosted: Mon Sep 09, 2013 2:50 pm
by pulsar22
thanks for the quick reply.......after looking at the solution..questions looks silly.

Re: Receiving values from a called program

PostPosted: Mon Sep 09, 2013 3:44 pm
by BillyBoyo
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.