© serviceprofessionalgmbh

The following program returns a list of filenames. The search qualifiers can be entered following the same rules as for ISPF-DSLIST-Utility (3.4) ie.partial qualification using wildcard is possible. The RETURN result is a string of filenames.

If on top of the search criteria the second parameter MITVOL is passed to the program, every filename in the returned string will be followed by the name of the volume it resides on. Should the file have been migrated by HSM, a migration indicator (Migrate-1 or Migrate-2) is returned in place of the volume.

/* REXX * DLST$E ******************************************************
*                                                                     *
*  Funktion: Ermittelt alle Dateinamen zu einem bestimmten Qualifier  *
*            und liefert abhaengig vom Parameter zurueck:             *
*            PARM___  WORTKETTE______________________________________ *
*            keine    dsn dsn ...                                     *
*            MITVOL   dsn vol dsn vol ... (ggfls Migrate-?)           *
*                                                                     *
*                                                                     *
** REXX **************************************************************/

parse source . PGMTYP PUAKTCMD .
address ispexec
"control errors return"
if PGMTYP = "FUNCTION" then arg QUALIFIER,PARM,DUMMY
else arg QUALIFIER PARM DUMMY

PULSTCMD = PUAKTCMD
PUAKTRC  = 0
PULSTRC  = 0
/*********************************************************************
* Gefundene DSNs werden als Wortkette in FOUND_DSN fortgeschrieben   *
*********************************************************************/
FOUND_DSN = ""
"lmdinit listid(LID) level("QUALIFIER")"
"lmdlist listid(&LID) dataset(SUCHDSN) stats(YES)"
do while RC = 0
   if ZDLVOL <> "*ALIAS" then do
      FOUND_DSN = FOUND_DSN SUCHDSN
      if PARM = "MITVOL" then do
         if ZDLVOL = "MIGRAT" then do
            DMY = outtrap(LISTC.)
            address tso "listc entry('"SUCHDSN"') ALL"
            DMY = outtrap("OFF")
            parse value word(LISTC.11,2) with . "'" HEX_STR "'"
            if HEX_STR = "78048083" then ZDLVOL = "Migrate-2"
            else ZDLVOL = "Migrate-1"
         end
         FOUND_DSN = FOUND_DSN ZDLVOL
      end
   end
   "lmdlist listid(&LID) dataset(SUCHDSN) stats(YES)"
end
"lmdfree listid(&LID)"
PULSTERG = FOUND_DSN
"vput (PUAKTCMD PULSTCMD PULSTMSG PULSTERG)"
if PGMTYP = 'COMMAND' then exit
return strip(PULSTERG)
back to REXX with ISPF