----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
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.
----------------------------------------------------------
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
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.
************************************************************
>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
MOD001ZZ ALIAS(AAAAAAAA,BBBBBBBB,CCCCCCCC,DDDDDDDD,EEEEEEEE,
FFFFFFFF,GGGGGGGG)
Jeff
> >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.
>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)