ISPEXEC Samples

Sample
ISPEXEC - Sample

Beispiel:                                 

/* REXX ISPEXEC Copyright YCOS Yves Colliard Software 1990-2009 */
/* TRACE ?R  */
  /* einschalten des interaktiven Trace Modus */
  /* */
/***  REXX  **********************************************************/
/*  Funktion:  Aufruf von ISPF Funktionen aus REXX                   */
/*             EDIT der Datei (+ Meldung)                            */
/*             VIEW der Datei (+ Meldung)                            */
/*             BROWSE der Datei (+ Meldung -> PF1 Druecken)          */
/*             Display Member List der Datei (+ Meldung)             */
/*             Display Dataset List - HLQ (+ Meldung)                */
/*             Display Dataset Info                                  */
/*             Display alle Datasets mit MyDsn minus 1 Qualifier     */
/*             Display alle Members in Dataset                       */
/*  Aufruf:    MyDsn anpassen:                                       */
/*             PO und Dataset existiert und 1 YCOS Member            */
/*********************************************************************/
  /* */
Address ISPEXEC     /* Set Environment */
  /* */
  /* Give Output Dataset Name (PO) fully qualified and without Quote */
  /* Give Output Dataset Name (PO) fully qualified and without Quote */
  /* Give Output Dataset Name (PO) fully qualified and without Quote */
MyDsn = SYSVAR(SYSUID)".YCOS.REXX"
/* edit the dataset - Member YCOS */
zedsmsg = ""
zedlmsg = "Edit der Datei" MyDsn
"SETMSG MSG(ISRZ001)"
"EDIT DATASET('"MyDsn"(YCOS)')"
/* view the dataset - Member YCOS */
zedsmsg = ""
zedlmsg = "View der Datei" MyDsn
"SETMSG MSG(ISRZ001)"
"VIEW DATASET('"MyDsn"(YCOS)')"
/* browse the dataset - Member YCOS */
zedsmsg = "Toll und mit PF1!"
zedlmsg = "Das ist aber beeindruckend"
"SETMSG MSG(ISRZ001)"
"BROWSE DATASET('"MyDsn"(YCOS)')"
/* display a member list of the dataset */
"LMINIT DATAID(DATAODV) DATASET('"MyDsn"')"
zedsmsg = ""
zedlmsg = "Member List der Datei" MyDsn
"SETMSG MSG(ISRZ001)"
"MEMLIST  DATAID("DATAODV")"
"LMFREE   DATAID("DATAODV")"
/* show dataset list */
hlq=left(MyDsn,pos(".",Mydsn)-1)
"LMDINIT LISTID(DATAODV) Level("hlq")"
zedsmsg = ""
zedlmsg = "Dataset List aller Dateien" hlq"*"
"SETMSG MSG(ISRZ001)"
"LMDDISP LISTID("DATAODV")"
"LMDFREE LISTID("DATAODV")"
/* Dataset Info */
Address  ISPEXEC "DSINFO DATASET('"MyDsn"')"
SAY "First or only volume           " ZDSVOL
SAY "Number of volumes              " ZDS#VOLS
SAY "Device type                    " ZDSDEVT
SAY "Data set organization          " ZDSORG
SAY "Record format                  " ZDSRF
SAY "Logical record length          " ZDSLREC
SAY "Block size                     " ZDSBLK
SAY "Primary space units            " ZDSSPC
SAY "Primary space allocation       " ZDS1EX
SAY "Secondary space units          " ZDS2SPC
SAY "Secondary space allocation     " ZDS2EX
SAY "Data set name type             " ZDSDSNT
SAY "Compressible YES/NO            " ZDSSEQ
SAY "Creation date                  " ZDSCDATE
SAY "Expiration date                " ZDSXDATE
SAY "Referenced date                " ZDSRDATE
SAY "Allocated space units          " ZDSTOTA
SAY "Used space units               " ZDSTOTU
SAY "Allocated extents              " ZDSEXTA
SAY "Used extents                   " ZDSEXTU
SAY "Allocated directory blocks     " ZDSDIRA
SAY "Used directory blocks          " ZDSDIRU
SAY "PDSE directory blocks          " ZDSDIR
SAY "Number of members              " ZDS#MEM
SAY "Pages used (PDSE)              " ZDSPAGU
SAY "Percent used (PDSE)            " ZDSPERU
SAY "Management class               " ZDSMC
SAY "Storage class                  " ZDSSC
SAY "Data class                     " ZDSDC
SAY "Format 1 data control block    " c2x(ZDSCB1)
SAY "Volume table (all volume names)" ZDSVTAB
SAY "APF Dataset                    " ZDSAPF
SAY "LNKLST Dataset                 " ZDSLNK
SAY "Dataset Type                   " ZDSDSNT
SAY "allocated space units (X)      " ZDSTOTAX
SAY "used space units (X)           " ZDSTOTUX
/* List all Datasets with MyDsn minus 1 Qualifier */
lq=left(MyDsn,lastpos(".",Mydsn)-1)
"LMDINIT  LISTID(DATAODV) LEVEL("lq")"
ydsn="        "
"LMDLIST LISTID(&DATAODV)",
        "OPTION(LIST) DATASET(YDSN) STATS(YES)"
