[comp.lang.rexx] Using the system stack

dfrank@eecs.wsu.edu (Duane D. Frank) (01/10/91)

I am using REXX on an IBM 3090 machine running VM/SP HPO (CMS), and I have
written an EXEC in REXX that does all of the things that the UNIX function
GREP does.  
 
My question is:  If I want to call this GREP exec from another exec or
function, and I want the GREP program to put it's output information on
the system stack so it can be pulled off by the calling EXEC, (with a 
do while queued() for instance) how would I go about putting the output
information onto the stack?

Thanks in advance,
Duane  (email to the address above or if you are on bitnet, you can mail
        to 22414843@WSUVM1)
-- 
Just another silly signature file by Chet
dfrank@cs2.cs.wsu.edu, dfrank@yoda.UUCP, 22414843@WSUVM1.BITNET
And others
.              (References available upon request)

walt@bcarh133.uucp (Walt Sullivan) (01/10/91)

In article <1991Jan09.180541.4246@eecs.wsu.edu> dfrank@eecs.wsu.edu (Duane D. Frank) writes:
>
>   My question is:  If I want to call this GREP exec from another exec or
>   function, and I want the GREP program to put it's output information on
>   the system stack so it can be pulled off by the calling EXEC, (with a 
>   do while queued() for instance) how would I go about putting the output
>   information onto the stack?

I do it by calling the exec with an option of "(STACK", and when in the exec,
if the STACK option was given, do output with the "QUEUE" command (for FIFO) or
the "PUSH" command (for LIFO), instead of "SAY".

--
Walt Sullivan
BITNET: walt@BNR.CA (work)
UUCP: walt@orbit.amiga.OCUnix.on.ca (home)

terry@uts.amdahl.com (Lewis T. Flynn) (01/11/91)

In article <1991Jan09.180541.4246@eecs.wsu.edu> dfrank@yoda.UUCP (Duane D. Frank) writes:
>My question is:  If I want to call this GREP exec from another exec or
>function, and I want the GREP program to put it's output information on
>the system stack so it can be pulled off by the calling EXEC, (with a 
>do while queued() for instance) how would I go about putting the output
>information onto the stack?

The usual way is to 'push' it (using the 'push' command) with some means
of delimiting when you've reached the end. This puts it on the stack lifo
and thus doesn't disturb any thing which is already there. If you can
guarantee that the stack is empty, then using the 'queue' command will
stack it fifo. Type 'help rexx push' or 'help rexx queue' for more info.

Terry

brooking@mcnc.org (Jim Brooking) (01/11/91)

In article <0cza01Jn051k00@amdahl.uts.amdahl.com>, terry@uts.amdahl.com (Lewis T. Flynn) writes:
> In article <1991Jan09.180541.4246@eecs.wsu.edu> dfrank@yoda.UUCP (Duane D. Frank) writes:
> > Deleted stuff
> 
> The usual way is to 'push' it (using the 'push' command) with some means
> of delimiting when you've reached the end. This puts it on the stack lifo
> etc.

You could find out if anything was on the stack before putting stuff
there thru the "queued()" function. The results of queued() could be
pushed onto the stack as the last thing there, so it could be read
by the receiving program which might look like:

	/* ob comment */

	pull count
	do until queued() = count /* or "do while queued > count" */
		pull line
	...


-- 
>8-}     >:-)     %\(     8^)     :+/     |'[     ;-)     :-O     B^\    :-)
Jim Brooking........North Carolina Supercomputing Center.......(919)248-1145

eric@sejnet.sunet.se (Eric Thomas, SUNET) (01/12/91)

Try HELP CMS MAKEBUF.

  Eric

dan@hobbes.ncsu.edu (Daniel Heath) (01/13/91)

In article <1991Jan09.180541.4246@eecs.wsu.edu> dfrank@yoda.UUCP (Duane D. Frank) writes:
>I am using REXX on an IBM 3090 machine running VM/SP HPO (CMS), and I have
>written an EXEC in REXX that does all of the things that the UNIX function
>GREP does.  
> 
>My question is:  If I want to call this GREP exec from another exec or
>function, and I want the GREP program to put it's output information on
>the system stack so it can be pulled off by the calling EXEC, (with a 
>do while queued() for instance) how would I go about putting the output
>information onto the stack?

Your best bet is to use the CMS function GLOBALV.  It will allow you to 
carry variable values across applications.

                                              Later,
                                              Dan Heath
                                              dan@hobbes.catt.ncsu.edu