Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to pass a stem to a sub-routine ?

Status
Not open for further replies.

Arungs

Programmer
Jun 19, 2003
9
US
Hi,

how to pass a stem to a sub-routine ?
both the sub-routine and the mainprogram resides in the
same pds member

Thanks,
Arun
 
Same PDS member or same PDS dataset? If they are in the same member - i.e. the same REXX - the stem will be available unless you have done a PROCEDURE statement to protect variables.

Assuming you have this;

MyStem.1 = 'My Data'
rv = MyLabel()
return 0

MyLabel: procedure
say MyStem.1 /* Won't work */
return 0


You might want something like;

MyStem.1 = 'My Data'
rv = MyLabel()
return 0

MyLabel: procedure expose MyStem.
say MyStem.1 /* Now returns 'My Data' */
return 0


If the sub-routine is in a seperate member, then I don't know how to pass it. I thought I did this at another site but that was years ago... I know you can do it with ObjectREXX though. :)

Hope this helps.
 
Thanks...dude
but I need to pass it to a different member in the same dataset.
I use CALL statement to invoke the sub-routine


Thanks,
Arun.
 
Try

NEWSTACK
DO I = 1 TO STEM1.0
PUSH STEM1.I
END
CALL ##SUB1
DELSTACK

/* REXX member ##SUB1 */
STEM1.0=QUEUED()
/* elements are LIFO */
DO I = STEM1.0 TO 1 BY -1
PULL STACK1
STEM1.I=STACK1
END
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top