From 3df292cebda4bc8bed11560224e01d240a449e9b Mon Sep 17 00:00:00 2001 From: Dave Harding <75508965+DaveHardingIndy@users.noreply.github.com> Date: Fri, 21 Feb 2025 10:18:28 -0500 Subject: [PATCH 1/6] Create dave delete this.txt just a practice run, delete this --- .../Table-Tool-Examples/dave delete this.txt | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/dave delete this.txt diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/dave delete this.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/dave delete this.txt new file mode 100644 index 0000000..85d3040 --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/dave delete this.txt @@ -0,0 +1,55 @@ +//VIT902E JOB (111400000), JOB00133 +// 'ENDEVOR JOB',MSGLEVEL=(1,1),CLASS=B,REGION=0M,MSGCLASS=A, +// NOTIFY=&SYSUID +//*------------------------------------------------------------------- +//* Convert Environment info into Rexx Stem array data +//* VIT902.JCL.CSV(CSVALENV) +//*------------------------------------------------------------------- +//* STEP 1 -- EXECUTE CSV UTILITY +//*------------------------------------------------------------------- +//STEP1 EXEC PGM=NDVRC1,REGION=4M, +// PARM='BC1PCSV0' +//STEPLIB DD DISP=SHR,DSN=CAIEDUC.NDVR.V181.CSIQAUTU SCMM@LIB +// DD DISP=SHR,DSN=CAIEDUC.NDVR.V181.CSIQAUTH SCMM@LIB +// DD DISP=SHR,DSN=CAIEDUC.NDVR.V181.CSIQLOAD SCMM@LIB +//CONLIB DD DISP=SHR,DSN=CAIEDUC.NDVR.V181.CSIQLOAD SCMM@LIB +//BSTIPT01 DD * +LIST ENVIRONMENT +'*' + TO DDNAME 'EXTRACTS' + OPTIONS RETURN ALL. +//EXTRACTS DD DSN=&&EXTRACTS, +// DCB=(RECFM=FB,LRECL=1800,BLKSIZE=9000,DSORG=PS), +// DISP=(NEW,PASS), +// SPACE=(CYL,(5,1),RLSE) +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//*-------------------------------------------------------------------- +//SHOWME EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD SYSOUT=* MESSAGES +//SYSUT1 DD DSN=&&EXTRACTS,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* OUTPUT FILE +//SYSIN DD DUMMY CONTROL STATEMENTS +//SYSUDUMP DD SYSOUT=* +//*-------------------------------------------------------------------- +//ENV#RPT EXEC PGM=IRXJCL,PARM='ENBPIU00 PARMLIST' +//TABLE DD DSN=&&EXTRACTS,DISP=(OLD,DELETE) +//PARMLIST DD * + NOTHING TBLOUT OPTIONS0 0 + MODEL TBLOUT OPTIONS A + LISTENVS TBLOUT NOTHING 1 +//SYSEXEC DD DISP=SHR,DSN=CAIEDUC.NDVR.V181.CSIQCLS0 +//MODEL DD * < Build Rexx commands that tell the story + Env_Title.&ENV_NAME = '&TITLE' +//LISTENVS DD * < Build Rexx commands that tell the story + ListEnvs = '&ListEnvs' +//NOTHING DD DUMMY CONTROL STATEMENTS +//OPTIONS0 DD * CONTROL STATEMENTS + ListEnvs = '' +//OPTIONS DD * CONTROL STATEMENTS + TITLE = Strip(Translate(TITLE,"'",'"')) + If WordPos(ENV_NAME,ListEnvs) = 0 then, + + ListEnvs = Strip(ListEnvs) ENV_NAME +//SYSTSPRT DD SYSOUT=* +//TBLOUT DD SYSOUT=* +//*-------------------------------------------------------------------- From 078af7772df434f9abdf7ddf851e02350f859183 Mon Sep 17 00:00:00 2001 From: Dave Harding <75508965+DaveHardingIndy@users.noreply.github.com> Date: Wed, 30 Apr 2025 15:02:24 -0400 Subject: [PATCH 2/6] TableTool common usage examples These utilities have been requested by various Endevor clients and support common requests for Endevor information --- ... emails element list to a distribution.txt | 130 +++ ... TableTool examples in IEBUPDTE format.TXT | 858 ++++++++++++++++++ ...ds and deletes unused processor groups.txt | 215 +++++ ...element counts for each inventory area.txt | 105 +++ ... TableTool shows processor group usage.txt | 157 ++++ ...2 bindcard based on YAML control table.txt | 110 +++ ...a DB2 bindcard based on inventory area.txt | 135 +++ .../Table-Tool-Examples/dave delete this.txt | 55 -- 8 files changed, 1710 insertions(+), 55 deletions(-) create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool emails element list to a distribution.txt create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool examples in IEBUPDTE format.TXT create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool finds and deletes unused processor groups.txt create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool showing element counts for each inventory area.txt create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool shows processor group usage.txt create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/TableTool builds a DB2 bindcard based on YAML control table.txt create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/TableTool builds a DB2 bindcard based on inventory area.txt delete mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/dave delete this.txt diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool emails element list to a distribution.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool emails element list to a distribution.txt new file mode 100644 index 0000000..2767f97 --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool emails element list to a distribution.txt @@ -0,0 +1,130 @@ +//IBMUSERB JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************ +//* * +//* This utility queries Endevor to produce a report showing * +//* all elements in QA stage 2. The report is then emailed * +//* to a distribution list. * +//* * +//************************************************************ +//********************************************************** +//* Delete work file * +//********************************************************** +//JSTEP05 EXEC PGM=IDCAMS +//SYSPRINT DD SYSOUT=* +//SYSIN DD * + DELETE IBMUSER.TEMP.ELEMENT.CSV + SET MAXCC=0 +//* +//********************************************************** +//* Build element list using CSV Utility * +//********************************************************** +//$$$$$$@1 EXEC PGM=NDVRC1,REGION=4M, +// PARM='BC1PCSV0' +//BSTIPT01 DD * +LIST ELEMENT * + FROM ENV * SYS * SUB * TYP * STAGE * + TO DDNAME 'TABLE' + OPTIONS RETURN ALL . +//TABLE DD DSN=&&EXTRACTS, +// DCB=(RECFM=FB,LRECL=1800,BLKSIZE=9000,DSORG=PS), +// DISP=(NEW,PASS), +// SPACE=(CYL,(5,1),RLSE) +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//********************************************************** +//* Show contents of CSV file * +//********************************************************** +//SHOWME1 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&EXTRACTS,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//********************************************************** +//* Table Tool - create element report * +//********************************************************** +//JSTEP15 EXEC PGM=IRXJCL,PARM='ENBPIU00 A',COND=(4,LT) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//TABLE DD DSN=&&EXTRACTS,DISP=(OLD,DELETE) +//HEADING DD * +Environ,S#,System,Subsys,Type,Element,Date,Time,Action,User +//MODEL DD * +&src1 +//OPTIONS DD * + IF $row# = 1 then X = BuildFromMODEL(HEADING) + IF ENV_NAME /= 'QA' THEN $SkipRow = 'Y' + IF STG_# /= '2' THEN $SkipRow = 'Y' + src1a = ENV_NAME || ',' || STG_# || ',' || SYS_NAME || ',' + src1b = SBS_NAME || ',' || TYPE_NAME || ',' || ELM_NAME || ',' + src1c = LAST_ACT_DATE || ',' || LAST_ACT_TIME || ',' + src1d = LAST_ACT || ',' || LAST_ACT_USRID + src1 = src1a || src1b || src1c || src1d +//TBLOUT DD DSN=IBMUSER.TEMP.ELEMENT.CSV,DISP=(,CATLG,DELETE), +// SPACE=(CYL,(5,5),RLSE),UNIT=SYSDA, +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS) +//SYSTSPRT DD SYSOUT=* +//SYSPRINT DD SYSOUT=* +//DISPLAYS DD SYSOUT=* +//SYSTSIN DD DUMMY +//* +//********************************************************** +//* Show contents of Table Tool output * +//********************************************************** +//SHOWME2 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=IBMUSER.TEMP.ELEMENT.CSV,DISP=SHR +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//********************************************************** +//* Build SMTP email with attachement * +//********************************************************** +//JSTEP20 EXEC PGM=IEBGENER +//SYSPRINT DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUT2 DD DSN=&&HEADER,DISP=(,PASS),SPACE=(TRK,1), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80,BLKSIZE=0) +//* RCPT TO: +//* TO:your.name@yoursite.com; peer.name@yoursite.com +//SYSUT1 DD DATA,DLM=ZZ +HELO node31 +MAIL FROM: +RCPT TO: +DATA +FROM: site.Mainframe@yoursite.com +TO:your.name@yoursite.com +SUBJECT: Element Report +MIME-VERSION: 1.0 +CONTENT-TYPE: MULTIPART/MIXED;BOUNDARY="MIME" +--MIME + +site Endevor QA/2 element report -- see attached + +--MIME +CONTENT-TYPE: TEXT/PLAIN;NAME=QA_Element_Rpt.csv +CONTENT-ENCODING: 7BIT +CONTENT-DISPOSITION: ATTACHMENT; + +ZZ +/* +//********************************************************** +//* Send element report via SMTP as an attachment * +//********************************************************** +//JSTEP25 EXEC PGM=IEBGENER +//SYSUT2 DD SYSOUT=(B,CSSMTP) +//SYSOUT DD SYSOUT=* +//SYSPRINT DD SYSOUT=* +//SYSUDUMP DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUT1 DD DSN=&&HEADER,DISP=(OLD,DELETE) +// DD DISP=SHR,DSN=IBMUSER.TEMP.ELEMENT.CSV +//* diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool examples in IEBUPDTE format.TXT b/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool examples in IEBUPDTE format.TXT new file mode 100644 index 0000000..6b2a90b --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool examples in IEBUPDTE format.TXT @@ -0,0 +1,858 @@ +./ ADD NAME=CSV1 +//IBMUSERA JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************ +//* * +//* This utility queries Endevor to produce a report showing * +//* element counts for each Environment, Stage, System, * +//* Subsystem, and Type. * +//* * +//************************************************************ +//********************************************************** +//* Build element list using CSV Utility * +//********************************************************** +//$$$$$$@1 EXEC PGM=NDVRC1,REGION=4M,PARM='BC1PCSV0' +//BSTIPT01 DD * +LIST ELEMENT * + FROM ENV * SYS * SUB * TYPE * STAGE * + TO DDNAME 'TABLE' + OPTIONS RETURN ALL . +//TABLE DD DSN=&&EXTRACTM, +// DCB=(RECFM=FB,LRECL=1800,BLKSIZE=9000,DSORG=PS), +// DISP=(MOD,PASS), +// SPACE=(CYL,(5,5),RLSE) +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//********************************************************** +//* Show contents of CSV file (for debugging) * +//********************************************************** +//SHOWME1 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&EXTRACTM,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//********************************************************** +//* Using Endevor's TableTool utility, read the element * +//* data and build a formatted list. * +//* ==> TableTool utility; IPRFX.IQUAL.CSIQCLS0(ENBPIU00) * +//********************************************************** +//STEP20 EXEC PGM=IRXJCL,PARM='ENBPIU00 A',COND=(4,LT) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//TABLE DD DSN=&&EXTRACTM,DISP=(OLD,PASS) +//MODEL DD * +&oneline +//OPTIONS DD * + $Table_Type = "CSV" + IF RCD_TYPE = 'RCD TYPE' THEN $SkipRow = 'Y' + IF TYPE_NAME /= 'COBOL' THEN $SkipRow = 'Y' + p1 = substr(ENV_NAME,1,8) + p2 = substr(STG_ID,1,1) + p3 = substr(SYS_NAME,1,8) + p4 = substr(SBS_NAME,1,8) + p5 = substr(TYPE_NAME,1,8) + oneline = p1 p2 p3 p4 p5 '0000001' +//TBLOUT DD DSN=&&ELEMENTS,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS) +//SYSTSPRT DD SYSOUT=* +//SYSPRINT DD SYSOUT=* +//DISPLAYS DD SYSOUT=* +//SYSTSIN DD DUMMY +//* +//********************************************************** +//* Show contents * +//********************************************************** +//SHOWME2 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&ELEMENTS,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//********************************************************** +//* Using SORT, count the elements for each inventory area * +//********************************************************** +//STEP25 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&ELEMENTS,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&ELECOUNT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80,BLKSIZE=0) +//SYSIN DD * + SORT FIELDS=(1,38,CH,A) + SUM FIELDS=(39,7,ZD) + END +//* +//********************************************************** +//* Add header lines * +//********************************************************** +//STEP30 EXEC PGM=IEBGENER +//SYSUT1 DD * +Env S System Subsys Type Elements +-------- - -------- -------- -------- ------- +/* +// DD DSN=&&ELECOUNT,DISP=(OLD,DELETE) +//SYSUT2 DD SYSOUT=* +//SYSPRINT DD DUMMY +//SYSIN DD DUMMY +./ ADD NAME=CSV2 +//IBMUSERB JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************ +//* * +//* This utility queries Endevor to produce a report showing * +//* all elements in QA stage 2. The report is then emailed * +//* to a distribution list. * +//* * +//************************************************************ +//********************************************************** +//* Delete work file * +//********************************************************** +//JSTEP05 EXEC PGM=IDCAMS +//SYSPRINT DD SYSOUT=* +//SYSIN DD * + DELETE IBMUSER.TEMP.ELEMENT.CSV + SET MAXCC=0 +//* +//********************************************************** +//* Build element list using CSV Utility * +//********************************************************** +//$$$$$$@1 EXEC PGM=NDVRC1,REGION=4M, +// PARM='BC1PCSV0' +//BSTIPT01 DD * +LIST ELEMENT * + FROM ENV * SYS * SUB * TYP * STAGE * + TO DDNAME 'TABLE' + OPTIONS RETURN ALL . +//TABLE DD DSN=&&EXTRACTS, +// DCB=(RECFM=FB,LRECL=1800,BLKSIZE=9000,DSORG=PS), +// DISP=(NEW,PASS), +// SPACE=(CYL,(5,1),RLSE) +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//********************************************************** +//* Show contents of CSV file * +//********************************************************** +//SHOWME1 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&EXTRACTS,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//********************************************************** +//* Table Tool - create element report * +//********************************************************** +//JSTEP15 EXEC PGM=IRXJCL,PARM='ENBPIU00 A',COND=(4,LT) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//TABLE DD DSN=&&EXTRACTS,DISP=(OLD,DELETE) +//HEADING DD * +Environ,S#,System,Subsys,Type,Element,Date,Time,Action,User +//MODEL DD * +&src1 +//OPTIONS DD * + IF $row# = 1 then X = BuildFromMODEL(HEADING) + IF ENV_NAME /= 'QA' THEN $SkipRow = 'Y' + IF STG_# /= '2' THEN $SkipRow = 'Y' + src1a = ENV_NAME || ',' || STG_# || ',' || SYS_NAME || ',' + src1b = SBS_NAME || ',' || TYPE_NAME || ',' || ELM_NAME || ',' + src1c = LAST_ACT_DATE || ',' || LAST_ACT_TIME || ',' + src1d = LAST_ACT || ',' || LAST_ACT_USRID + src1 = src1a || src1b || src1c || src1d +//TBLOUT DD DSN=IBMUSER.TEMP.ELEMENT.CSV,DISP=(,CATLG,DELETE), +// SPACE=(CYL,(5,5),RLSE),UNIT=SYSDA, +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS) +//SYSTSPRT DD SYSOUT=* +//SYSPRINT DD SYSOUT=* +//DISPLAYS DD SYSOUT=* +//SYSTSIN DD DUMMY +//* +//********************************************************** +//* Show contents of Table Tool output * +//********************************************************** +//SHOWME2 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=IBMUSER.TEMP.ELEMENT.CSV,DISP=SHR +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//********************************************************** +//* Build SMTP email with attachement * +//********************************************************** +//JSTEP20 EXEC PGM=IEBGENER +//SYSPRINT DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUT2 DD DSN=&&HEADER,DISP=(,PASS),SPACE=(TRK,1), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80,BLKSIZE=0) +//* RCPT TO: +//* TO:your.name@yoursite.com; peer.name@yoursite.com +//SYSUT1 DD DATA,DLM=ZZ +HELO node31 +MAIL FROM: +RCPT TO: +DATA +FROM: site.Mainframe@yoursite.com +TO:your.name@yoursite.com +SUBJECT: Element Report +MIME-VERSION: 1.0 +CONTENT-TYPE: MULTIPART/MIXED;BOUNDARY="MIME" +--MIME + +site Endevor QA/2 element report -- see attached + +--MIME +CONTENT-TYPE: TEXT/PLAIN;NAME=QA_Element_Rpt.csv +CONTENT-ENCODING: 7BIT +CONTENT-DISPOSITION: ATTACHMENT; + +ZZ +/* +//********************************************************** +//* Send element report via SMTP as an attachment * +//********************************************************** +//JSTEP25 EXEC PGM=IEBGENER +//SYSUT2 DD SYSOUT=(B,CSSMTP) +//SYSOUT DD SYSOUT=* +//SYSPRINT DD SYSOUT=* +//SYSUDUMP DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUT1 DD DSN=&&HEADER,DISP=(OLD,DELETE) +// DD DISP=SHR,DSN=IBMUSER.TEMP.ELEMENT.CSV +//* +./ ADD NAME=CSV3 +//IBMUSERC JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************ +//* * +//* This utility reports processor group usage by comparing * +//* element inventory against processor groups. * +//* * +//************************************************************ +//* +//******************************************************* +//* P A R T O N E ELEMENT COUNT FOR EACH P.GROUP* +//******************************************************* +//*------------------------------------------------------------------- +//* CSV UTILITY FOR ELEMENTS +//*------------------------------------------------------------------- +//$$$$$$@1 EXEC PGM=NDVRC1,PARM='BC1PCSV0' +//BSTIPT01 DD * +LIST ELE * FROM ENV * STAGE * + TO DDNAME 'EXTRACTS' + OPTIONS RETURN ALL. +//EXTRACTS DD DSN=&&ELECSV, +// DCB=(RECFM=FB,LRECL=1800,BLKSIZE=9000,DSORG=PS), +// DISP=(,PASS),SPACE=(CYL,(25,25),RLSE),UNIT=SYSDA +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//*************************************************** +//* TABLE TOOL TO PULL OUT NECESSARY FIELDS * +//*************************************************** +//STEP2 EXEC PGM=IRXJCL,PARM='ENBPIU00 A' +//TABLE DD DSN=&&ELECSV,DISP=(OLD,DELETE) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//MODEL DD * +&oneline +//OPTIONS DD * + $TABLE_TYPE = "CSV" + if SITE_ID = 'SITE ID' THEN $SKIPROW = 'Y' + p1 = substr(ENV_NAME,1,8) + p2 = substr(STG_#,1,1) + p3 = substr(SYS_NAME,1,8) + p4 = substr(TYPE_NAME,1,8) + p5 = substr(PROC_GRP_NAME,1,8) + oneline = p1 p2 p3 p4 p5 '0000001' +//SYSTSPRT DD DUMMY +//TBLOUT DD DSN=&&ELEMENTS,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=120,BLKSIZE=0) +//* +//************************************************** +//* COUNT ELEMENTS FOR EACH INVENTORY AREA * +//************************************************** +//STEP3 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&ELEMENTS,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&ELECOUNT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=120,BLKSIZE=0) +//SYSIN DD * + SORT FIELDS=(1,38,CH,A) + SUM FIELDS=(39,7,ZD) + END +//* +//* +//* +//******************************************************* +//* P A R T T W O PROCESSOR GROUPS * +//******************************************************* +//*------------------------------------------------------------------- +//* EXECUTE CSV UTILITY - get processor groups +//*------------------------------------------------------------------- +//$$$$$$@1 EXEC PGM=NDVRC1,PARM='BC1PCSV0' +//BSTIPT01 DD * + LIST PROCESSOR GROUP * + FROM ENV * SYS * TYP * STAGE * + TO FILE CSVEXTR . +//CSVEXTR DD DSN=&&PGRPCSV,DISP=(,PASS), +// DCB=(RECFM=VB,LRECL=4092,BLKSIZE=4096,DSORG=PS), +// UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE) +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//*************************************************** +//* TABLE TOOL TO PULL OUT NECESSARY FIELDS * +//*************************************************** +//STEP5 EXEC PGM=IRXJCL,PARM='ENBPIU00 A' +//TABLE DD DSN=&&PGRPCSV,DISP=(OLD,DELETE) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//SYSTSPRT DD SYSOUT=* +//SYSPRINT DD SYSOUT=* +//SYSTSIN DD DUMMY +//MODEL DD * +&oneline +//OPTIONS DD * + $TABLE_TYPE = "CSV" + if SITE_ID = 'SITE ID' THEN $SKIPROW = 'Y' + p1 = substr(ENV_NAME,1,8) + p2 = substr(STG_#,1,1) + p3 = substr(SYS_NAME,1,8) + p4 = substr(TYPE_NAME,1,8) + p5 = substr(PROC_GRP_NAME,1,8) + p6 = substr(PROC_TYPE,1,1) + p7 = substr(PROC_NAME,1,8) + oneline = p1 p2 p3 p4 p5 p6 p7 +//TBLOUT DD DSN=&&PGRPOUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//* +//****************************************************** +//* ELIMINATE DUPS THE P.GROUP CSV OUTPUT * +//****************************************************** +//STEP6 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&PGRPOUT,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&SORTOUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD * + SORT FIELDS=(1,80,CH,A) + SUM FIELDS=NONE + END +/* +//******************************************** +//* put gen, del, mov processors on one line * +//******************************************** +//STEP7 EXEC PGM=IKJEFT1B,PARM='%REX1LINE' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//SYSTSPRT DD DUMMY +//SYSTSIN DD DUMMY +//FILEIN DD DSN=&&SORTOUT,DISP=(OLD,DELETE) +//FILEOUT DD DSN=&&PGRP2OUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD DUMMY +//* +//* +//* +//******************************************************* +//* P A R T T H R E E COMBINE P.GROUPS WITH E.COUNTS* +//******************************************************* +//********************************************** +//* Merge p.group data with element count data * +//********************************************** +//STEP8 EXEC PGM=IKJEFT1B,PARM='%REXMERGE' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//SYSTSPRT DD DUMMY +//SYSTSIN DD DUMMY +//FILEIN1 DD DSN=&&PGRP2OUT,DISP=(OLD,DELETE) +//FILEIN2 DD DSN=&&ELECOUNT,DISP=(OLD,DELETE) +//FILEOUT DD SYSOUT=* +//SYSIN DD DUMMY +//* +./ ADD NAME=CSV4 +//IBMUSERD JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************ +//* * +//* This utility reports processor group usage (same as CSV3)* +//* but then creates Batch Admin 'delete pro group' SCL for * +//* the unused processor groups. * +//* * +//************************************************************ +//* +//******************************************************* +//* P A R T O N E ELEMENT COUNT FOR EACH P.GROUP* +//******************************************************* +//*------------------------------------------------------------------- +//* CSV UTILITY FOR ELEMENTS +//*------------------------------------------------------------------- +//$$$$$$@1 EXEC PGM=NDVRC1,PARM='BC1PCSV0' +//BSTIPT01 DD * +LIST ELE * FROM ENV * STAGE * + TO DDNAME 'EXTRACTS' + OPTIONS RETURN ALL. +//EXTRACTS DD DSN=&&ELECSV, +// DCB=(RECFM=FB,LRECL=1800,BLKSIZE=9000,DSORG=PS), +// DISP=(,PASS),SPACE=(CYL,(25,25),RLSE),UNIT=SYSDA +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//*************************************************** +//* TABLE TOOL TO PULL OUT NECESSARY FIELDS * +//*************************************************** +//STEP2 EXEC PGM=IRXJCL,PARM='ENBPIU00 A' +//TABLE DD DSN=&&ELECSV,DISP=(OLD,DELETE) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//MODEL DD * +&oneline +//OPTIONS DD * + $TABLE_TYPE = "CSV" + if SITE_ID = 'SITE ID' THEN $SKIPROW = 'Y' + p1 = substr(ENV_NAME,1,8) + p2 = substr(STG_#,1,1) + p3 = substr(SYS_NAME,1,8) + p4 = substr(TYPE_NAME,1,8) + p5 = substr(PROC_GRP_NAME,1,8) + oneline = p1 p2 p3 p4 p5 '0000001' +//SYSTSPRT DD DUMMY +//TBLOUT DD DSN=&&ELEMENTS,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=120,BLKSIZE=0) +//* +//************************************************** +//* COUNT ELEMENTS FOR EACH INVENTORY AREA * +//************************************************** +//STEP3 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&ELEMENTS,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&ELECOUNT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=120,BLKSIZE=0) +//SYSIN DD * + SORT FIELDS=(1,38,CH,A) + SUM FIELDS=(39,7,ZD) + END +//* +//* +//* +//******************************************************* +//* P A R T T W O PROCESSOR GROUPS * +//******************************************************* +//*------------------------------------------------------------------- +//* EXECUTE CSV UTILITY - get processor groups +//*------------------------------------------------------------------- +//$$$$$$@1 EXEC PGM=NDVRC1,PARM='BC1PCSV0' +//BSTIPT01 DD * + LIST PROCESSOR GROUP * + FROM ENV * SYS * TYP * STAGE * + TO FILE CSVEXTR . +//CSVEXTR DD DSN=&&PGRPCSV,DISP=(,PASS), +// DCB=(RECFM=VB,LRECL=4092,BLKSIZE=4096,DSORG=PS), +// UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE) +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//*************************************************** +//* TABLE TOOL TO PULL OUT NECESSARY FIELDS * +//*************************************************** +//STEP5 EXEC PGM=IRXJCL,PARM='ENBPIU00 A' +//TABLE DD DSN=&&PGRPCSV,DISP=(OLD,DELETE) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//SYSTSPRT DD SYSOUT=* +//SYSTSIN DD DUMMY +//MODEL DD * +&oneline +//OPTIONS DD * + $TABLE_TYPE = "CSV" + if SITE_ID = 'SITE ID' THEN $SKIPROW = 'Y' + p1 = substr(ENV_NAME,1,8) + p2 = substr(STG_#,1,1) + p3 = substr(SYS_NAME,1,8) + p4 = substr(TYPE_NAME,1,8) + p5 = substr(PROC_GRP_NAME,1,8) + p6 = substr(PROC_TYPE,1,1) + p7 = substr(PROC_NAME,1,8) + oneline = p1 p2 p3 p4 p5 p6 p7 +//TBLOUT DD DSN=&&PGRPOUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//* +//****************************************************** +//* ELIMINATE DUPS THE P.GROUP CSV OUTPUT * +//****************************************************** +//STEP6 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&PGRPOUT,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&SORTOUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD * + SORT FIELDS=(1,80,CH,A) + SUM FIELDS=NONE + END +/* +//******************************************** +//* put gen, del, mov processors on one line * +//******************************************** +//STEP7 EXEC PGM=IKJEFT1B,PARM='%REX1LINE' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//SYSTSPRT DD DUMMY +//SYSTSIN DD DUMMY +//FILEIN DD DSN=&&SORTOUT,DISP=(OLD,DELETE) +//FILEOUT DD DSN=&&PGRP2OUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD DUMMY +//* +//* +//* +//******************************************************* +//* P A R T T H R E E COMBINE P.GROUPS WITH E.COUNTS* +//******************************************************* +//********************************************** +//* Merge p.group data with element count data * +//********************************************** +//STEP8 EXEC PGM=IKJEFT1B,PARM='%REXMERGE' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//SYSTSPRT DD DUMMY +//SYSTSIN DD DUMMY +//FILEIN1 DD DSN=&&PGRP2OUT,DISP=(OLD,DELETE) +//FILEIN2 DD DSN=&&ELECOUNT,DISP=(OLD,DELETE) +//FILEOUT DD DSN=&&REPORT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD DUMMY +//* +//********************************************************** +//* Show contents of CSV file (for debugging) * +//********************************************************** +//SHOWME1 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&REPORT,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//****************************************************** +//* PULL OUT UNUSED PROCESSOR GROUPS FOR DELETION * +//****************************************************** +//STEP9 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&REPORT,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&SORT2,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD * + SORT FIELDS=(1,80,CH,A) + INCLUDE COND=(72,7,CH,EQ,C' ') + OUTREC FIELDS=(1,38,42X) + END +/* +//*************************************************** +//* TABLE TOOL TO BUILD BATCH ADMIN DELETE SCL * +//* * +//* Input data (example): * +//* ....+....10...+....20...+....30...+....40...+ * +//* ADM 1 ADMMY ASM ASMAUTH * +//* ADM 1 ADMMY ASM AUTHPGM * +//* ADM 1 ADMMY C STANDARD * +//* ADM 1 ADMMY COBOL EXTPOSIX * +//* ADM 1 ADMMY COBOL PGMPOSIX * +//* * +//*************************************************** +//STEP10 EXEC PGM=IRXJCL,PARM='ENBPIU00 A' +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//SYSTSPRT DD DUMMY +//SYSTSIN DD DUMMY +//OPTIONS DD DUMMY +//TABLE DD DSN=&&SORT2,DISP=(OLD,DELETE) +//POSITION DD * + Env 1 9 + Stg# 10 11 + Sys 12 20 + Typ 21 29 + PGroup 30 38 +//MODEL DD * + DELETE PROCESSOR GROUP &PGroup + FROM ENV &Env SYS &Sys + TYP &Typ STAGE NUMBER &Stg# . +//TBLOUT DD SYSOUT=* +//* +./ ADD NAME=DB2 +//IBMUSERE JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************** +//* DB2 using OPTIONS elements: * +//* This utility pulls in type OPTIONS elements for DB2 binds.* +//* The Table Tool is used to gather the stage/subsys specific* +//* settings and build a bind card template. * +//* * +//************************************************************** +//*------------------------------------------------------------------- +//** get subsys OPTIONS element +//*------------------------------------------------------------------- +//GETSOPTS EXEC PGM=IEBUPDTE +//SYSPRINT DD DUMMY +//SYSIN DD * +./ REPRO NEW=PS,NAME=FIN02 +//SYSUT1 DD DISP=SHR,DSN=Your.Team.$OPTIONS +//SYSUT2 DD DSN=&&SYSOPTS,DISP=(,PASS), +// UNIT=SYSDA,SPACE=(TRK,(01,1)), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=16000) +//* +//*------------------------------------------------------------------- +//** get program OPTIONS element +//*------------------------------------------------------------------- +//GETPOPTS EXEC PGM=IEBUPDTE +//SYSPRINT DD DUMMY +//SYSIN DD * +./ REPRO NEW=PS,NAME=FINARP01 +//SYSUT1 DD DISP=SHR,DSN=Your.Team.$OPTIONS +//SYSUT2 DD DSN=&&PGMOPTS,DISP=(,PASS), +// UNIT=SYSDA,SPACE=(TRK,(01,1)), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=16000) +//* +//*------------------------------------------------------------------- +//** get program BINDCTL element +//*------------------------------------------------------------------- +//GETBCTL EXEC PGM=IEBUPDTE +//SYSPRINT DD DUMMY +//SYSIN DD * +./ REPRO NEW=PS,NAME=FINARP01 +//SYSUT1 DD DISP=SHR,DSN=Your.Team.$BINDCTL +//SYSUT2 DD DSN=&&BINDCTL,DISP=(,PASS), +// UNIT=SYSDA,SPACE=(TRK,(05,10),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=16000) +//* +//************************************************** +//* Pull out DB2 related options * +//************************************************** +//STEP3 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&SYSOPTS,DISP=(OLD,DELETE) +// DD DSN=&&PGMOPTS,DISP=(OLD,PASS) +//SORTOUT DD DSN=&&DB2OPTS,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80,BLKSIZE=0) +//SYSIN DD * + SORT FIELDS=COPY + INCLUDE COND=(3,5,CH,EQ,C'_DB2_',OR,4,5,CH,EQ,C'_DB2_',OR, + 5,5,CH,EQ,C'_DB2_',OR,6,5,CH,EQ,C'_DB2_',OR, + 7,5,CH,EQ,C'_DB2_',OR,8,5,CH,EQ,C'_DB2_',OR, + 9,5,CH,EQ,C'_DB2_',OR,10,5,CH,EQ,C'_DB2_',OR, + 11,5,CH,EQ,C'_DB2_',OR,12,5,CH,EQ,C'_DB2_') + END +//********************************************************** +//SHOWME1 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&DB2OPTS,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//*-------------------------------------------------------------------- +//* Build DB2 'Template' from OPTIONS +//*-------------------------------------------------------------------- +//DB2MASK1 EXEC PGM=IRXJCL,PARM='ENBPIU00 PARMLIST' +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//SYSTSPRT DD SYSOUT=* +//SHOWMASK DD SYSOUT=* +//PARMLIST DD * + MODEL TBLOUT OPTIONS1 A + MODEL SHOWMASK OPTIONS1 A +//TABLE DD * +* PrepareBinds + * +//OPTIONS1 DD DSN=&&DB2OPTS,DISP=(OLD,DELETE) +// DD * + DB2System = QA_DB2_System + DB2Package = QA_DB2_Package + DB2Qualifier = QA_DB2_Qualifier + DB2Explain = QA_DB2_Explain + DB2Owner = QA_DB2_Owner +//MODEL DD * + DSN = '&DB2System' + PACKAGE = '&DB2Package' + QUALIFIER = '&DB2Qualifier' + EXPLAIN = '&DB2Explain' + OWNER = '&DB2Owner' + MEMBER = '&C1ELEMENT' + MEMBER = 'FINARP01' +//TBLOUT DD DISP=(NEW,PASS),DSN=&&TEMPLATE, +// UNIT=SYSDA,SPACE=(TRK,(1,1)), +// RECFM=FB,LRECL=80,BLKSIZE=8000 +//* +//*-------------------------------------------------------------------- +//*-- Apply 'Template' to Bind Statement to build new Binds ---------- +//*-------------------------------------------------------------------- +//DB2MASK2 EXEC PGM=IKJEFT1B,PARM='DB2MASK$' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//MASKING DD DSN=&&TEMPLATE,DISP=(OLD,PASS) +//BINDSTMT DD DSN=&&BINDCTL,DISP=(OLD,PASS) +//SYSTSIN DD DUMMY +//SYSTSPRT DD SYSOUT=* +//SYSPRINT DD DUMMY +//*ELOPTNS DD DSN=&&PGMOPTS,DISP=(OLD,DELETE) +//BINDS DD DISP=(NEW,PASS),DSN=&&DB2BINDS, +// UNIT=SYSDA,SPACE=(TRK,(1,1)), +// RECFM=FB,LRECL=80,BLKSIZE=8000 +//* +//*-------------------------------------------------------------------- +//*--- Show the generated DB2Bind Statements, if not executing them --- +//*-------------------------------------------------------------------- +//SHOWBIND EXEC PGM=IEBGENER +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&DB2BINDS,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +./ ADD NAME=DB2YAML +//IBMUSERF JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************* +//* DB2 using YAML: * +//* This utility pulls in a YAML control card (built from a * +//* Changeman 100 report) to get the stage/system/subsys * +//* DB2 settings and build a bind card template. * +//* * +//************************************************************* +//*------------------------------------------------------------------- +//** get YAML OPTIONS element for system FINANCE +//*------------------------------------------------------------------- +//GETSOPTS EXEC PGM=IEBUPDTE +//SYSPRINT DD DUMMY +//SYSIN DD * +./ REPRO NEW=PS,NAME=FINANCE +//SYSUT1 DD DISP=SHR,DSN=Your.Team.$YAML +//SYSUT2 DD DSN=&&YAMLDB2,DISP=(,PASS), +// UNIT=SYSDA,SPACE=(TRK,(01,1)), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=16000) +//* +//*------------------------------------------------------------------- +//** get program BINDCTL element +//*------------------------------------------------------------------- +//GETBCTL EXEC PGM=IEBUPDTE +//SYSPRINT DD DUMMY +//SYSIN DD * +./ REPRO NEW=PS,NAME=FINARP01 +//SYSUT1 DD DISP=SHR,DSN=Your.Team.$BINDCTL +//SYSUT2 DD DSN=&&BINDCTL,DISP=(,PASS), +// UNIT=SYSDA,SPACE=(TRK,(05,10),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=16000) +//* +//**=================================================================** +//BILDMASK EXEC PGM=IRXJCL,PARM='ENBPIU00 PARMLIST' +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +// DD DISP=SHR,DSN=Your.Team.$REXX +//SYSTSPRT DD SYSOUT=* +//SHOWMASK DD SYSOUT=* +//PARMLIST DD * + NOTHING NOTHING OPTIONS 0 + MASKMODL MASKING OPTIONS1 A + MASKMODL SHOWMASK OPTIONS1 A +//TABLE DD * +* Do + * +//YAMLDB2 DD DSN=&&YAMLDB2,DISP=(OLD,DELETE) +//YAML2REX DD DUMMY <- Turn on/off Trace +//OPTIONS DD * <- Convert YAML to REXX +* Convert YAML to REXX ** + Call YAML2REX 'YAMLDB2' + HowManyYamls = QUEUED(); + If HowManyYamls < 1 then, + + Do; Say 'YAML2REX: Not finding any Rexx converted from YAML'; + + Exit(8); + + End; + Say 'HowManyYamls=' HowManyYamls + Do yaml# =1 to HowManyYamls; + + Parse pull yaml2rexx; + + Interpret yaml2rexx ; + + End +//OPTIONS1 DD * +* Now build Outputs from Rexx created from YAML + DB2System = Value('QA.FINANCE.FINQ4.DB2_Subsytem_ID') + DB2Package = Value('QA.FINANCE.FINQ4.Package_Target_Pattern') + DB2Qualifier = Value('QA.FINANCE.FINQ4.Bind_Qualifier_Target_Pat.') + DB2Explain = 'YES' + DB2Owner = Value('QA.FINANCE.FINQ4.Bind_Owner_Target_Pattern') +//****** MASKING ************************************************ +//MASKMODL DD * <-Build 'MASK' for DB2 + DSN = '&DB2System' + PACKAGE = '&DB2Package' + QUALIFIER = '&DB2Qualifier' + EXPLAIN = '&DB2Explain' + OWNER = '&DB2Owner' + MEMBER = '&C1ELEMENT' + MEMBER = 'FINARP01' +//MASKING DD DSN=&&TEMPLATE,DISP=(,PASS), <-Output Mask +// SPACE=(TRK,(1,1)),UNIT=SYSDA, +// LRECL=080,RECFM=FB,BLKSIZE=0 +//* +//*-------------------------------------------------------------------- +//*-- Apply 'Template' to Bind Statement to build new Binds ---------- +//*-------------------------------------------------------------------- +//DB2MASK2 EXEC PGM=IKJEFT1B,PARM='DB2MASK$' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//MASKING DD DSN=&&TEMPLATE,DISP=(OLD,PASS) +//BINDSTMT DD DSN=&&BINDCTL,DISP=(OLD,PASS) +//SYSTSIN DD DUMMY +//SYSTSPRT DD SYSOUT=* +//SYSPRINT DD DUMMY +//BINDS DD DISP=(NEW,PASS),DSN=&&DB2BINDS, +// UNIT=SYSDA,SPACE=(TRK,(1,1)), +// RECFM=FB,LRECL=80,BLKSIZE=8000 +//* +//*-------------------------------------------------------------------- +//*--- Show the generated DB2Bind Statements, if not executing them --- +//*-------------------------------------------------------------------- +//SHOWBIND EXEC PGM=IEBGENER +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&DB2BINDS,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool finds and deletes unused processor groups.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool finds and deletes unused processor groups.txt new file mode 100644 index 0000000..8bcbe0d --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool finds and deletes unused processor groups.txt @@ -0,0 +1,215 @@ +//IBMUSERD JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************ +//* * +//* This utility reports processor group usage (same as CSV3)* +//* but then creates Batch Admin 'delete pro group' SCL for * +//* the unused processor groups. * +//* * +//************************************************************ +//* +//******************************************************* +//* P A R T O N E ELEMENT COUNT FOR EACH P.GROUP* +//******************************************************* +//*------------------------------------------------------------------- +//* CSV UTILITY FOR ELEMENTS +//*------------------------------------------------------------------- +//$$$$$$@1 EXEC PGM=NDVRC1,PARM='BC1PCSV0' +//BSTIPT01 DD * +LIST ELE * FROM ENV * STAGE * + TO DDNAME 'EXTRACTS' + OPTIONS RETURN ALL. +//EXTRACTS DD DSN=&&ELECSV, +// DCB=(RECFM=FB,LRECL=1800,BLKSIZE=9000,DSORG=PS), +// DISP=(,PASS),SPACE=(CYL,(25,25),RLSE),UNIT=SYSDA +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//*************************************************** +//* TABLE TOOL TO PULL OUT NECESSARY FIELDS * +//*************************************************** +//STEP2 EXEC PGM=IRXJCL,PARM='ENBPIU00 A' +//TABLE DD DSN=&&ELECSV,DISP=(OLD,DELETE) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//MODEL DD * +&oneline +//OPTIONS DD * + $TABLE_TYPE = "CSV" + if SITE_ID = 'SITE ID' THEN $SKIPROW = 'Y' + p1 = substr(ENV_NAME,1,8) + p2 = substr(STG_#,1,1) + p3 = substr(SYS_NAME,1,8) + p4 = substr(TYPE_NAME,1,8) + p5 = substr(PROC_GRP_NAME,1,8) + oneline = p1 p2 p3 p4 p5 '0000001' +//SYSTSPRT DD DUMMY +//TBLOUT DD DSN=&&ELEMENTS,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=120,BLKSIZE=0) +//* +//************************************************** +//* COUNT ELEMENTS FOR EACH INVENTORY AREA * +//************************************************** +//STEP3 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&ELEMENTS,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&ELECOUNT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=120,BLKSIZE=0) +//SYSIN DD * + SORT FIELDS=(1,38,CH,A) + SUM FIELDS=(39,7,ZD) + END +//* +//* +//* +//******************************************************* +//* P A R T T W O PROCESSOR GROUPS * +//******************************************************* +//*------------------------------------------------------------------- +//* EXECUTE CSV UTILITY - get processor groups +//*------------------------------------------------------------------- +//$$$$$$@1 EXEC PGM=NDVRC1,PARM='BC1PCSV0' +//BSTIPT01 DD * + LIST PROCESSOR GROUP * + FROM ENV * SYS * TYP * STAGE * + TO FILE CSVEXTR . +//CSVEXTR DD DSN=&&PGRPCSV,DISP=(,PASS), +// DCB=(RECFM=VB,LRECL=4092,BLKSIZE=4096,DSORG=PS), +// UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE) +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//*************************************************** +//* TABLE TOOL TO PULL OUT NECESSARY FIELDS * +//*************************************************** +//STEP5 EXEC PGM=IRXJCL,PARM='ENBPIU00 A' +//TABLE DD DSN=&&PGRPCSV,DISP=(OLD,DELETE) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//SYSTSPRT DD SYSOUT=* +//SYSTSIN DD DUMMY +//MODEL DD * +&oneline +//OPTIONS DD * + $TABLE_TYPE = "CSV" + if SITE_ID = 'SITE ID' THEN $SKIPROW = 'Y' + p1 = substr(ENV_NAME,1,8) + p2 = substr(STG_#,1,1) + p3 = substr(SYS_NAME,1,8) + p4 = substr(TYPE_NAME,1,8) + p5 = substr(PROC_GRP_NAME,1,8) + p6 = substr(PROC_TYPE,1,1) + p7 = substr(PROC_NAME,1,8) + oneline = p1 p2 p3 p4 p5 p6 p7 +//TBLOUT DD DSN=&&PGRPOUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//* +//****************************************************** +//* ELIMINATE DUPS THE P.GROUP CSV OUTPUT * +//****************************************************** +//STEP6 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&PGRPOUT,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&SORTOUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD * + SORT FIELDS=(1,80,CH,A) + SUM FIELDS=NONE + END +/* +//******************************************** +//* put gen, del, mov processors on one line * +//******************************************** +//STEP7 EXEC PGM=IKJEFT1B,PARM='%REX1LINE' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//SYSTSPRT DD DUMMY +//SYSTSIN DD DUMMY +//FILEIN DD DSN=&&SORTOUT,DISP=(OLD,DELETE) +//FILEOUT DD DSN=&&PGRP2OUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD DUMMY +//* +//* +//* +//******************************************************* +//* P A R T T H R E E COMBINE P.GROUPS WITH E.COUNTS* +//******************************************************* +//********************************************** +//* Merge p.group data with element count data * +//********************************************** +//STEP8 EXEC PGM=IKJEFT1B,PARM='%REXMERGE' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//SYSTSPRT DD DUMMY +//SYSTSIN DD DUMMY +//FILEIN1 DD DSN=&&PGRP2OUT,DISP=(OLD,DELETE) +//FILEIN2 DD DSN=&&ELECOUNT,DISP=(OLD,DELETE) +//FILEOUT DD DSN=&&REPORT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD DUMMY +//* +//********************************************************** +//* Show contents of CSV file (for debugging) * +//********************************************************** +//SHOWME1 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&REPORT,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//****************************************************** +//* PULL OUT UNUSED PROCESSOR GROUPS FOR DELETION * +//****************************************************** +//STEP9 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&REPORT,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&SORT2,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD * + SORT FIELDS=(1,80,CH,A) + INCLUDE COND=(72,7,CH,EQ,C' ') + OUTREC FIELDS=(1,38,42X) + END +/* +//*************************************************** +//* TABLE TOOL TO BUILD BATCH ADMIN DELETE SCL * +//* * +//* Input data (example): * +//* ....+....10...+....20...+....30...+....40...+ * +//* ADM 1 ADMMY ASM ASMAUTH * +//* ADM 1 ADMMY ASM AUTHPGM * +//* ADM 1 ADMMY C STANDARD * +//* ADM 1 ADMMY COBOL EXTPOSIX * +//* ADM 1 ADMMY COBOL PGMPOSIX * +//* * +//*************************************************** +//STEP10 EXEC PGM=IRXJCL,PARM='ENBPIU00 A' +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//SYSTSPRT DD DUMMY +//SYSTSIN DD DUMMY +//OPTIONS DD DUMMY +//TABLE DD DSN=&&SORT2,DISP=(OLD,DELETE) +//POSITION DD * + Env 1 9 + Stg# 10 11 + Sys 12 20 + Typ 21 29 + PGroup 30 38 +//MODEL DD * + DELETE PROCESSOR GROUP &PGroup + FROM ENV &Env SYS &Sys + TYP &Typ STAGE NUMBER &Stg# . +//TBLOUT DD SYSOUT=* +//* diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool showing element counts for each inventory area.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool showing element counts for each inventory area.txt new file mode 100644 index 0000000..ae7fbe1 --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool showing element counts for each inventory area.txt @@ -0,0 +1,105 @@ +//IBMUSERA JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************ +//* * +//* This utility queries Endevor to produce a report showing * +//* element counts for each Environment, Stage, System, * +//* Subsystem, and Type. * +//* * +//************************************************************ +//********************************************************** +//* Build element list using CSV Utility * +//********************************************************** +//$$$$$$@1 EXEC PGM=NDVRC1,REGION=4M,PARM='BC1PCSV0' +//BSTIPT01 DD * +LIST ELEMENT * + FROM ENV * SYS * SUB * TYPE * STAGE * + TO DDNAME 'TABLE' + OPTIONS RETURN ALL . +//TABLE DD DSN=&&EXTRACTM, +// DCB=(RECFM=FB,LRECL=1800,BLKSIZE=9000,DSORG=PS), +// DISP=(MOD,PASS), +// SPACE=(CYL,(5,5),RLSE) +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//********************************************************** +//* Show contents of CSV file (for debugging) * +//********************************************************** +//SHOWME1 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&EXTRACTM,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//********************************************************** +//* Using Endevor's TableTool utility, read the element * +//* data and build a formatted list. * +//* ==> TableTool utility; IPRFX.IQUAL.CSIQCLS0(ENBPIU00) * +//********************************************************** +//STEP20 EXEC PGM=IRXJCL,PARM='ENBPIU00 A',COND=(4,LT) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//TABLE DD DSN=&&EXTRACTM,DISP=(OLD,PASS) +//MODEL DD * +&oneline +//OPTIONS DD * + $Table_Type = "CSV" + IF RCD_TYPE = 'RCD TYPE' THEN $SkipRow = 'Y' + IF TYPE_NAME /= 'COBOL' THEN $SkipRow = 'Y' + p1 = substr(ENV_NAME,1,8) + p2 = substr(STG_ID,1,1) + p3 = substr(SYS_NAME,1,8) + p4 = substr(SBS_NAME,1,8) + p5 = substr(TYPE_NAME,1,8) + oneline = p1 p2 p3 p4 p5 '0000001' +//TBLOUT DD DSN=&&ELEMENTS,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS) +//SYSTSPRT DD SYSOUT=* +//SYSPRINT DD SYSOUT=* +//DISPLAYS DD SYSOUT=* +//SYSTSIN DD DUMMY +//* +//********************************************************** +//* Show contents * +//********************************************************** +//SHOWME2 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&ELEMENTS,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//********************************************************** +//* Using SORT, count the elements for each inventory area * +//********************************************************** +//STEP25 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&ELEMENTS,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&ELECOUNT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80,BLKSIZE=0) +//SYSIN DD * + SORT FIELDS=(1,38,CH,A) + SUM FIELDS=(39,7,ZD) + END +//* +//********************************************************** +//* Add header lines * +//********************************************************** +//STEP30 EXEC PGM=IEBGENER +//SYSUT1 DD * +Env S System Subsys Type Elements +-------- - -------- -------- -------- ------- +/* +// DD DSN=&&ELECOUNT,DISP=(OLD,DELETE) +//SYSUT2 DD SYSOUT=* +//SYSPRINT DD DUMMY +//SYSIN DD DUMMY diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool shows processor group usage.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool shows processor group usage.txt new file mode 100644 index 0000000..2c2cd2c --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/CSV and TableTool shows processor group usage.txt @@ -0,0 +1,157 @@ +//IBMUSERC JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************ +//* * +//* This utility reports processor group usage by comparing * +//* element inventory against processor groups. * +//* * +//************************************************************ +//* +//******************************************************* +//* P A R T O N E ELEMENT COUNT FOR EACH P.GROUP* +//******************************************************* +//*------------------------------------------------------------------- +//* CSV UTILITY FOR ELEMENTS +//*------------------------------------------------------------------- +//$$$$$$@1 EXEC PGM=NDVRC1,PARM='BC1PCSV0' +//BSTIPT01 DD * +LIST ELE * FROM ENV * STAGE * + TO DDNAME 'EXTRACTS' + OPTIONS RETURN ALL. +//EXTRACTS DD DSN=&&ELECSV, +// DCB=(RECFM=FB,LRECL=1800,BLKSIZE=9000,DSORG=PS), +// DISP=(,PASS),SPACE=(CYL,(25,25),RLSE),UNIT=SYSDA +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//*************************************************** +//* TABLE TOOL TO PULL OUT NECESSARY FIELDS * +//*************************************************** +//STEP2 EXEC PGM=IRXJCL,PARM='ENBPIU00 A' +//TABLE DD DSN=&&ELECSV,DISP=(OLD,DELETE) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//MODEL DD * +&oneline +//OPTIONS DD * + $TABLE_TYPE = "CSV" + if SITE_ID = 'SITE ID' THEN $SKIPROW = 'Y' + p1 = substr(ENV_NAME,1,8) + p2 = substr(STG_#,1,1) + p3 = substr(SYS_NAME,1,8) + p4 = substr(TYPE_NAME,1,8) + p5 = substr(PROC_GRP_NAME,1,8) + oneline = p1 p2 p3 p4 p5 '0000001' +//SYSTSPRT DD DUMMY +//TBLOUT DD DSN=&&ELEMENTS,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=120,BLKSIZE=0) +//* +//************************************************** +//* COUNT ELEMENTS FOR EACH INVENTORY AREA * +//************************************************** +//STEP3 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&ELEMENTS,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&ELECOUNT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=120,BLKSIZE=0) +//SYSIN DD * + SORT FIELDS=(1,38,CH,A) + SUM FIELDS=(39,7,ZD) + END +//* +//* +//* +//******************************************************* +//* P A R T T W O PROCESSOR GROUPS * +//******************************************************* +//*------------------------------------------------------------------- +//* EXECUTE CSV UTILITY - get processor groups +//*------------------------------------------------------------------- +//$$$$$$@1 EXEC PGM=NDVRC1,PARM='BC1PCSV0' +//BSTIPT01 DD * + LIST PROCESSOR GROUP * + FROM ENV * SYS * TYP * STAGE * + TO FILE CSVEXTR . +//CSVEXTR DD DSN=&&PGRPCSV,DISP=(,PASS), +// DCB=(RECFM=VB,LRECL=4092,BLKSIZE=4096,DSORG=PS), +// UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE) +//C1MSGS1 DD SYSOUT=* +//BSTERR DD SYSOUT=* +//* +//*************************************************** +//* TABLE TOOL TO PULL OUT NECESSARY FIELDS * +//*************************************************** +//STEP5 EXEC PGM=IRXJCL,PARM='ENBPIU00 A' +//TABLE DD DSN=&&PGRPCSV,DISP=(OLD,DELETE) +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//SYSTSPRT DD SYSOUT=* +//SYSPRINT DD SYSOUT=* +//SYSTSIN DD DUMMY +//MODEL DD * +&oneline +//OPTIONS DD * + $TABLE_TYPE = "CSV" + if SITE_ID = 'SITE ID' THEN $SKIPROW = 'Y' + p1 = substr(ENV_NAME,1,8) + p2 = substr(STG_#,1,1) + p3 = substr(SYS_NAME,1,8) + p4 = substr(TYPE_NAME,1,8) + p5 = substr(PROC_GRP_NAME,1,8) + p6 = substr(PROC_TYPE,1,1) + p7 = substr(PROC_NAME,1,8) + oneline = p1 p2 p3 p4 p5 p6 p7 +//TBLOUT DD DSN=&&PGRPOUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//* +//****************************************************** +//* ELIMINATE DUPS THE P.GROUP CSV OUTPUT * +//****************************************************** +//STEP6 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&PGRPOUT,DISP=(OLD,DELETE) +//SORTOUT DD DSN=&&SORTOUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD * + SORT FIELDS=(1,80,CH,A) + SUM FIELDS=NONE + END +/* +//******************************************** +//* put gen, del, mov processors on one line * +//******************************************** +//STEP7 EXEC PGM=IKJEFT1B,PARM='%REX1LINE' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//SYSTSPRT DD DUMMY +//SYSTSIN DD DUMMY +//FILEIN DD DSN=&&SORTOUT,DISP=(OLD,DELETE) +//FILEOUT DD DSN=&&PGRP2OUT,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),UNIT=SYSDA +//SYSIN DD DUMMY +//* +//* +//* +//******************************************************* +//* P A R T T H R E E COMBINE P.GROUPS WITH E.COUNTS* +//******************************************************* +//********************************************** +//* Merge p.group data with element count data * +//********************************************** +//STEP8 EXEC PGM=IKJEFT1B,PARM='%REXMERGE' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//SYSTSPRT DD DUMMY +//SYSTSIN DD DUMMY +//FILEIN1 DD DSN=&&PGRP2OUT,DISP=(OLD,DELETE) +//FILEIN2 DD DSN=&&ELECOUNT,DISP=(OLD,DELETE) +//FILEOUT DD SYSOUT=* +//SYSIN DD DUMMY +//* diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/TableTool builds a DB2 bindcard based on YAML control table.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/TableTool builds a DB2 bindcard based on YAML control table.txt new file mode 100644 index 0000000..3e7afc8 --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/TableTool builds a DB2 bindcard based on YAML control table.txt @@ -0,0 +1,110 @@ +//IBMUSERF JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************* +//* DB2 using YAML: * +//* This utility pulls in a YAML control card (built from a * +//* Changeman 100 report) to get the stage/system/subsys * +//* DB2 settings and build a bind card template. * +//* * +//************************************************************* +//*------------------------------------------------------------------- +//** get YAML OPTIONS element for system FINANCE +//*------------------------------------------------------------------- +//GETSOPTS EXEC PGM=IEBUPDTE +//SYSPRINT DD DUMMY +//SYSIN DD * +./ REPRO NEW=PS,NAME=FINANCE +//SYSUT1 DD DISP=SHR,DSN=Your.Team.$YAML +//SYSUT2 DD DSN=&&YAMLDB2,DISP=(,PASS), +// UNIT=SYSDA,SPACE=(TRK,(01,1)), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=16000) +//* +//*------------------------------------------------------------------- +//** get program BINDCTL element +//*------------------------------------------------------------------- +//GETBCTL EXEC PGM=IEBUPDTE +//SYSPRINT DD DUMMY +//SYSIN DD * +./ REPRO NEW=PS,NAME=FINARP01 +//SYSUT1 DD DISP=SHR,DSN=Your.Team.$BINDCTL +//SYSUT2 DD DSN=&&BINDCTL,DISP=(,PASS), +// UNIT=SYSDA,SPACE=(TRK,(05,10),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=16000) +//* +//**=================================================================** +//BILDMASK EXEC PGM=IRXJCL,PARM='ENBPIU00 PARMLIST' +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +// DD DISP=SHR,DSN=Your.Team.$REXX +//SYSTSPRT DD SYSOUT=* +//SHOWMASK DD SYSOUT=* +//PARMLIST DD * + NOTHING NOTHING OPTIONS 0 + MASKMODL MASKING OPTIONS1 A + MASKMODL SHOWMASK OPTIONS1 A +//TABLE DD * +* Do + * +//YAMLDB2 DD DSN=&&YAMLDB2,DISP=(OLD,DELETE) +//YAML2REX DD DUMMY <- Turn on/off Trace +//OPTIONS DD * <- Convert YAML to REXX +* Convert YAML to REXX ** + Call YAML2REX 'YAMLDB2' + HowManyYamls = QUEUED(); + If HowManyYamls < 1 then, + + Do; Say 'YAML2REX: Not finding any Rexx converted from YAML'; + + Exit(8); + + End; + Say 'HowManyYamls=' HowManyYamls + Do yaml# =1 to HowManyYamls; + + Parse pull yaml2rexx; + + Interpret yaml2rexx ; + + End +//OPTIONS1 DD * +* Now build Outputs from Rexx created from YAML + DB2System = Value('QA.FINANCE.FINQ4.DB2_Subsytem_ID') + DB2Package = Value('QA.FINANCE.FINQ4.Package_Target_Pattern') + DB2Qualifier = Value('QA.FINANCE.FINQ4.Bind_Qualifier_Target_Pat.') + DB2Explain = 'YES' + DB2Owner = Value('QA.FINANCE.FINQ4.Bind_Owner_Target_Pattern') +//****** MASKING ************************************************ +//MASKMODL DD * <-Build 'MASK' for DB2 + DSN = '&DB2System' + PACKAGE = '&DB2Package' + QUALIFIER = '&DB2Qualifier' + EXPLAIN = '&DB2Explain' + OWNER = '&DB2Owner' + MEMBER = '&C1ELEMENT' + MEMBER = 'FINARP01' +//MASKING DD DSN=&&TEMPLATE,DISP=(,PASS), <-Output Mask +// SPACE=(TRK,(1,1)),UNIT=SYSDA, +// LRECL=080,RECFM=FB,BLKSIZE=0 +//* +//*-------------------------------------------------------------------- +//*-- Apply 'Template' to Bind Statement to build new Binds ---------- +//*-------------------------------------------------------------------- +//DB2MASK2 EXEC PGM=IKJEFT1B,PARM='DB2MASK$' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//MASKING DD DSN=&&TEMPLATE,DISP=(OLD,PASS) +//BINDSTMT DD DSN=&&BINDCTL,DISP=(OLD,PASS) +//SYSTSIN DD DUMMY +//SYSTSPRT DD SYSOUT=* +//SYSPRINT DD DUMMY +//BINDS DD DISP=(NEW,PASS),DSN=&&DB2BINDS, +// UNIT=SYSDA,SPACE=(TRK,(1,1)), +// RECFM=FB,LRECL=80,BLKSIZE=8000 +//* +//*-------------------------------------------------------------------- +//*--- Show the generated DB2Bind Statements, if not executing them --- +//*-------------------------------------------------------------------- +//SHOWBIND EXEC PGM=IEBGENER +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&DB2BINDS,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/TableTool builds a DB2 bindcard based on inventory area.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/TableTool builds a DB2 bindcard based on inventory area.txt new file mode 100644 index 0000000..99ea48b --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/TableTool builds a DB2 bindcard based on inventory area.txt @@ -0,0 +1,135 @@ +//IBMUSERE JOB (0000),'Your Name', +// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID +//* +//JOBLIB DD DISP=SHR,DSN=Your.Endevor.CSIQAUTU +// DD DISP=SHR,DSN=Your.Endevor.CSIQAUTH +// DD DISP=SHR,DSN=Your.Endevor.CSIQLOAD +//* +//************************************************************** +//* DB2 using OPTIONS elements: * +//* This utility pulls in type OPTIONS elements for DB2 binds.* +//* The Table Tool is used to gather the stage/subsys specific* +//* settings and build a bind card template. * +//* * +//************************************************************** +//*------------------------------------------------------------------- +//** get subsys OPTIONS element +//*------------------------------------------------------------------- +//GETSOPTS EXEC PGM=IEBUPDTE +//SYSPRINT DD DUMMY +//SYSIN DD * +./ REPRO NEW=PS,NAME=FIN02 +//SYSUT1 DD DISP=SHR,DSN=Your.Team.$OPTIONS +//SYSUT2 DD DSN=&&SYSOPTS,DISP=(,PASS), +// UNIT=SYSDA,SPACE=(TRK,(01,1)), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=16000) +//* +//*------------------------------------------------------------------- +//** get program OPTIONS element +//*------------------------------------------------------------------- +//GETPOPTS EXEC PGM=IEBUPDTE +//SYSPRINT DD DUMMY +//SYSIN DD * +./ REPRO NEW=PS,NAME=FINARP01 +//SYSUT1 DD DISP=SHR,DSN=Your.Team.$OPTIONS +//SYSUT2 DD DSN=&&PGMOPTS,DISP=(,PASS), +// UNIT=SYSDA,SPACE=(TRK,(01,1)), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=16000) +//* +//*------------------------------------------------------------------- +//** get program BINDCTL element +//*------------------------------------------------------------------- +//GETBCTL EXEC PGM=IEBUPDTE +//SYSPRINT DD DUMMY +//SYSIN DD * +./ REPRO NEW=PS,NAME=FINARP01 +//SYSUT1 DD DISP=SHR,DSN=Your.Team.$BINDCTL +//SYSUT2 DD DSN=&&BINDCTL,DISP=(,PASS), +// UNIT=SYSDA,SPACE=(TRK,(05,10),RLSE), +// DCB=(RECFM=FB,LRECL=80,BLKSIZE=16000) +//* +//************************************************** +//* Pull out DB2 related options * +//************************************************** +//STEP3 EXEC PGM=SORT +//SYSOUT DD DUMMY +//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,20)) +//SORTIN DD DSN=&&SYSOPTS,DISP=(OLD,DELETE) +// DD DSN=&&PGMOPTS,DISP=(OLD,PASS) +//SORTOUT DD DSN=&&DB2OPTS,DISP=(,PASS),SPACE=(CYL,(15,15),RLSE), +// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80,BLKSIZE=0) +//SYSIN DD * + SORT FIELDS=COPY + INCLUDE COND=(3,5,CH,EQ,C'_DB2_',OR,4,5,CH,EQ,C'_DB2_',OR, + 5,5,CH,EQ,C'_DB2_',OR,6,5,CH,EQ,C'_DB2_',OR, + 7,5,CH,EQ,C'_DB2_',OR,8,5,CH,EQ,C'_DB2_',OR, + 9,5,CH,EQ,C'_DB2_',OR,10,5,CH,EQ,C'_DB2_',OR, + 11,5,CH,EQ,C'_DB2_',OR,12,5,CH,EQ,C'_DB2_') + END +//********************************************************** +//SHOWME1 EXEC PGM=IEBGENER,REGION=1024K +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&DB2OPTS,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* +//*-------------------------------------------------------------------- +//* Build DB2 'Template' from OPTIONS +//*-------------------------------------------------------------------- +//DB2MASK1 EXEC PGM=IRXJCL,PARM='ENBPIU00 PARMLIST' +//SYSEXEC DD DISP=SHR,DSN=Your.Endevor.CSIQCLS0 +//SYSTSPRT DD SYSOUT=* +//SHOWMASK DD SYSOUT=* +//PARMLIST DD * + MODEL TBLOUT OPTIONS1 A + MODEL SHOWMASK OPTIONS1 A +//TABLE DD * +* PrepareBinds + * +//OPTIONS1 DD DSN=&&DB2OPTS,DISP=(OLD,DELETE) +// DD * + DB2System = QA_DB2_System + DB2Package = QA_DB2_Package + DB2Qualifier = QA_DB2_Qualifier + DB2Explain = QA_DB2_Explain + DB2Owner = QA_DB2_Owner +//MODEL DD * + DSN = '&DB2System' + PACKAGE = '&DB2Package' + QUALIFIER = '&DB2Qualifier' + EXPLAIN = '&DB2Explain' + OWNER = '&DB2Owner' + MEMBER = '&C1ELEMENT' + MEMBER = 'FINARP01' +//TBLOUT DD DISP=(NEW,PASS),DSN=&&TEMPLATE, +// UNIT=SYSDA,SPACE=(TRK,(1,1)), +// RECFM=FB,LRECL=80,BLKSIZE=8000 +//* +//*-------------------------------------------------------------------- +//*-- Apply 'Template' to Bind Statement to build new Binds ---------- +//*-------------------------------------------------------------------- +//DB2MASK2 EXEC PGM=IKJEFT1B,PARM='DB2MASK$' +//SYSEXEC DD DISP=SHR,DSN=Your.Team.$REXX +//MASKING DD DSN=&&TEMPLATE,DISP=(OLD,PASS) +//BINDSTMT DD DSN=&&BINDCTL,DISP=(OLD,PASS) +//SYSTSIN DD DUMMY +//SYSTSPRT DD SYSOUT=* +//SYSPRINT DD DUMMY +//*ELOPTNS DD DSN=&&PGMOPTS,DISP=(OLD,DELETE) +//BINDS DD DISP=(NEW,PASS),DSN=&&DB2BINDS, +// UNIT=SYSDA,SPACE=(TRK,(1,1)), +// RECFM=FB,LRECL=80,BLKSIZE=8000 +//* +//*-------------------------------------------------------------------- +//*--- Show the generated DB2Bind Statements, if not executing them --- +//*-------------------------------------------------------------------- +//SHOWBIND EXEC PGM=IEBGENER +//SYSPRINT DD DUMMY +//SYSUT1 DD DSN=&&DB2BINDS,DISP=(OLD,PASS) +//SYSUT2 DD SYSOUT=* +//SYSIN DD DUMMY +//SYSUDUMP DD SYSOUT=* +//* diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/dave delete this.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/dave delete this.txt deleted file mode 100644 index 85d3040..0000000 --- a/endevor/Field-Developed-Programs/Table-Tool-Examples/dave delete this.txt +++ /dev/null @@ -1,55 +0,0 @@ -//VIT902E JOB (111400000), JOB00133 -// 'ENDEVOR JOB',MSGLEVEL=(1,1),CLASS=B,REGION=0M,MSGCLASS=A, -// NOTIFY=&SYSUID -//*------------------------------------------------------------------- -//* Convert Environment info into Rexx Stem array data -//* VIT902.JCL.CSV(CSVALENV) -//*------------------------------------------------------------------- -//* STEP 1 -- EXECUTE CSV UTILITY -//*------------------------------------------------------------------- -//STEP1 EXEC PGM=NDVRC1,REGION=4M, -// PARM='BC1PCSV0' -//STEPLIB DD DISP=SHR,DSN=CAIEDUC.NDVR.V181.CSIQAUTU SCMM@LIB -// DD DISP=SHR,DSN=CAIEDUC.NDVR.V181.CSIQAUTH SCMM@LIB -// DD DISP=SHR,DSN=CAIEDUC.NDVR.V181.CSIQLOAD SCMM@LIB -//CONLIB DD DISP=SHR,DSN=CAIEDUC.NDVR.V181.CSIQLOAD SCMM@LIB -//BSTIPT01 DD * -LIST ENVIRONMENT -'*' - TO DDNAME 'EXTRACTS' - OPTIONS RETURN ALL. -//EXTRACTS DD DSN=&&EXTRACTS, -// DCB=(RECFM=FB,LRECL=1800,BLKSIZE=9000,DSORG=PS), -// DISP=(NEW,PASS), -// SPACE=(CYL,(5,1),RLSE) -//C1MSGS1 DD SYSOUT=* -//BSTERR DD SYSOUT=* -//*-------------------------------------------------------------------- -//SHOWME EXEC PGM=IEBGENER,REGION=1024K -//SYSPRINT DD SYSOUT=* MESSAGES -//SYSUT1 DD DSN=&&EXTRACTS,DISP=(OLD,PASS) -//SYSUT2 DD SYSOUT=* OUTPUT FILE -//SYSIN DD DUMMY CONTROL STATEMENTS -//SYSUDUMP DD SYSOUT=* -//*-------------------------------------------------------------------- -//ENV#RPT EXEC PGM=IRXJCL,PARM='ENBPIU00 PARMLIST' -//TABLE DD DSN=&&EXTRACTS,DISP=(OLD,DELETE) -//PARMLIST DD * - NOTHING TBLOUT OPTIONS0 0 - MODEL TBLOUT OPTIONS A - LISTENVS TBLOUT NOTHING 1 -//SYSEXEC DD DISP=SHR,DSN=CAIEDUC.NDVR.V181.CSIQCLS0 -//MODEL DD * < Build Rexx commands that tell the story - Env_Title.&ENV_NAME = '&TITLE' -//LISTENVS DD * < Build Rexx commands that tell the story - ListEnvs = '&ListEnvs' -//NOTHING DD DUMMY CONTROL STATEMENTS -//OPTIONS0 DD * CONTROL STATEMENTS - ListEnvs = '' -//OPTIONS DD * CONTROL STATEMENTS - TITLE = Strip(Translate(TITLE,"'",'"')) - If WordPos(ENV_NAME,ListEnvs) = 0 then, + - ListEnvs = Strip(ListEnvs) ENV_NAME -//SYSTSPRT DD SYSOUT=* -//TBLOUT DD SYSOUT=* -//*-------------------------------------------------------------------- From 43ac52d250cf8a077321042812fa68eeb0e0b271 Mon Sep 17 00:00:00 2001 From: Dave Harding <75508965+DaveHardingIndy@users.noreply.github.com> Date: Thu, 1 May 2025 11:21:03 -0400 Subject: [PATCH 3/6] Round two changes Added the supporting rexx used by the utilities and updated the README --- .../DB2MASK$ rexx to build DB2 bindcards.txt | 154 ++++++ .../Table-Tool-Examples/README.md | 14 +- ...t processor group CSV data on one line.txt | 27 ++ ... element with CSV list processor group.txt | 30 ++ ...X rexx to reformat YAML syntax to REXX.txt | 442 ++++++++++++++++++ 5 files changed, 666 insertions(+), 1 deletion(-) create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/DB2MASK$ rexx to build DB2 bindcards.txt create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/REX1LINE rexx to put processor group CSV data on one line.txt create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/REXMERGE rexx to merge CSV list element with CSV list processor group.txt create mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/YAML2REX rexx to reformat YAML syntax to REXX.txt diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/DB2MASK$ rexx to build DB2 bindcards.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/DB2MASK$ rexx to build DB2 bindcards.txt new file mode 100644 index 0000000..7bc9618 --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/DB2MASK$ rexx to build DB2 bindcards.txt @@ -0,0 +1,154 @@ +/* REXX */ + + TRACE Off + WhatDDName = 'DB2MASK$' +/* If DB2MASK$ is allocated? If yes, then turn on Trace */ + isItThere = , + BPXWDYN("INFO FI(EDCHKDD) INRTDSN(DSNVAR) INRDSNT(myDSNT)") + If isItThere = 0 then Trace r + + MY_RC = 0 + + /* DB2 Masking routine for processors */ + + Mask. = '' + /* Capture Mask names ane values */ + /* Read Endevor's Masking rules in the MASKING data */ + "EXECIO * DISKR MASKING (STEM mask. FINIS " + + Do m# = 1 to mask.0 + msk = Strip(mask.m#) + posEqual = Pos('=',msk) + if posEqual = 0 then iterate ; + msk = overlay(' ',msk,posEqual) + text = Substr(msk,1,(posEqual-1)) + if Words(text)/= 1 then iterate + MaskWord = Word(msk,1) + posValue = Wordindex(msk,2) + MaskValue = Strip(Substr(msk,posValue)) + Say 'Found Mask for' MaskWord '=' MaskValue + MaskValue = Strip(MaskValue,"B",'"') + MaskValue = Strip(MaskValue,"B","'") + Mask.MaskWord = MaskValue + End ; /* Do m# = 1 to mask.0 */ + + X = OUTTRAP(LINE.); + + /* Apply mask values to Bind statement */ + /* Read the BINDSTMT */ + "EXECIO * DISKR BINDSTMT (Stem bind. Finis " + + /* Scan each line of the Bind Statement */ + Do b# = 1 to bind.0 + BindStatement = Strip(substr(bind.b#,1,72)) + /* BindStatement = substr(BindStatement,1,72) */ + If Words(BindStatement) = 0 then Iterate ; + If b# > 1 & b# < bind.0 &, + Substr(BindStatement,Length(BindStatement),1) /= '-' then, + BindStatement = BindStatement '-' + + /* Scan each Word of the Bind Statement */ + Do wrd# = 1 to Words(BindStatement) + pos_db2_1 = pos("BIND",BindStatement) + pos_db2_2 = pos("PLAN",BindStatement) + myword = Word(BindStatement,wrd#) ; + myword = Translate(myword,' ','(') + myword = Word(myword,1) + Mask = Mask.myword + If Mask = '' then iterate + tmp = Translate(myword,' ','()-+'); + stmt = Word(tmp,1) + Say 'Before:' BindStatement + + /* Find Starting and Ending positions of the clause */ + /* to be masked */ + plc = Wordindex(BindStatement,wrd#) + startpos = Pos('(',BindStatement,plc) + endpos = Pos(')',BindStatement,plc) + clauseLen = endpos - startpos + 1 + if plc = 0 then iterate ; + MaskValue = Substr(BindStatement,startpos,clauseLen) + MaskValue = Strip(MaskValue,'L','(') + MaskValue = Strip(MaskValue,'T',')') + MaskValue = Strip(MaskValue) + If Pos('.',MaskValue) > 0 then, + Do + wherePeriod = Pos('.',MaskValue) + Mask = Copies('-',wherePeriod) || Mask + End + OriginalLen = Length(MaskValue) + ValueStarts = Pos(MaskValue,BindStatement) ; + + /* Apply Mask to clause within the DB2 bind */ + Call ApplySingleMaskOverride ; + say 'Mask:' Mask + MaskValue = Strip(MaskValue) + where = Wordindex(BindStatement,wrd#) + newvalue = stmt'('MaskValue')' + newvalue = Left(newvalue,Length(myword)) + If ValueStarts > 1 then, + head = Substr(BindStatement,1,ValueStarts-1) + Else head = '' + BindStatement = head || MaskValue || , + Strip(Substr(BindStatement,ValueStarts+OriginalLen)) ; + Say 'After: ' BindStatement + Say Copies('-',70) + End /* Do wrd# = 1 Words(BindStatement) */ + + bind.b# = BindStatement + + End /* Do b# = 1 to bind.0 */ + + /* Replace the member with the Masked data */ + "EXECIO * DISKW BINDS (Stem bind. Finis " + + EXIT (MY_RC) ; + +ApplySingleMaskOverride: + + /* This routine applies values in 'Mask' */ + /* to the value in 'MaskValue' */ + SupportedWildCards = '?*-^' + + If Mask = ' ' then Mask ='*' ; + Do char# = 1 to Length(Mask) + maskchar = Substr(Mask,char#,1) ; + If maskchar = "?" then iterate ; + If maskchar = "*" then Leave ; + If maskchar = "-" then, + Do /* use one character from the value */ + tail = Substr(MaskValue,char# + 1) + head = Substr(MaskValue,1,char#) + MaskValue = Strip( head || tail) ; + Iterate ; + End; + If maskchar = "^" then, + Do /* eat one character from each .... */ + /* eat a MaskValue char */ + if char# > Length(MaskValue) then, + tail = '' + else, + tail = Substr(MaskValue,char# + 1) + if char# > 1 then, + head = Substr(MaskValue,1,char# - 1) + else, + head = '' + MaskValue = Strip( head || tail) ; + /* eat a Mask char too */ + If char# > 1 then, + Mask = Substr(Mask,1,(char#-1)) || Substr(Mask,(char#+1)) + Else, + Mask = Substr(Mask,2) + /* Mask char is changed for char# position */ + char# = char# - 1 + Iterate ; + End; + Maskchar = Substr(Mask,char#,1) ; + MaskValue = Overlay(Maskchar,MaskValue,char#) + If char# = Length(Mask) then, + MaskValue = Substr(MaskValue,1,char#) + End /* Do char# = 1 to Length(Mask) */ + + Return + + diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md b/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md index 7ac1a37..5abfe2d 100644 --- a/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md @@ -18,7 +18,7 @@ Examples in this folder include: - EXAMPL#3 Add members of a PDS into Endevor - EXAMPL#4 Execute PDM to update elements out of sync. - EXAMPL#5 Report the total Track consumption of a list of datasets - - EMPL#7XA Example processor that uses Table Tool to process JCLCheck data + - EMPL#7XA Example processor that uses Table Tool to process JCLCheck data - EXAMPL#8 Report processor usage including UnUsed processors. - EXAMPLEG Report of counts for each processor group reference - EXAMPL1A Report Elements in DEV signed out to one userid @@ -29,6 +29,18 @@ Examples in this folder include: - EXAMPL2P To Report Packages created over nnn days ago (using CSV data) - LISTDSNS From a Dataset mask, lists dataset names and attributes - PKGEMNTR To run the Package Monitor report + - Commonly requested utilities and the rexx which support them: + * CSV and TableTool emails element list to a distribution - need a report of what's in QA? need it emailed as an attachment? + * CSV and TableTool shows processor group usage - too many processor groups? want to know which ones are used / not used? + * CSV and TableTool finds and deletes unused processor groups - too many processor groups? want to find & delete the unused? + * CSV and TableTool showing element counts for each inventory area - easy to read report of elements and key data fields. + * TableTool builds a DB2 bindcard based on inventory area - dynamically build the bindcards based on system, stage, overrides, etc. + * TableTool builds a DB2 bindcard based on YAML control tablen - dynamically build the bindcards based on a YAML control table. + * CSV and TableTool examples in IEBUPDTE format - All of the above examples in singe member used as input to an IEBUPDTE job. + * DB2MASK$ rexx to build DB2 bindcards - masking utility used by the DB2 bindcard utility + * REX1LINE rexx to put processor group CSV data on one line - utility used by the processor group utiliites + * REXMERGE rexx to merge CSV list element with CSV list processor group - utility used by the processor group utiliites + * YAML2REX rexx to reformat YAML syntax to REXX - conversion utility used by the DB2 YAML bindcard utility The **Table-Tool-CSV-Sorting** folder contains items that allow you to SORT CSV data prior to a Table Tool Execution diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/REX1LINE rexx to put processor group CSV data on one line.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/REX1LINE rexx to put processor group CSV data on one line.txt new file mode 100644 index 0000000..1b223a8 --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/REX1LINE rexx to put processor group CSV data on one line.txt @@ -0,0 +1,27 @@ +/*****************************************************************\ +* Rexx routine to put move, gen, delete processor data onto one * +* line. * +\*****************************************************************/ + +'execio * diskr FILEIN (stem line.' +do # = 1 to line.0 + writerec = 'N' + skiprec = 'N' + + if POS(' G ',line.#) > 0 then save1 = SUBSTR(line.#,1,48) + if POS(' D ',line.#) > 0 then save2 = SUBSTR(line.#,39,10) + if POS(' M ',line.#) > 0 then do + save3 = SUBSTR(line.#,39,10) + line.# = save1 save2 save3 + if POS('G *NOPROC* D *NOPROC* M *NOPROC*',line.#) > 0 then, + skiprec = 'Y' + if POS('G GPPROCSS D DPPROCSS M GPPROCSS',line.#) > 0 then, + skiprec = 'Y' + if skiprec = 'N' then writerec = 'Y' + end + + if writerec = 'Y' then queue line.# +end + +'EXECIO * DISKW FILEOUT ( FINIS' +exit diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/REXMERGE rexx to merge CSV list element with CSV list processor group.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/REXMERGE rexx to merge CSV list element with CSV list processor group.txt new file mode 100644 index 0000000..95f4bb9 --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/REXMERGE rexx to merge CSV list element with CSV list processor group.txt @@ -0,0 +1,30 @@ +/*****************************************************************\ +* Rexx routine to merge Endevor processor group data with * +* element counts. * +\*****************************************************************/ + +'execio * diskr FILEIN1 (stem file1.' +'execio * diskr FILEIN2 (stem file2.' +h1 = 'Env # System Type P.Group Generate Delete Mo' +h2 = 've E.Count' +header = h1 || h2 +queue header +h1 = '-------- - -------- -------- -------- ---------- ---------- --' +h2 = '-------- -------' +header = h1 || h2 +queue header + +do # = 1 to file1.0 + f1key = SUBSTR(file1.#,1,38) + + do $ = 1 to file2.0 + f2key = SUBSTR(file2.$,1,38) + ecount = SUBSTR(file2.$,39,7) + if f1key = f2key then file1.# = SUBSTR(file1.#,1,71) ecount + end + + queue file1.# +end + +'EXECIO * DISKW FILEOUT ( FINIS' +exit diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/YAML2REX rexx to reformat YAML syntax to REXX.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/YAML2REX rexx to reformat YAML syntax to REXX.txt new file mode 100644 index 0000000..f793376 --- /dev/null +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/YAML2REX rexx to reformat YAML syntax to REXX.txt @@ -0,0 +1,442 @@ +/* REXX - Convert YAML to REXX. */ +/* in some cases Stem arrays, to support Mainframe processing */ + isItThere = , + BPXWDYN("INFO FI(YAML2REX) INRTDSN(DSNVAR) INRDSNT(myDSNT)") + If isItThere = 0 then TraceRc = 1 + Arg WhatDD . + /* */ + /* Process the input YAML file identified by Whatdd. */ + /* Queue REXX equivalent statements onto the stack */ + /* The value of each statement is either numeric */ + /* or quoted with double quotes. */ + /* */ + /* Caller can then safely Interpret them. */ + /* */ + + /* Read the YAML data, stor into yaml. stem array */ + "EXECIO * DISKR" WhatDD "( Stem yaml. finis" + + /* Set initial/default values */ + $Numbers = '0123456789.' ; + Call InitializeRexxVariables ; + + /* Process each YAML record -2nd pass - create REXX variables */ + Do y# = 1 to yaml.0 + yamlrec = yaml.y# + /* Previous indent becomes what we just processed */ + PreviousIndent# = Word(IndentTrail,1) + CallingFrom = 'DoLoop' + validrec = FirstLookAtIndentation() ; + if validrec = 0 then Iterate + validrec = CloserLookAtYamlrecall() ; + Call YAMLRecordToRexx + End /* Do y# = 1 to yaml.0 */ + + /* Place Rexx statements onto the stack for caller */ + RexxCounter = newRexx.0 + Do rx# = 1 to RexxCounter + If TraceRc = 1 then, + Say 'YAML2REX:' newRexx.rx# + Queue newRexx.rx# + End + + If TraceRc = 1 then, + Say 'YAML2REX: exiting ' + Exit + +InitializeRexxVariables: + + /* Set initial/default values */ + PreviousIndent# = 0; /* Assume text starts in col 1 */ + IndentLevel_Rexxnodes. = '' /* node to use with REXX stmts */ + IndentLevel_UpperIndent. = 0 /* Level of upper indentation*/ + IndentTrail = '0 ' /* Hist of indents old to new */ + + ListRexxVariables = ' ' /* Identify each unique Rexx variable */ + ListRexxVarCounts. = 0 /* Counts for unique Rexx variable */ + Verbose = 'N' /* Can be set/reset in yaml */ + listing = 'na' + newRexx. = '' /* Replacement REXX stmts to be here */ + newRexx.0 = 0 + + indent# = 0 + YamlListCounter. = 0 /* 0=> not a list >0 counting listed */ + multindent# = 0 + + Return; + +FirstLookAtIndentation: + + /* Bypass blank lines and comment lines */ + if Words(yamlrec) = 0 then Return 0 ; /* Blank line */ + whereComment = FindCommentPosition() + if whereComment = 1 then Return 0 ; /* Comment line */ + else + if whereComment = 0 then NOP + Else, /* Eliminate comment portion of Yaml line */ + Do + yamlrec = Substr(yamlrec,1,(whereComment -1)) + if Words(yamlrec) = 0 then Return 0 + End + + /* Find where no-blank text starts */ + indent# = WordIndex(yamlrec,1) + startChar = Substr(yamlrec,indent#,1) /*First char on YAML line */ + + If CallingFrom = 'ConvertListedText' then Return 1 + + /* If there is a leading '-' then in a Yaml list */ + If startChar = '-' then, + Do + /* Replace the '-' with a space */ + yamlrec = Overlay(' ',yamlrec,indent#) + indent# = WordIndex(yamlrec,1) + End + + Return 1 + +FindCommentPosition: + + Start =1 + Do forever + If Start >= length(yamlrec) then Return 0 + foundComment = Pos('#',yamlrec,Start); + if foundComment = 0 then Return 0 + OpenSingleQt = Pos("'",yamlrec,Start); + ClosSingleQt = Pos("'",yamlrec,OpenSingleQt+1) + OpenDoubleQt = Pos('"',yamlrec,Start); + ClosDoubleQt = Pos('"',yamlrec,OpenDoubleQt+1) + If foundComment > OpenSingleQt &, + foundComment < ClosSingleQt then, + Start = ClosSingleQt + 1 + Else, + If foundComment > OpenDoubleQt &, + foundComment < ClosDoubleQt then, + Start = ClosDoubleQt + 1 + Else Return foundComment + End /* Do forever */ + + Return foundComment + +CloserLookAtYamlrecall: + + /* If there is a change in indentation, then record the change */ + PreviousIndent# = Word(IndentTrail,1) + If indent# /= PreviousIndent# then, /* changed indentation */ + IndentTrail = indent# IndentTrail + + /* If there is just a Yaml listed item, return */ + If startChar /= '-' & pos(': ',yamlrec) = 0 then Return 1 then, + + /* Parse the Yaml entry, capturing YamlObect and YamlValue */ + Parse VAR yamlrec YamlObject ": " YamlValue + + /* Replace spaces in YamlObect with underscore chars '_' */ + YamlObject = Translate(Strip(YamlObject),'_',' ') + + /* Special handling of quote characters here..... */ + YamlValue = Strip(YamlValue) + $firstchar = Substr(YamlValue,1,1) + $nextQuote = 0 + If ($firstchar = "'" | $firstchar = '"') then, + $nextQuote = Pos($firstchar,YamlValue,2) + /* A quote character at beginning and end ? */ + If ($nextQuote = Length(YamlValue)) then, + YamlValue = Strip(YamlValue,'B',$firstchar) + Else, + YamlValue = Translate(YamlValue,"'",'"') + + /* You can selectively turn on the trace here....... */ + If YamlObject = 'Insert??t' then Trace ?r + + /* Manage the tracking of Yaml indentations */ + If indent# < PreviousIndent# then, /* decreased indentation */ + Call DecreasingIndentation ; + Else, + If indent# > PreviousIndent# then, /* increased indentation */ + Call IncreasingIndentation + Else, + If indent# = PreviousIndent# then, /* matching indentation */ + Call MatchingIndentation /* same indentation level */ + + Return 1 + +DecreasingIndentation: + + /* Indentation just Increased */ + + /* Use IndentTrail to find upper indentation for this one */ + upperIndent# = GetUpperIndent#() + /* What did we find looking upward ?*/ + IndentLevel_UpperIndent.indent# = upperIndent# + /* Get the Rexx nodes from upward locations */ + UpperVarb = Word(IndentLevel_Rexxnodes.upperIndent#,1) + /* Make this YamlObject 1st in the list here */ + If upperIndent# = 0 then, + CurrentVarb = YamlObject + Else, + CurrentVarb = UpperVarb'.'YamlObject + CurrentNodes = IndentLevel_Rexxnodes.indent# + If WordPos(CurrentVarb,CurrentNodes) = 0 then, + IndentLevel_Rexxnodes.indent# =, + CurrentVarb IndentLevel_Rexxnodes.indent# + Else, + Do + If startChar = '-' |, /* YAML starting list*/ + YamlListCounter.indent# > 0 then, + YamlListCounter.indent# = YamlListCounter.indent# + 1 ; + IndentLevel_Rexxnodes.indent# = CurrentVarb + End + /* If previousIndent was listing, it will have to start over */ + YamlListCounter.PreviousIndent# = 0 + IndentLevel_UpperIndent.PreviousIndent# = indent# + + Return + +IncreasingIndentation: + + /* Indentation just Increased */ + upperIndent# = PreviousIndent# + If startChar = '-' then, /* YAML starting list*/ + YamlListCounter.indent# = 1 ; /* count listed items*/ + + /* Assume prev indentation is upper indentation */ + UpperVarb = Word(IndentLevel_Rexxnodes.PreviousIndent#,1) + /* Make this YamlObject 1st in the list here */ + If PreviousIndent# = 0 then, + CurrentVarb = YamlObject + Else, + CurrentVarb = UpperVarb'.'YamlObject + If PreviousIndent# = 0 then, + IndentLevel_Rexxnodes.indent# = YamlObject + Else, + IndentLevel_Rexxnodes.indent# =, + CurrentVarb IndentLevel_Rexxnodes.indent# + /* At this level, capture reference to upper level */ + IndentLevel_UpperIndent.indent# = PreviousIndent# + + Return + +MatchingIndentation: + + /* Indentation remainded the same */ + + upperIndent# = IndentLevel_UpperIndent.indent# + /* Get the Rexx nodes from upward locations */ + UpperVarb = Word(IndentLevel_Rexxnodes.upperIndent#,1) + /* Make this YamlObject 1st in the list here */ + If upperIndent# = 0 then, + CurrentVarb = YamlObject + Else, + CurrentVarb = UpperVarb'.'YamlObject + CurrentNodes = IndentLevel_Rexxnodes.indent# + /* If the variable a repeating variable at this level? */ + If WordPos(CurrentVarb,CurrentNodes) = 0 then, /* no */ + IndentLevel_Rexxnodes.indent# =, + CurrentVarb CurrentNodes /* yes*/ + Else, + Do /* Repeating a YamlObject name, increment */ + IndentLevel_Rexxnodes.indent# = CurrentVarb + If YamlListCounter.indent# > 0 then, + YamlListCounter.indent# = YamlListCounter.indent# + 1 ; + End /* If YamlListCounter.indent# > 0 */ + + Return + +GetupperIndent#: + + /* Use IndentTrail to find upper indent value for just found */ + /* Yaml line with changed indentation. */ + Do trl# = 1 to Words(IndentTrail) /* find its outer indent*/ + happyTrails = Word(IndentTrail,trl#) + If happyTrails < indent# then Return happyTrails + End /* Do Forever.... search for next upper indentation */ + + Return 0 + + +ConvertListedText: + + /* Finding text listed in Yaml. Use Rexx YamlListCounter in output */ + RexxCounter = newRexx.0 + 1 + peek_y# = next_y# + 1 + /* Multi-lines ? if value is | or > */ + multindent# = WordIndex(yaml.peek_y#,1) + IndentLevel_UpperIndent.multindent# = indent# + upperIndent# = indent# + endLinechar = '15'x /* Ebcdic end-of-line char */ + TextCounter = 1 + CallingFrom = 'ConvertListedText' + Do Forever + next_y# = next_y# + 1 + if next_y# > yaml.0 then Leave + yamlrec = Strip( yaml.next_y#,'T') + validrec = FirstLookAtIndentation() ; + if indent# < multindent# then leave; + if validrec = 0 then Iterate + yamlrec = Substr(yamlrec,multindent#) + RexxCounter = RexxCounter + 1 + $firstchar = Substr(yamlrec,1,1) + If $firstchar = '"' then, + newRexx.RexxCounter =, + RexxVarb'.'TextCounter '='yamlrec + Else, + newRexx.RexxCounter =, + RexxVarb'.'TextCounter '="'yamlrec'"' + TextCounter = TextCounter + 1 + End /* Do Forever */ + + newRexx.0 = RexxCounter + + Return next_y# -1 + + +YAMLRecordToRexx: + + RexxVarb = '' + /* if not listing and no value, then no REXX (yet) */ + If Length(YamlValue) = 0 &, + YamlListCounter.indent# = 0 then RETURN; + + /* Yaml is listing objects or text */ + If PreviousIndent# = 0 & YamlListCounter.indent# > 0 then, + Do + Say 'YAML2REX: starting a list in column 1 is invalid' + Exit 12 + End x + RexxCounter = newRexx.0 + /* Yaml allows these values to indicate listed data on + lines*/ + If YamlValue = "|" | YamlValue = '>' then, + Do + Call DetermineRexxVarb ; + /* Use YamlListCounter and build Rexx Stem array stmts */ + next_y# = y# + y# = ConvertListedText() ; + Return; + End + + next_y# = y# - 1 + + /* Yaml list/ojb with YamlValue... Write 1 Rexx equal . */ + If Length(YamlValue) > 0 then, /* we have a Yaml value */ + Do /* Since there is a value, write Rexx 1 for 1: */ + /* Write a line of Rexx output, using YamlListCounter */ + RexxCounter = newRexx.0 + 1 + Call DetermineRexxVarb ; + + /* if Value is numeric, do not quote it */ + numericValue = Verify(YamlValue,$Numbers) + If numericValue > 0 then, + newRexx.RexxCounter = RexxVarb '="'YamlValue'"' + Else, + newRexx.RexxCounter = RexxVarb '='YamlValue + newRexx.0 = RexxCounter + + Return; + End /* If listing = 'Objects' */ + + /* Yaml list / no YamlValue... Save YamlObject */ + /* This is the indentation level for the 1st in list. */ + multindent# = WordIndex(yamlrec,1) /* level for the list */ + Return; + + /* Continue through Yaml for remainder of list */ + /* Loop for all found like this one and Write Rexx equal. */ + Do Forever /* until the indentation decreases */ + next_y# = next_y# + 1 + if next_y# > yaml.0 then Leave + yamlrec = yaml.next_y# + /* Do the normal scrub of the Yaml input lines */ + validrec = FirstLookAtIndentation() ; + /* Skip Blank lines and Comment lines */ + If validrec = 0 then Iterate + /* indentation decreased ? */ + if indent# < multindent# then Leave + RexxVarb = Word(UpperVarb,1) + Call WriteRexxWithYamlListCounter ; + + End /* Do Forever */ + + newRexx.0 = RexxCounter + y# = next_y# - 1 + /* Initialize these for the next Yaml List */ + IndentLevel_Rexxnodes.multindent# = '' + listing = 'na' + next_y# = 0 + Return; + + /* Not a YAML list..... */ + Return; + + /* Is the Indentation changing ? ... */ + if indent# = PreviousIndent# then, + Call MatchingIndentation /* same indentation level */ + Else, + if indent# > PreviousIndent# then, + Call IncreasingIndentation + Else, + if indent# < PreviousIndent# then, + Call DecreasingIndentation ; + + /* The found indentation is now the previous indentation */ + /* Is this a new Object/Word, or repeating one ? */ + + If Length(YamlValue) = 0 then, /* we have a Yaml Object */ + Return ; + + /* Multi-lines ? if value is | or > */ + If YamlValue = "|" | YamlValue = '>' then, + Do + next_y# = y# + RexxVarb = Word(UpperVarb,1)'.'YamlObject + y# = ConvertListedText() ; + Return; + End + + RexxVarb = IndentLevel_Rexxnodes.indent# + + If RexxVarb = '' then Return; + + /* contribute to the new Rexx statements */ + + where = Wordpos(RexxVarb,ListRexxVariables) + + thisVariableCount = ListRexxVarCounts.where + if thisVariableCount > 0 then, + Do + RexxVarb = RexxVarb'.'thisVariableCount + ListRexxVarCounts.where = ListRexxVarCounts.where +1 + End + + /* If value not numeric, surround with double quotes */ + RexxCounter = newRexx.0 + 1 + numericValue = Verify(YamlValue,$Numbers) + If numericValue > 0 then, + newRexx.RexxCounter = RexxVarb'="'YamlValue'"' + Else, + newRexx.RexxCounter = RexxVarb'='YamlValue + + newRexx.0 = RexxCounter + + Return + +DetermineRexxVarb: + + /* Determine REXX variable from upper and this indentation */ + upperIndent# = IndentLevel_UpperIndent.indent# + UpperVarb = Word(IndentLevel_Rexxnodes.upperIndent#,1) + + If upperIndent# = 0 then RexxVarb = YamlObject + Else, + If YamlListCounter.upperIndent# > 0 then, /* a Yaml List */ + RexxVarb = Word(UpperVarb,1)'.' ||, + YamlListCounter.upperIndent#'.'YamlObject + Else, /* a Yaml Object */ + RexxVarb = Word(UpperVarb,1)'.'YamlObject + + /* Determine REXX variable also from this indentation */ + If YamlListCounter.indent# > 0 then, /* a Yaml List */ + RexxVarb = RexxVarb'.'YamlListCounter.indent# + + Return + From 64bfa8b9dede2de7a50470cbf593a5d643878735 Mon Sep 17 00:00:00 2001 From: Joseph Walther <58827655+waljo11@users.noreply.github.com> Date: Tue, 6 May 2025 15:13:25 -0500 Subject: [PATCH 4/6] Update README.md --- .../Field-Developed-Programs/Table-Tool-Examples/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md b/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md index 5abfe2d..2f0ee62 100644 --- a/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md @@ -1,6 +1,8 @@ # Table-Tool-Examples A collection of JCL and processor members that demonstrate the use of Table Tool. +These samples are provided as is and are not officially supported (see [license](https://github.com/BroadcomMFD/broadcom-product-scripts/blob/main/LICENSE +) for more information). If you are new to Table Tool see these links for more information: - [Techdocs Documentation](https://techdocs.broadcom.com/us/en/ca-mainframe-software/devops/ca-endevor-software-change-manager/19-0/administrating/table-tool.html) @@ -40,7 +42,7 @@ Examples in this folder include: * DB2MASK$ rexx to build DB2 bindcards - masking utility used by the DB2 bindcard utility * REX1LINE rexx to put processor group CSV data on one line - utility used by the processor group utiliites * REXMERGE rexx to merge CSV list element with CSV list processor group - utility used by the processor group utiliites - * YAML2REX rexx to reformat YAML syntax to REXX - conversion utility used by the DB2 YAML bindcard utility + * YAML2REX rexx to reformat YAML syntax to REXX - conversion utility used by the DB2 YAML bindcard utility. Find the source code for {YAML2REXX here}(https://github.com/BroadcomMFD/broadcom-product-scripts/blob/main/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.rex) The **Table-Tool-CSV-Sorting** folder contains items that allow you to SORT CSV data prior to a Table Tool Execution From aabc6b98932c4910743f06f43d997a8350ce7afc Mon Sep 17 00:00:00 2001 From: Joseph Walther <58827655+waljo11@users.noreply.github.com> Date: Tue, 6 May 2025 15:18:17 -0500 Subject: [PATCH 5/6] Update README.md --- endevor/Field-Developed-Programs/Table-Tool-Examples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md b/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md index 2f0ee62..b4c837c 100644 --- a/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md +++ b/endevor/Field-Developed-Programs/Table-Tool-Examples/README.md @@ -42,7 +42,7 @@ Examples in this folder include: * DB2MASK$ rexx to build DB2 bindcards - masking utility used by the DB2 bindcard utility * REX1LINE rexx to put processor group CSV data on one line - utility used by the processor group utiliites * REXMERGE rexx to merge CSV list element with CSV list processor group - utility used by the processor group utiliites - * YAML2REX rexx to reformat YAML syntax to REXX - conversion utility used by the DB2 YAML bindcard utility. Find the source code for {YAML2REXX here}(https://github.com/BroadcomMFD/broadcom-product-scripts/blob/main/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.rex) + * YAML2REX rexx to reformat YAML syntax to REXX - conversion utility used by the DB2 YAML bindcard utility. Find the source code for [YAML2REXX here](https://github.com/BroadcomMFD/broadcom-product-scripts/blob/main/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.rex) The **Table-Tool-CSV-Sorting** folder contains items that allow you to SORT CSV data prior to a Table Tool Execution From 3c04830211a28da0b10ac15f25e12ab8773c4fb1 Mon Sep 17 00:00:00 2001 From: Joseph Walther Date: Tue, 6 May 2025 15:27:41 -0500 Subject: [PATCH 6/6] Delete YAML2REX rexx to reformat YAML syntax to REXX.txt Update YAML2REX references --- ...X rexx to reformat YAML syntax to REXX.txt | 442 ------------------ 1 file changed, 442 deletions(-) delete mode 100644 endevor/Field-Developed-Programs/Table-Tool-Examples/YAML2REX rexx to reformat YAML syntax to REXX.txt diff --git a/endevor/Field-Developed-Programs/Table-Tool-Examples/YAML2REX rexx to reformat YAML syntax to REXX.txt b/endevor/Field-Developed-Programs/Table-Tool-Examples/YAML2REX rexx to reformat YAML syntax to REXX.txt deleted file mode 100644 index f793376..0000000 --- a/endevor/Field-Developed-Programs/Table-Tool-Examples/YAML2REX rexx to reformat YAML syntax to REXX.txt +++ /dev/null @@ -1,442 +0,0 @@ -/* REXX - Convert YAML to REXX. */ -/* in some cases Stem arrays, to support Mainframe processing */ - isItThere = , - BPXWDYN("INFO FI(YAML2REX) INRTDSN(DSNVAR) INRDSNT(myDSNT)") - If isItThere = 0 then TraceRc = 1 - Arg WhatDD . - /* */ - /* Process the input YAML file identified by Whatdd. */ - /* Queue REXX equivalent statements onto the stack */ - /* The value of each statement is either numeric */ - /* or quoted with double quotes. */ - /* */ - /* Caller can then safely Interpret them. */ - /* */ - - /* Read the YAML data, stor into yaml. stem array */ - "EXECIO * DISKR" WhatDD "( Stem yaml. finis" - - /* Set initial/default values */ - $Numbers = '0123456789.' ; - Call InitializeRexxVariables ; - - /* Process each YAML record -2nd pass - create REXX variables */ - Do y# = 1 to yaml.0 - yamlrec = yaml.y# - /* Previous indent becomes what we just processed */ - PreviousIndent# = Word(IndentTrail,1) - CallingFrom = 'DoLoop' - validrec = FirstLookAtIndentation() ; - if validrec = 0 then Iterate - validrec = CloserLookAtYamlrecall() ; - Call YAMLRecordToRexx - End /* Do y# = 1 to yaml.0 */ - - /* Place Rexx statements onto the stack for caller */ - RexxCounter = newRexx.0 - Do rx# = 1 to RexxCounter - If TraceRc = 1 then, - Say 'YAML2REX:' newRexx.rx# - Queue newRexx.rx# - End - - If TraceRc = 1 then, - Say 'YAML2REX: exiting ' - Exit - -InitializeRexxVariables: - - /* Set initial/default values */ - PreviousIndent# = 0; /* Assume text starts in col 1 */ - IndentLevel_Rexxnodes. = '' /* node to use with REXX stmts */ - IndentLevel_UpperIndent. = 0 /* Level of upper indentation*/ - IndentTrail = '0 ' /* Hist of indents old to new */ - - ListRexxVariables = ' ' /* Identify each unique Rexx variable */ - ListRexxVarCounts. = 0 /* Counts for unique Rexx variable */ - Verbose = 'N' /* Can be set/reset in yaml */ - listing = 'na' - newRexx. = '' /* Replacement REXX stmts to be here */ - newRexx.0 = 0 - - indent# = 0 - YamlListCounter. = 0 /* 0=> not a list >0 counting listed */ - multindent# = 0 - - Return; - -FirstLookAtIndentation: - - /* Bypass blank lines and comment lines */ - if Words(yamlrec) = 0 then Return 0 ; /* Blank line */ - whereComment = FindCommentPosition() - if whereComment = 1 then Return 0 ; /* Comment line */ - else - if whereComment = 0 then NOP - Else, /* Eliminate comment portion of Yaml line */ - Do - yamlrec = Substr(yamlrec,1,(whereComment -1)) - if Words(yamlrec) = 0 then Return 0 - End - - /* Find where no-blank text starts */ - indent# = WordIndex(yamlrec,1) - startChar = Substr(yamlrec,indent#,1) /*First char on YAML line */ - - If CallingFrom = 'ConvertListedText' then Return 1 - - /* If there is a leading '-' then in a Yaml list */ - If startChar = '-' then, - Do - /* Replace the '-' with a space */ - yamlrec = Overlay(' ',yamlrec,indent#) - indent# = WordIndex(yamlrec,1) - End - - Return 1 - -FindCommentPosition: - - Start =1 - Do forever - If Start >= length(yamlrec) then Return 0 - foundComment = Pos('#',yamlrec,Start); - if foundComment = 0 then Return 0 - OpenSingleQt = Pos("'",yamlrec,Start); - ClosSingleQt = Pos("'",yamlrec,OpenSingleQt+1) - OpenDoubleQt = Pos('"',yamlrec,Start); - ClosDoubleQt = Pos('"',yamlrec,OpenDoubleQt+1) - If foundComment > OpenSingleQt &, - foundComment < ClosSingleQt then, - Start = ClosSingleQt + 1 - Else, - If foundComment > OpenDoubleQt &, - foundComment < ClosDoubleQt then, - Start = ClosDoubleQt + 1 - Else Return foundComment - End /* Do forever */ - - Return foundComment - -CloserLookAtYamlrecall: - - /* If there is a change in indentation, then record the change */ - PreviousIndent# = Word(IndentTrail,1) - If indent# /= PreviousIndent# then, /* changed indentation */ - IndentTrail = indent# IndentTrail - - /* If there is just a Yaml listed item, return */ - If startChar /= '-' & pos(': ',yamlrec) = 0 then Return 1 then, - - /* Parse the Yaml entry, capturing YamlObect and YamlValue */ - Parse VAR yamlrec YamlObject ": " YamlValue - - /* Replace spaces in YamlObect with underscore chars '_' */ - YamlObject = Translate(Strip(YamlObject),'_',' ') - - /* Special handling of quote characters here..... */ - YamlValue = Strip(YamlValue) - $firstchar = Substr(YamlValue,1,1) - $nextQuote = 0 - If ($firstchar = "'" | $firstchar = '"') then, - $nextQuote = Pos($firstchar,YamlValue,2) - /* A quote character at beginning and end ? */ - If ($nextQuote = Length(YamlValue)) then, - YamlValue = Strip(YamlValue,'B',$firstchar) - Else, - YamlValue = Translate(YamlValue,"'",'"') - - /* You can selectively turn on the trace here....... */ - If YamlObject = 'Insert??t' then Trace ?r - - /* Manage the tracking of Yaml indentations */ - If indent# < PreviousIndent# then, /* decreased indentation */ - Call DecreasingIndentation ; - Else, - If indent# > PreviousIndent# then, /* increased indentation */ - Call IncreasingIndentation - Else, - If indent# = PreviousIndent# then, /* matching indentation */ - Call MatchingIndentation /* same indentation level */ - - Return 1 - -DecreasingIndentation: - - /* Indentation just Increased */ - - /* Use IndentTrail to find upper indentation for this one */ - upperIndent# = GetUpperIndent#() - /* What did we find looking upward ?*/ - IndentLevel_UpperIndent.indent# = upperIndent# - /* Get the Rexx nodes from upward locations */ - UpperVarb = Word(IndentLevel_Rexxnodes.upperIndent#,1) - /* Make this YamlObject 1st in the list here */ - If upperIndent# = 0 then, - CurrentVarb = YamlObject - Else, - CurrentVarb = UpperVarb'.'YamlObject - CurrentNodes = IndentLevel_Rexxnodes.indent# - If WordPos(CurrentVarb,CurrentNodes) = 0 then, - IndentLevel_Rexxnodes.indent# =, - CurrentVarb IndentLevel_Rexxnodes.indent# - Else, - Do - If startChar = '-' |, /* YAML starting list*/ - YamlListCounter.indent# > 0 then, - YamlListCounter.indent# = YamlListCounter.indent# + 1 ; - IndentLevel_Rexxnodes.indent# = CurrentVarb - End - /* If previousIndent was listing, it will have to start over */ - YamlListCounter.PreviousIndent# = 0 - IndentLevel_UpperIndent.PreviousIndent# = indent# - - Return - -IncreasingIndentation: - - /* Indentation just Increased */ - upperIndent# = PreviousIndent# - If startChar = '-' then, /* YAML starting list*/ - YamlListCounter.indent# = 1 ; /* count listed items*/ - - /* Assume prev indentation is upper indentation */ - UpperVarb = Word(IndentLevel_Rexxnodes.PreviousIndent#,1) - /* Make this YamlObject 1st in the list here */ - If PreviousIndent# = 0 then, - CurrentVarb = YamlObject - Else, - CurrentVarb = UpperVarb'.'YamlObject - If PreviousIndent# = 0 then, - IndentLevel_Rexxnodes.indent# = YamlObject - Else, - IndentLevel_Rexxnodes.indent# =, - CurrentVarb IndentLevel_Rexxnodes.indent# - /* At this level, capture reference to upper level */ - IndentLevel_UpperIndent.indent# = PreviousIndent# - - Return - -MatchingIndentation: - - /* Indentation remainded the same */ - - upperIndent# = IndentLevel_UpperIndent.indent# - /* Get the Rexx nodes from upward locations */ - UpperVarb = Word(IndentLevel_Rexxnodes.upperIndent#,1) - /* Make this YamlObject 1st in the list here */ - If upperIndent# = 0 then, - CurrentVarb = YamlObject - Else, - CurrentVarb = UpperVarb'.'YamlObject - CurrentNodes = IndentLevel_Rexxnodes.indent# - /* If the variable a repeating variable at this level? */ - If WordPos(CurrentVarb,CurrentNodes) = 0 then, /* no */ - IndentLevel_Rexxnodes.indent# =, - CurrentVarb CurrentNodes /* yes*/ - Else, - Do /* Repeating a YamlObject name, increment */ - IndentLevel_Rexxnodes.indent# = CurrentVarb - If YamlListCounter.indent# > 0 then, - YamlListCounter.indent# = YamlListCounter.indent# + 1 ; - End /* If YamlListCounter.indent# > 0 */ - - Return - -GetupperIndent#: - - /* Use IndentTrail to find upper indent value for just found */ - /* Yaml line with changed indentation. */ - Do trl# = 1 to Words(IndentTrail) /* find its outer indent*/ - happyTrails = Word(IndentTrail,trl#) - If happyTrails < indent# then Return happyTrails - End /* Do Forever.... search for next upper indentation */ - - Return 0 - - -ConvertListedText: - - /* Finding text listed in Yaml. Use Rexx YamlListCounter in output */ - RexxCounter = newRexx.0 + 1 - peek_y# = next_y# + 1 - /* Multi-lines ? if value is | or > */ - multindent# = WordIndex(yaml.peek_y#,1) - IndentLevel_UpperIndent.multindent# = indent# - upperIndent# = indent# - endLinechar = '15'x /* Ebcdic end-of-line char */ - TextCounter = 1 - CallingFrom = 'ConvertListedText' - Do Forever - next_y# = next_y# + 1 - if next_y# > yaml.0 then Leave - yamlrec = Strip( yaml.next_y#,'T') - validrec = FirstLookAtIndentation() ; - if indent# < multindent# then leave; - if validrec = 0 then Iterate - yamlrec = Substr(yamlrec,multindent#) - RexxCounter = RexxCounter + 1 - $firstchar = Substr(yamlrec,1,1) - If $firstchar = '"' then, - newRexx.RexxCounter =, - RexxVarb'.'TextCounter '='yamlrec - Else, - newRexx.RexxCounter =, - RexxVarb'.'TextCounter '="'yamlrec'"' - TextCounter = TextCounter + 1 - End /* Do Forever */ - - newRexx.0 = RexxCounter - - Return next_y# -1 - - -YAMLRecordToRexx: - - RexxVarb = '' - /* if not listing and no value, then no REXX (yet) */ - If Length(YamlValue) = 0 &, - YamlListCounter.indent# = 0 then RETURN; - - /* Yaml is listing objects or text */ - If PreviousIndent# = 0 & YamlListCounter.indent# > 0 then, - Do - Say 'YAML2REX: starting a list in column 1 is invalid' - Exit 12 - End x - RexxCounter = newRexx.0 - /* Yaml allows these values to indicate listed data on + lines*/ - If YamlValue = "|" | YamlValue = '>' then, - Do - Call DetermineRexxVarb ; - /* Use YamlListCounter and build Rexx Stem array stmts */ - next_y# = y# - y# = ConvertListedText() ; - Return; - End - - next_y# = y# - 1 - - /* Yaml list/ojb with YamlValue... Write 1 Rexx equal . */ - If Length(YamlValue) > 0 then, /* we have a Yaml value */ - Do /* Since there is a value, write Rexx 1 for 1: */ - /* Write a line of Rexx output, using YamlListCounter */ - RexxCounter = newRexx.0 + 1 - Call DetermineRexxVarb ; - - /* if Value is numeric, do not quote it */ - numericValue = Verify(YamlValue,$Numbers) - If numericValue > 0 then, - newRexx.RexxCounter = RexxVarb '="'YamlValue'"' - Else, - newRexx.RexxCounter = RexxVarb '='YamlValue - newRexx.0 = RexxCounter - - Return; - End /* If listing = 'Objects' */ - - /* Yaml list / no YamlValue... Save YamlObject */ - /* This is the indentation level for the 1st in list. */ - multindent# = WordIndex(yamlrec,1) /* level for the list */ - Return; - - /* Continue through Yaml for remainder of list */ - /* Loop for all found like this one and Write Rexx equal. */ - Do Forever /* until the indentation decreases */ - next_y# = next_y# + 1 - if next_y# > yaml.0 then Leave - yamlrec = yaml.next_y# - /* Do the normal scrub of the Yaml input lines */ - validrec = FirstLookAtIndentation() ; - /* Skip Blank lines and Comment lines */ - If validrec = 0 then Iterate - /* indentation decreased ? */ - if indent# < multindent# then Leave - RexxVarb = Word(UpperVarb,1) - Call WriteRexxWithYamlListCounter ; - - End /* Do Forever */ - - newRexx.0 = RexxCounter - y# = next_y# - 1 - /* Initialize these for the next Yaml List */ - IndentLevel_Rexxnodes.multindent# = '' - listing = 'na' - next_y# = 0 - Return; - - /* Not a YAML list..... */ - Return; - - /* Is the Indentation changing ? ... */ - if indent# = PreviousIndent# then, - Call MatchingIndentation /* same indentation level */ - Else, - if indent# > PreviousIndent# then, - Call IncreasingIndentation - Else, - if indent# < PreviousIndent# then, - Call DecreasingIndentation ; - - /* The found indentation is now the previous indentation */ - /* Is this a new Object/Word, or repeating one ? */ - - If Length(YamlValue) = 0 then, /* we have a Yaml Object */ - Return ; - - /* Multi-lines ? if value is | or > */ - If YamlValue = "|" | YamlValue = '>' then, - Do - next_y# = y# - RexxVarb = Word(UpperVarb,1)'.'YamlObject - y# = ConvertListedText() ; - Return; - End - - RexxVarb = IndentLevel_Rexxnodes.indent# - - If RexxVarb = '' then Return; - - /* contribute to the new Rexx statements */ - - where = Wordpos(RexxVarb,ListRexxVariables) - - thisVariableCount = ListRexxVarCounts.where - if thisVariableCount > 0 then, - Do - RexxVarb = RexxVarb'.'thisVariableCount - ListRexxVarCounts.where = ListRexxVarCounts.where +1 - End - - /* If value not numeric, surround with double quotes */ - RexxCounter = newRexx.0 + 1 - numericValue = Verify(YamlValue,$Numbers) - If numericValue > 0 then, - newRexx.RexxCounter = RexxVarb'="'YamlValue'"' - Else, - newRexx.RexxCounter = RexxVarb'='YamlValue - - newRexx.0 = RexxCounter - - Return - -DetermineRexxVarb: - - /* Determine REXX variable from upper and this indentation */ - upperIndent# = IndentLevel_UpperIndent.indent# - UpperVarb = Word(IndentLevel_Rexxnodes.upperIndent#,1) - - If upperIndent# = 0 then RexxVarb = YamlObject - Else, - If YamlListCounter.upperIndent# > 0 then, /* a Yaml List */ - RexxVarb = Word(UpperVarb,1)'.' ||, - YamlListCounter.upperIndent#'.'YamlObject - Else, /* a Yaml Object */ - RexxVarb = Word(UpperVarb,1)'.'YamlObject - - /* Determine REXX variable also from this indentation */ - If YamlListCounter.indent# > 0 then, /* a Yaml List */ - RexxVarb = RexxVarb'.'YamlListCounter.indent# - - Return -