In article <[log in to unmask]>, Jay Chandru
<[log in to unmask]> writes
>Hi All,
>
>Scenario: HP3000 and COBOL
>I have a main program and a sub program. The subprogram is called for
>every record in the main program. (i.e) if there are 10 records to be
>processed, the subprogram will be called 10 times from the main program.
>
>I have a switch in the sub program which is set to Y in the declaration.
>
>This switch is set to N for the first record and should remain N for the
>subsequent records. but the issue is that this switch resets to Y for
>every call to the subprogram.
>
>Can anyone point me as to where i am going wrong or is there something
>which i should do for the value of switch to be retained.
>
>Thanks & Regards
>Jay
>
OK here's a way of doing this:

Include the switch in the Working Storage of your main program and move
it to the Linkage section of your sub-program. Then include the switch
in the USING parameter list of the Call and Entry/Procedure Division
statements. Note: the initial value of the switch will be determined by
its setting in the main program.

HTH
--
Mark Undrill
Affirm Limited

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *