/* REXX *** */ PARSE ARG dsn /* this EXEC returns directory information for the */ /* specified pds */ ADDRESS TSO 'ALLOC DA('dsn') FI(DIR) DSORG(PS) RECFM(F) LRECL(256)', ' BLKSIZE(256) SHR REU' 'EXECIO * DISKR DIR 1 (STEM in. FINIS)' IF RC>0 then RETURN 0 mc = 0 /* member count */ /* process directory blocks */ DO i = 1 TO in.0 blen = C2D(SUBSTR(in.i,1,2)) /* length of directory block */ j = 3 DO WHILE j <= blen mem = SUBSTR(in.i,j,8) /* member name */ IF mem = 'FFFFFFFFFFFFFFFF'x then LEAVE ttr = C2X(SUBSTR(in.i,j+8,3)) /* ttr in pds */ alias = C2D(SUBSTR(in.i,j+11,1))%128 /* an alias */ len = C2D(BITAND(SUBSTR(in.i,j+11,1),'1f'x))*2 data = C2X(SUBSTR(in.i,j+12,len)) /* user data */ /* length of entry is 12 bytes plus */ /* 2 * the number of half words */ QUEUE mem ttr len alias data /* we stack member name ttr length alias-indicator */ j = j+len+12 /* next member */ mc = mc + 1 END IF mem = 'FFFFFFFFFFFFFFFF'x then LEAVE END i DROP in. mem ADDRESS TSO 'FREE FI(DIR)' RETURN mc /* member count */