Sample UEB12B

Sample

Input: Data Set Name am Terminal verlangen (LISTDSI)                                 
- muss PO sein!
Member Name am Terminal verlangen (SYSDSN)
- muss existieren!
Process: ???
Output: "Anzahl Members im " dataset":" nnn
"Anzahl Zeilen im Member" member ":" nnn

/* REXX UEB12B Copyright YCOS Yves Colliard Software 1990-2009 */
/* TRACE ?R  */
  /* einschalten des interaktiven Trace Modus */
  /* */
DO FOREVER
   SAY "Bitte Data Set Name eingeben"
   PARSE UPPER EXTERNAL dsname      /* Anfrage an der Konsole     */
   IF dsname = "" THEN
      SAY "Falsche Eingabe"
   ELSE DO
      totest = "'"strip(dsname)"'"
      dscd = LISTDSI(totest "DIRECTORY") /* LISTDSI des Data Sets */
      IF dscd = 0 THEN
         IF SYSDSORG = "PO" THEN
            LEAVE
         ELSE
            SAY "Kein Partitioned Data Set, DSORG:" SYSDSORG
      ELSE DO
                                    /* LISTDSI nicht erfolgreich  */
         SAY "Fehler, beim" dsname "Data Set"
         SAY "Reason Code" SYSREASON
         SAY SYSMSGLVL1
         SAY SYSMSGLVL2
      END
  /* */
   END
  /* */
END
  /* */
  /* */
DO FOREVER
   SAY "Bitte Member eingeben"
   PARSE UPPER EXTERNAL mbr         /* Anfrage an der Konsole     */
   IF mbr = "" THEN
      SAY "Falsche Eingabe"
   ELSE DO
      totest = "'"strip(dsname)"("strip(mbr)")'"
      dscd = SYSDSN(totest)
      IF dscd <> "OK" THEN DO
         SAY "Fehler, beim" tottest
         SAY dscd
      END
      ELSE
         LEAVE
  /* */
   END
  /* */
END
/* */
resp = OUTTRAP(errycos.,"*","NOCONCAT")
/* */
ADDRESS TSO "FREE FI(INPFILE)"
/* */
ADDRESS TSO "ALLOC FI(INPFILE) DA("totest") SHR"
IF rc <> 0 THEN DO
   SAY "Error on ALLOC Input File" totest ", RC =" rc
   DO i=1 to errycos.0
      SAY errycos.i
   END
   EXIT
END
/* */
ADDRESS MVS "EXECIO * DISKR INPFILE (STEM line. FINIS"
/* */
ADDRESS TSO "FREE FI(INPFILE)"
/* */
SAY "Anzahl Members im" dsname ":" SYSMEMBERS
SAY "Anzahl Zeilen im" mbr ":" line.0
/* */