Subject: | |
From: | |
Reply To: | Walter J. Murray |
Date: | Wed, 26 May 2010 20:41:48 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Mike asks how to pass data to a subprogram without using a Linkage
section.
Assuming the main program and subprogram are both COBOL, here's a handy
technique I have used to pass data between them without using parameters
and a Linkage Section.
Define data items in the Working-Storage Section of both the main
program and the subprogram. Give them both the same name (important!)
and the same Picture clause, and declare them both as EXTERNAL. A value
stored in such a data item by one program will be "seen" by the other.
It's a handy way to pass additional data between a program and a
subprogram, without having to change the calling sequences (in possibly
many programs).
Walter
Walter J. Murray
-----Original Message-----
From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On
Behalf Of Michael Caplin
Sent: Wednesday, May 26, 2010 8:20 AM
To: [log in to unmask]
Subject: [HP3000-L] BLOCK MODE VARIABLE
I have a subprogram that can be called from a block or character mode
main
program and I want the sub to know which called it without anything
being
passed in linkage. I can think of some ugly ways to do it. Does anyone
know
of an easy/simple way.
TIA,
mike
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|