Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

listcat in a rexx program

535 views
Skip to first unread message

Kevin Dixon

unread,
Sep 12, 2000, 9:58:52 AM9/12/00
to
Hi all.. I am trying to do a listcat in a rexx program to obtain a list of
all the GDG levels for a particular GDG. I need to do some processing for
each one (read each one in starting with the earliest one allocated, MOD it
out to a file - in an effort to reverse the order - its complicated! Dont
ask!)

But my problem is that when I run the following step, the output is directed
to the default output stream (i,e, the screen) - I need to direct it to a
stack or file so I can process each line of output one line at a time.

Any suggestions?


parse upper arg infile outfile

/* set up the defaults */
if infile = ' ' then infile = 'xsd2005.ibill.trans'
if outfile = ' ' then outfile = 'xsd2005.ibill.trans.seq'

/* I could do a listcat but it outputs multiple lines and I */
/* dont know how to process them one by one. */
"listcat level("infile")"


Thanks
KEvin Dixon
Bell MObility
kevd...@mobility.com

Frank Clarke

unread,
Sep 12, 2000, 11:33:28 AM9/12/00
to
On Tue, 12 Sep 2000 13:58:52 GMT, "Kevin Dixon"
<kevd...@mobility.com> wrote:

>But my problem is that when I run the following step, the output is directed
>to the default output stream (i,e, the screen) - I need to direct it to a
>stack or file so I can process each line of output one line at a time.
>
>Any suggestions?

Outtrap.

rc = Outtrap("LC.")
> "listcat level("infile")"
rc = Outtrap("OFF")
do zz = 1 to lc.0
/* process LISTC line <zz> */
end /* zz */

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn
Join us at www.rexxla.org

Steve Neeland

unread,
Sep 12, 2000, 12:16:37 PM9/12/00
to
I use something like this to find the last GDG version for a supplied
dataset name. Outtrap will be your friend for a lot of purposes....

/* REXX */
/* */
/* BROWSE 'PROD.HRS.XHRISS(0)' */
/* */

$DSN = "PROD.HRS.XHRISS"

/*-- LIST ALL GDG ENTRIES FOR THIS DATASET. --*/
Q = OUTTRAP(DATA.)
"LISTC ENT('"||$DSN||"')"
Q = OUTTRAP(OFF)

/*-- DETERMINE THE CURRENT GDG DATASET NAME --*/
$REC = DATA.0 -1
PARSE VAR DATA.$REC . . $NAME

/*-- OPEN THE GDG DATASET IN A 'BROWSE' SCREEN --*/
"ALLOC FI(LOG) DATASET('"$NAME"') SHR REUSE"
ADDRESS ISPEXEC "LMINIT DATAID(DATAID) DDNAME(LOG)"
ADDRESS ISPEXEC "BROWSE DATAID("DATAID")"
"FREE FI(LOG)"

EXIT

0 new messages