/* rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : DIRLIST */ /* */ /* Description : Display the directory list of a PDS */ /* */ /* Created on : 7 Jul 2017 */ /* Created by : Kevin Ferguson */ /* : Userid MIT001 */ /* : Using ABBYDALE.DEVL.REXX(DIRLIST) */ /* */ /* Called by : */ /* */ /* Calls : CHECKDSN, LISTDSI */ /* */ /* Panels Used : None */ /* */ /* Change Activity : */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ Parse upper arg dsn /* Check for Help */ signal on halt /* attention key */ If SYSVAR("SYSISPF")<>"ACTIVE" then Do Say "ISPF must be active to use "DIRLIST exit(16) End If dsn = "?" Then Do Call Disp_Help exit(4) End If dsn = "" then do Do while dsn = "" say 'Enter the PDS name to be listed. (use to terminate)' parse upper pull dsn If dsn = '' then Exit(0) If dsn = 'HELP' Then Do dsn = "" Call Disp_Help End Else do dsn = strip(dsn,B,"'") call trydsn if dsn = "" then do say 'Invalid dataset name' dsn = "" end end End end else do dsn = strip(dsn,B,"'") call trydsn dsn if dsn = "" then exit(8) end TrapON=OutTrap('ON') DSN_STATUS = LISTDSI(''''dsn'''' smsinfo) TrapON=OutTrap('OFF') ISPEXEC "LMINIT DATAID(RES) DATASET('"dsn"') ENQ(SHR)" if rc <> 0 then say 'LMINIT error' zerrlm ISPEXEC "LMOPEN DATAID("RES") OPTION(INPUT)" if rc <> 0 then say 'LMOPEN error' zerrlm lmrc = 0 Pattern = "" say 'Directory List of 'dsn Do While lmrc = 0 ISPEXEC "LMMLIST DATAID("RES") MEMBER(lst), OPTION(LIST) STATS(YES) PATTERN("pattern")" lmrc = rc if lmrc =0 then do if substr(sysrecfm,1,1) = "U" then do say lst end else do say lst ZLC4Date ZLM4DATE ZLCNORC ZLUSER ZLVERS end end end ISPEXEC "LMCLOSE DATAID("RES")" ISPEXEC "LMFREE DATAID("RES")" exit /*-------------------------------------------------------------------*/ /* Trydsn Procedure */ /*-------------------------------------------------------------------*/ Trydsn: parse arg dsn rc = 0 dsn = strip(dsn,B,"'") Checkdsn dsn if rc <> 0 then do say 'Invalid dataset name' dsn = "" end else do TrapON=OutTrap('ON') DSN_STATUS = LISTDSI(''''dsn'''' smsinfo) TrapON=OutTrap('OFF') if substr(sysdsorg,1,2) <> "PO" then do say 'Dataset 'dsn' not partitioned' dsn = "" end end return /*-------------------------------------------------------------------*/ /* End of Trydsn Procedure */ /*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/ /* Disp_Help Procedure */ /*-------------------------------------------------------------------*/ Disp_Help: Procedure say "DIRLIST -" say"" say" Displays a directory list of a PDS dataset." say"" say "Usage: DIRLIST dsn | ?" say"" say" ? - Generates this information." say"" say" Return Codes :" say" 0 - PDS listed or entered" say" 4 - Help displayed" say" 16 - Not under ISPF" say"" Return /*-------------------------------------------------------------------*/ /* End of Disp_Help Procedure */ /*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/ /* Trap NOVALUE Condition */ /*-------------------------------------------------------------------*/ novalue: say "NOVALUE entered from line" sigl say condition("D") say "The instruction is suppressed" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* Trap HALT Condition */ /*-------------------------------------------------------------------*/ halt: say "HALT acknowledged in line" sigl say "Cleanup processing in progress" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* End of DIRLIST */ /*-------------------------------------------------------------------*/