do while RC=0
  SAY "Dataset-------------------------------------" ydsn
  SAY "Volume serial                               " ZDLVOL
  SAY "Device type                                 " ZDLDEV
  SAY "Data set organization                       " ZDLDSORG
  SAY "Record format                               " ZDLRECFM
  SAY "Logical record length                       " ZDLLRECL
  SAY "Block size                                  " ZDLBLKSZ
  SAY "Data set size in tracks                     " ZDLSIZE
  SAY "Data set size in tracks (X)                 " ZDLSIZEX
  SAY "Percentage of used tracks or pages (PDSE)   " ZDLUSED
  SAY "Number of extents used                      " ZDLEXT
  SAY "Number of extents used, long format (X)     " ZDLEXTX
  SAY "Creation date                               " ZDLCDATE
  SAY "Expiration date                             " ZDLEDATE
  SAY "Date last referenced                        " ZDLRDATE
  SAY "Whether the data set is migrated (YES or NO)" ZDLMIGR
  SAY "Dsname type (PDS, LIBRARY, or ' ')          " ZDLDSNTP
  SAY "Space units                                 " ZDLSPACU
  SAY "Whether the data set is multivolume (Y/N)   " ZDLMVOL
  SAY "Name of the catalog                         " ZDLCATNM
  "LMDLIST LISTID(&DATAODV)",
          "OPTION(LIST) DATASET(YDSN) STATS(YES)"
end
"LMDFREE  LISTID(DATAODV)"
/* List all Members in Dataset */
"LMINIT DATAID(DATAODV) DATASET('"Mydsn"')"
recfmvar="?"
"LMOPEN DATAID("DATAODV") OPTION(INPUT) RECFM(RECFMVAR)"
mymem=left(" ",8)
"LMMLIST DATAID("DATAODV") MEMBER(MYMEM) STATS(YES)"
do while rc=0
  if recfmvar="U" then do
    say strip(mymem)";",
    strip(zllib)";",
    strip(zlsize)";",
    strip(zlttr)";"
    strip(zlalias)";",
    strip(zlac)";",
    strip(zlamode)";",
    strip(zlrmode)";",
    strip(zlattr)
  end
  else do
    say strip(mymem)";",
    strip(zllib)";",
    strip(zlvers)";",
    strip(zlmod)";",
    strip(zlcdate)";",
    strip(zlc4date)";",
    strip(zlmdate)";",
    strip(zlm4date)";",
    strip(zlmtime)";",
    strip(zlmsec)";",
    strip(zlcnorc)";",
    strip(zlinorc)";",
    strip(zlmnorc)";",
    strip(zluser)";",
    strip(zsclm)
  end
  "LMMLIST DATAID("DATAODV") MEMBER(MYMEM) STATS(YES)"
end

"LMCLOSE  DATAID("DATAODV")"
"LMFREE   DATAID("DATAODV")"
/* Member mit eigenen Statitics belegen! */
"LMINIT DATAID(DATAODV) DATASET('"Mydsn"')"
"LMMSTATS" "DATAID(&DATAODV)",
           "MEMBER(YCOS)",
           "USER(YCOSREX)",
           "INITSIZE(123)",
           "CURSIZE(321)",
           "CREATED(01/01/01)",
           "MODDATE(99/12/31)",
           "MODTIME(23:59)"
"LMFREE   DATAID("DATAODV")"
/* display a member list of the dataset */
"LMINIT DATAID(DATAODV) DATASET('"MyDsn"')"
zedsmsg = ""
zedlmsg = "Member List der Datei" MyDsn "nur Members Y*"
"SETMSG MSG(ISRZ001)"
"MEMLIST  DATAID("DATAODV") MEMBER(Y*)"
"LMFREE   DATAID("DATAODV")"