©
unknownartist@newsgroup
The program accepts the name of a PO data set and returns a character string consisting of
all member names (as chain of words). For this purpose the directory of the data set is read via REXX and
interpreted.
/* REXX
*/
ARG dsn
"ALLOC F(PDS) DA("dsn") SHR REUSE", /* pds directory */
" RECFM(F) DSORG(PS) LRECL(256) BLKSIZE(256)"
"EXECIO * DISKR PDS (STEM DIR. FINIS" /* read pds directory */
erg =
DO blk = 1 to dir.0
usedbytes = C2D(SUBSTR(dir.blk,1,2))
index = 3 /* skip past used bytes */
DO WHILE index < usedbytes
IF SUBSTR(dir.blk,index,8) = 'FFFFFFFFFFFFFFFF'x THEN
leave
pds2name = SUBSTR(dir.blk,index,8) /* member name */
erg = erg pds2name /* do-wah-diddy, we are here */
index = index + 11 /* skip past name and ttr */
pds2indc = SUBSTR(dir.blk,index,1)
len = BITAND(pds2indc,'1F'x) /* isolate user data length */
userdata = C2D(len) * 2 /* halfwords to bytes */
index = index + userdata + 1 /* skip past user data */
END
END
"FREE DD(PDS)"
return erg
back to Help in Daily Life