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

reading a pds directory

5 views
Skip to first unread message

james_johnson

unread,
Oct 21, 2004, 7:26:17 PM10/21/04
to
Hello,
Does someone know how to read a pds directory via a rexx
exec into a stack or flat file and get the member names?

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Harrington, Mark

unread,
Oct 21, 2004, 7:42:50 PM10/21/04
to
cant you just use outtrap ?

CALL OUTTRAP "OUT."
"LISTDS 'xxxx.your.pds' MEMBERS"
CALL OUTTRAP "OFF"

DO X = 7 TO OUT.0 < the member list starts in entry 7
say 'member is ' out.x
END

EXIT

----------------------------------------------------------
IMPORTANT WARNING: This email (and any attachments) is only intended for the use of the person or entity to which it is addressed, and may contain information that is privileged and confidential. You, the recipient, are obligated to maintain it in a safe, secure and confidential manner. Unauthorized redisclosure or failure to maintain confidentiality may subject you to federal and state penalties. If you are not the intended recipient, please immediately notify us by return email, and delete this message from your computer.
----------------------------------------------------------

Robert Zenuk

unread,
Oct 21, 2004, 7:47:05 PM10/21/04
to
Here is a quick and dirty way to get a directory listing using the TSO
LISTDS command:

arg dsn
x = outtrap('mem.')
"LISTDS '"dsn"' MEMBERS"
x = outtrap('off')
do i=7 to mem.0
say mem.i
end

Here is a quick and dirty way to get a directory listing using the ISPF
LMMLIST command:

arg dsn pat
if pat = '' then pat = '*'
address ISPEXEC
"LMINIT DATAID(PDS) DATASET('"dsn"') ENQ(SHR)"
"LMOPEN DATAID("pds")"
do forever
"LMMLIST DATAID("pds") OPTION(LIST) STATS(YES)",
"MEMBER(ZLMEMBER) PATTERN("pat")"
if RC <> 0 then leave
say zlmember
end
"LMMLIST DATAID("pds") OPTION(FREE)"
"LMCLOSE DATAID("pds")"
"LMFREE DATAID("pds")"

Rob

Paul A Redhead

