/* REXX VCX Re-write of Jim Connelley's VC to take advantage of LISTCSUM Written by Frank Clarke 20020507 Impact Analysis . SYSPROC LISTCSUM . SYSPROC TRAPOUT Modification History 20020722 fxc NUMBERED on CLUSTER only; ignore NOWRITECHK, NOIMBED, NOREPLICAT, NOREUSE; 20020819 fxc rearranged parameters; drop obsolete tags 20030331 fxc no SUMMARY for a GDGBASE; a single generation of a GDG will show as NONVSAM with a 'GDG' tag in NONVSAMASSOCIATIONS; */ arg argline address TSO /* REXXSKEL ver.20020513 */ arg parms "((" opts signal on syntax signal on novalue call TOOLKIT_INIT /* conventional start-up -*/ rc = trace(tv) info = parms /* to enable parsing */ call A_INIT /* -*/ call B_PROCESS_CAT /* -*/ if \sw.nested then call DUMP_QUEUE /* -*/ if \sw.nested then do "NEWSTACK" ; pull ; "DELSTACK" end exit /*@ VCX */ /* . ----------------------------------------------------------------- */ A_INIT: /*@ */ if branch then call BRANCH address TSO parse value "0 0 0 0 0 0 0 0 0 0" with , ct. . parse value "" with , taglist tagdata. , . call AK_KEYWDS /* -*/ parse var info dsname info return /*@ A_INIT */ /* . ----------------------------------------------------------------- */ AK_KEYWDS: /*@ */ if branch then call BRANCH address TSO outdsn = KEYWD("OUTPUT") return /*@ AK_KEYWDS */ /* Obtain definition data via LISTC; parse it into its components; recreate the DEFINE which produced this picture. . ----------------------------------------------------------------- */ B_PROCESS_CAT: /*@ */ if branch then call BRANCH address TSO "NEWSTACK" call BA_RUN_LISTCSUM /* -*/ call BD_PULL_DATAPOINTS /* -*/ "DELSTACK" "NEWSTACK" if \sw.0error_found then, call BG_WRITE_DEFINE /* -*/ "DELSTACK" return /*@ B_PROCESS_CAT */ /* . ----------------------------------------------------------------- */ BA_RUN_LISTCSUM: /*@ */ if branch then call BRANCH address TSO "LISTCSUM" dsname "STACK" /* load keys to stack -*/ return /*@ BA_RUN_LISTCSUM */ /* . ----------------------------------------------------------------- */ BD_PULL_DATAPOINTS: /*@ */ if branch then call BRANCH address TSO do queued() /* each queued line */ parse pull keytag ":" tagdata taglist = taglist keytag /* add to list */ tagdata.keytag = tagdata /* load tagdata to keytag */ end /* queued */ info = tagdata.SUMMARY parse value KEYWD("ALIAS") 0 with ct.0alias . parse value KEYWD("CLUSTER") 0 with ct.0cluster . parse value KEYWD("DATA") 0 with ct.0data . parse value KEYWD("GDG") 0 with ct.0gdg . parse value KEYWD("INDEX") 0 with ct.0index . parse value KEYWD("NONVSAM") 0 with ct.0nonvsam . parse value KEYWD("TOTAL") 0 with ct.0total . ct.0subtot = ct.0alias + ct.0cluster + ct.0data + ct.0gdg + , ct.0index + ct.0nonvsam if ct.0total > ct.0subtot then do /* stuff we can't handle */ say exec_name "is not yet capable of handling something in", "this list:" say info /* what's left over? */ sw.0error_found = 1 return /* we're done */ end if ct.0alias > 0 then call BDA_ALIAS /* -*/ if ct.0cluster > 0 then call BDC_CLU /* -*/ if ct.0gdg > 0 then call BDG_GDG /* -*/ if ct.0nonvsam > 0 then call BDN_NV /* -*/ return /*@ BD_PULL_DATAPOINTS */ /* An ALIAS is also referenced in NONVSAMASSOCIATIONS . ----------------------------------------------------------------- */ BDA_ALIAS: /*@ */ if branch then call BRANCH address TSO info = tagdata.aliasassociations base = KEYWD("NONVSAM") alias = dsname return /*@ BDA_ALIAS */ /* CLUSTER. . ----------------------------------------------------------------- */ BDC_CLU: /*@ */ if branch then call BRANCH address TSO clusterdsn = dsname info = tagdata.clusterassociations datadsn = KEYWD("DATA") indexdsn = KEYWD("INDEX") info = tagdata.clustersmsdata stgcls = KEYWD("STORAGECLASS") mgmtcls = KEYWD("MANAGEMENTCLASS") datacls = KEYWD("DATACLASS") if ct.0data > 0 then, call BDCD_DATA /* -*/ if ct.0index > 0 then, call BDCI_INDEX /* -*/ return /*@ BDC_CLU */ /* CLUSTER DATA . ----------------------------------------------------------------- */ BDCD_DATA: /*@ */ if branch then call BRANCH address TSO info = tagdata.dataattributes keylen = KEYWD("KEYLEN") avgrecl = KEYWD("AVGLRECL") bufspc = KEYWD("BUFSPACE") cisize = KEYWD("CISIZE") rkp = KEYWD("RKP") maxrecl = KEYWD("MAXLRECL") excpext = KEYWD("EXCPEXIT") recsper = KEYWD("RECORDS/CI") maxrecs = KEYWD("MAXRECS") cicapct = KEYWD("CI/CA") shropts = CLKWD("SHROPTNS") /* CLIST-form */ dataopts = info /* whatever is left */ info = tagdata.dataallocation spctyp = KEYWD("SPACE TYPE") spcpri = KEYWD("SPACE PRI") spcsec = KEYWD("SPACE SEC") info = tagdata.datastatistics dfspcci = KEYWD("FREESPACE %CI") dfspcca = KEYWD("FREESPACE %CA") info = tagdata.dataassociations clusterdsn = KEYWD("CLUSTER") return /*@ BDCD_DATA */ /* CLUSTER INDEX . ----------------------------------------------------------------- */ BDCI_INDEX: /*@ */ if branch then call BRANCH address TSO info = tagdata.indexattributes idxklen = KEYWD("KEYLEN") idxavgl = KEYWD("AVGLRECL") idxbuf = KEYWD("BUFSPACE") idxci = KEYWD("CISIZE") idxrkp = KEYWD("RKP") idxmaxl = KEYWD("MAXLRECL") idxecpx = KEYWD("EXCPEXIT") idxcica = KEYWD("CI/CA") idxshro = CLKWD("SHROPTNS") /* CLIST-form */ idxopts = info /* whatever is left */ info = tagdata.indexallocation idxspc = KEYWD("SPACE TYPE") idxpri = KEYWD("SPACE PRI") idxsec = KEYWD("SPACE SEC") info = tagdata.indexstatistics xfspcci = KEYWD("FREESPACE %CI") xfspcca = KEYWD("FREESPACE %CA") info = tagdata.indexassociations clusterdsn = KEYWD("CLUSTER") return /*@ BDCI_INDEX */ /* . Missing: OWNER, TO, FROM . ----------------------------------------------------------------- */ BDG_GDG: /*@ */ if branch then call BRANCH address TSO info = tagdata.gdgbaseattributes gdglim = KEYWD("LIMIT") gdgopts = info /* whatever is left */ ct.0nonvsam = 0 /* don't process NONVSAM */ return /*@ BDG_GDG */ /* . ----------------------------------------------------------------- */ BDN_NV: /*@ */ if branch then call BRANCH address TSO info = tagdata.nonvsamsmsdata stgcls = KEYWD("STORAGECLASS") mgmtcls = KEYWD("MANAGEMENTCLASS") datacls = KEYWD("DATACLASS") info = tagdata.associations nvalias = KEYWD("ALIAS") return /*@ BDN_NV */ /* . ----------------------------------------------------------------- */ BG_WRITE_DEFINE: /*@ */ if branch then call BRANCH address TSO if ct.0alias > 0 then, call BGA_DEFALIAS /* -*/ if ct.0cluster > 0 then, call BGC_DEFCL /* -*/ if ct.0gdg > 0 then, call BGG_DEFGDG /* -*/ if ct.0nonvsam > 0 then, call BGG_DEFNVSAM /* -*/ alloc.0 = "NEW CATALOG UNIT(SYSDA) SPACE(1) TRACKS", "RECFM(V B) LRECL(32760) BLKSIZE(0)" vio.0 = "NEW CATALOG UNIT(VIO) SPACE(1) TRACKS", "RECFM(V B) LRECL(32760) BLKSIZE(0)" alloc.1 = "SHR" /* if it already exists... */ if outdsn <> "" then do /* write to DASD */ tempstat = Sysdsn(outdsn) = "OK",/* 1=exists, 0=missing */ | Sysdsn(outdsn) = "MEMBER NOT FOUND" "ALLOC FI($TMP) DA("outdsn") REU" alloc.tempstat "EXECIO" queued() "DISKW $TMP (FINIS" sw.0BrowseTMP = 1 /* */ end /* outdsn */ else , /* no OUTDSN */ if sw.inispf then do /* ISPF available */ "ALLOC FI($TMP) REU" vio.0 "EXECIO" queued() "DISKW $TMP (FINIS" sw.0BrowseTMP = 1 /* */ end /* inispf */ else do /* write to terminal */ "CLEAR" /* */ do queued() pull line; say line /* */ end /* queued */ end /* terminal */ if sw.0BrowseTMP then do /* display text */ call BGZ_BROWSE_TMP /* -*/ "FREE FI($TMP)" end /* BrowseTMP */ return /*@ BG_WRITE_DEFINE */ /* . ----------------------------------------------------------------- */ BGA_DEFALIAS: /*@ */ if branch then call BRANCH address TSO queue " DEFINE ALIAS -" queue " ( NAME("alias") -" queue " RELATE("base") )" return /*@ BGA_DEFALIAS */ /* . ----------------------------------------------------------------- */ BGC_DEFCL: /*@ */ if branch then call BRANCH address TSO info = dataopts /* ready for parsing */ sw.numbered = SWITCH("NUMBERED") /* RRDS ? */ sw.indexed = SWITCH("INDEXED") /* KSDS ? */ sw.nonindx = SWITCH("NONINDEXED") /* ESDS ? */ sw.linear = SWITCH("LINEAR") /* Linear DS ? */ sw.reuse = SWITCH("REUSE") sw.noreuse = SWITCH("NOREUSE") if sw.reuse = sw.noreuse then, parse value "0 1" with sw.reuse sw.noreuse . sw.unique = SWITCH("UNIQUE") if sw.reuse then sw.unique = 0 $z = SWITCH("NOWRITECHK") /* unused */ $z = SWITCH("NOIMBED") /* unused */ $z = SWITCH("NOREPLICAT") /* unused */ dataopts = info /* restore corrected */ queue " DEFINE CLUSTER -" queue " ( NAME("clusterdsn") -" if stgcls <> "(NULL)" then, queue " STORAGECLASS("stgcls") -" if mgmtcls <> "(NULL)" then, queue " MANAGEMENTCLASS("mgmtcls") -" if datacls <> "(NULL)" then, queue " DATACLASS("datacls") -" attribs = "" if sw.numbered then, attribs = attribs "NUMBERED" if sw.indexed then, attribs = attribs "INDEXED" if sw.nonindx then, attribs = attribs "NONINDEXED" if sw.linear then, attribs = attribs "LINEAR" if attribs <> "" then , queue " "Space(attribs,1)" -" if ct.0data > 0 then do queue " ) -" queue " DATA -" queue " ( NAME("datadsn") -" queue " "spctyp"("spcpri "," spcsec") -" queue " RECORDSIZE("avgrecl "," maxrecl") -" queue " FREESPACE("dfspcci "," dfspcca") -" if sw.reuse then dataopts = dataopts "REUSE" else dataopts = dataopts "NOREUSE" dataopts = Space(dataopts,1) do while dataopts <> "" pt = LastPos(" ",dataopts" ",40) slug = Substr(dataopts,1,pt) dataopts = Delstr(dataopts,1,pt) queue " "slug" -" end /* dataopts */ queue " BUFFERSPACE("bufspc") -" queue " CONTROLINTERVALSIZE("cisize") -" queue " SHAREOPTIONS("shropts") -" if keylen > 0 then, queue " KEYS("keylen "," rkp") -" end /* DATA */ if ct.0index > 0 then do queue " ) -" queue " INDEX -" queue " ( NAME("indexdsn") -" queue " "idxspc"("idxpri "," idxsec") -" info = idxopts /* ready for parsing */ $z = SWITCH("SPEED") /* purge from string */ $z = SWITCH("RECOVERY") $z = SWITCH("ERASE") $z = SWITCH("NOERASE") $z = SWITCH("UNIQUE") $z = SWITCH("WRITECHK") $z = SWITCH("NOWRITECHK") $z = SWITCH("NOREPLICAT") $z = SWITCH("REPLICAT") $z = SWITCH("REPLICATE") idxopts = Space(info,1) /* ready to load */ idxopts = Space(idxopts,1) do while idxopts <> "" pt = LastPos(" ",idxopts" ",40) slug = Substr(idxopts,1,pt) idxopts = Delstr(idxopts,1,pt) queue " "slug" -" end /* idxopts */ queue " CONTROLINTERVALSIZE("idxci") -" queue " SHAREOPTIONS("idxshro") -" end /* INDEX */ queue " )" return /*@ BGC_DEFCL */ /* . ----------------------------------------------------------------- */ BGG_DEFGDG: /*@ */ if branch then call BRANCH address TSO queue " DEFINE GENERATIONDATAGROUP -" queue " ( NAME("dsname") -" queue " LIMIT("gdglim") -" queue " " gdgopts ")" return /*@ BGG_DEFGDG */ /* . ----------------------------------------------------------------- */ BGG_DEFNVSAM: /*@ */ if branch then call BRANCH address TSO queue " DEFINE NONVSAM -" queue " ( NAME("dsname") )" return /*@ BGG_DEFNVSAM */ /* . ----------------------------------------------------------------- */ BGZ_BROWSE_TMP: /*@ */ if branch then call BRANCH address ISPEXEC "LMINIT DATAID(DDNID) DDNAME($TMP)" "VIEW DATAID("ddnid")" return /*@ BGZ_BROWSE_TMP */ /* . ----------------------------------------------------------------- */ LOCAL_PREINIT: /*@ customize opts */ address TSO if SWITCH("NONEST") then sw.nested = 0 return /*@ LOCAL_PREINIT */ /* subroutines below LOCAL_PREINIT are not selected by SHOWFLOW */ /* . ----------------------------------------------------------------- */ HELP: /*@ */ address TSO;"CLEAR" if helpmsg <> "" then do ; say helpmsg; say ""; end ex_nam = Left(exec_name,8) /* predictable size */ say " "ex_nam" generates pro-forma IDCAMS DEFINE statements for the " say " specified entity such as would have been used to " say " create it originally. " say " " say " Syntax: "ex_nam" " say " " say " " say " dsname identifies the entity to be analyzed so that (a) " say " DEFINE statement(s) can be constructed. " say " " say " outdsn names the target to receive the generated IDCAMS " say " DEFINE statements. " say " " "NEWSTACK"; pull ; "CLEAR" ; "DELSTACK" say " Debugging tools provided include: " say " " say " BRANCH: show all paragraph entries. " say " " say " TRACE tv: will use value following TRACE to place the " say " execution in REXX TRACE Mode. " say " " say " " say " Debugging tools can be accessed in the following manner: " say " " say " TSO "ex_nam" parameters (( debug-options " say " " say " For example: " say " " say " TSO "ex_nam" (( MONITOR TRACE ?R " address ISPEXEC "CONTROL DISPLAY REFRESH" exit /*@ HELP */ /* REXXSKEL back-end removed for space */