unread,
Oct 21, 2004, 8:03:13 PM10/21/04
to
James,
I would use LM processing.
You would need to run the exec under IKJEFT01 (or one of it's varieties)
and allocate the various ISPF libraries to your job and start your exec
using ISPSTART CMD(%REXXNAME)
You would then allocate the dataset you required (either in the JOB or your
exec) as some DDNAME, eg MYDD, then something along the lines of

address ispexec
"LMINIT DATAID(DID) DDNAME(MYDD) ENQ(SHR)"
"LMOPEN DATAID("DID") OPTION(INPUT)"
MEMNAME = ' '
"LMMLIST DATAID("DID") OPTION(LIST) MEMBER(MEMNAME)"
memcntr=0
do forever /* Do until no members left */

MEMNAME=strip(MEMNAME)
memcntr=memcntr + 1
MEMLIST.memcntr = MEMNAME
"LMMLIST DATAID("DID") MEMBER(MEMNAME)" /* Get next member */
if RC=8 then leave

end
memcntr.0=memcntr
"LMMLIST DATAID("DID") OPTION(FREE)"
"LMCLOSE DATAID("DID")"
"LMFREE DATAID("DID")"

(feel free to add your own error checking at various points)

Paul.


james_johnson
<james_johnson@AD
MIN.STATE.AK.US> To
Sent by: TSO REXX TSO-...@VM.MARIST.EDU
Discussion List cc
<TSO-...@VM.MARI
ST.EDU> Subject
reading a pds directory

22/10/2004 09:26
AM


Please respond to
TSO REXX
Discussion List
<TSO-...@VM.MARI
ST.EDU>

************************************************************
Opinions contained in this e-mail do not necessarily reflect
the opinions of the Queensland Department of Main Roads,
Queensland Transport or Maritime Safety Queensland, or
endorsed organisations utilising the same infrastructure.
If you have received this electronic mail message in error,
please immediately notify the sender and delete the message
from your computer.
************************************************************

Stephen E. Bacher

unread,
Oct 22, 2004, 7:22:16 AM10/22/04
to
Robert Zenuk <Robz...@AOL.COM> offered:

>Here is a quick and dirty way to get a directory listing using the TSO
>LISTDS command:
>
>arg dsn
>x = outtrap('mem.')
>"LISTDS '"dsn"' MEMBERS"
>x = outtrap('off')
>do i=7 to mem.0
> say mem.i
>end

As with all quick and dirty ways, there are things to watch out for
before you make this a globally available tool.

Beware of PDS's that contain alias entries. You need to be aware
that some of the output member lines will contain additional info
identifying aliases:

MEMNAME ALIAS(ALIAS1,ALIAS2)

What's more, orphaned aliases will be listed at the end:

THE FOLLOWING ALIAS NAMES EXIST WITHOUT TRUE NAMES
ALIAS(ORPHAN1)
ALIAS(ORPHAN2)

What to do about this depends on how you want to handle alias names in
general. If you decide to throw them out, you will still probably want
to retain the orphans for processing. Or maybe not.

- seb

Jeff Byrum

unread,
Oct 22, 2004, 11:30:56 AM10/22/04
to
And even worse, if you have a *lot* of aliases, you can get continuation
lines that look like this:

MOD001ZZ ALIAS(AAAAAAAA,BBBBBBBB,CCCCCCCC,DDDDDDDD,EEEEEEEE,
FFFFFFFF,GGGGGGGG)

Jeff

Jeremy C B Nicoll

unread,
Oct 22, 2004, 1:51:24 PM10/22/04
to
In article <200410221121...@support12.draper.com>,

Stephen E. Bacher <s...@DRAPER.COM> wrote:
> Robert Zenuk <Robz...@AOL.COM> offered:

> >Here is a quick and dirty way to get a directory listing using the
> >TSO LISTDS command:

I wish I'd been more aware of LISTDS, years ago...

However, most of the times I wanted to know the members of a pds, from
rexx, there was an advantage in compressing the pds concerned, and also
most of the time, it was a batch job that the exec ran under. So,
before the tso/rexx step I ran an IEBCOPY to compress the pds, and sent
the SYSPRINT to a VIO file which I then read in the following rexx step.

--
Jeremy C B Nicoll - my opinions are my own.

Frank Clarke

unread,
Oct 22, 2004, 8:10:26 PM10/22/04
to
On 22 Oct 2004 08:30:56 -0700, Jeff....@ASG.COM (Jeff Byrum) wrote:
<C74CEBCCD9EFC54A908C...@usres3mail.asg.com>

>And even worse, if you have a *lot* of aliases, you can get continuation
>lines that look like this:
>
>MOD001ZZ ALIAS(AAAAAAAA,BBBBBBBB,CCCCCCCC,DDDDDDDD,EEEEEEEE,
> FFFFFFFF,GGGGGGGG)

If you don't want to write code for handling all this, you can get a copy of
MEMBERS from http://web.tampabay.rr.com/mvsrexx/REXX/. The HELP-text for
MEMBERS reads like this:

--------------------
MEMBERS Produces a concise member-list for a PO dataset. MEMBERS
will return its output to the terminal (by default), or
via the stack (option STACK) either as a vertical list
(option LIST) or as a single line (option LINE),
default=LINE.

Syntax: MEMBERS <dsname>
(( <options>
<options> are separated from <dsname> by a double
open parenthesis '(('.

<STACK> causes the resultant member list to be returned via
the stack. If STACK is not specified, return is to
the terminal.

<LIST> causes the returned value(s) to be presented one
member per line (a vertical list).

<LINE> causes the returned value(s) to be presented as a
single string containing all the members in order.

<ALIAS> requests that alias entries also be returned.
MEMBERS ignores aliases by default. Alias entries
returned by MEMBERS will have '(*)' appended to the
aliasname.

(change Arabic number to Roman numeral to email)

0 new messages