diff --git a/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/README.MD b/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/README.MD index 514893f..25dc709 100644 --- a/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/README.MD +++ b/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/README.MD @@ -2,6 +2,9 @@ At this location are found Endevor processor utilities and snippets of example processor code. For the sake of highlighting and syntax checking, processors and processor snippets are given the .jcl extension. +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). + ## VALUECHK This processor utility complements the use of CONPARMX within your processors. The input instructions for CONPARMX are typically called PARMS or OPTIONS, and may be extended to contain statements that are processed by VALUECHK, and not CONPARMX. Statements of this kind adhere to a format such as: @@ -36,6 +39,11 @@ A processor REXX program that simulates the DB2 Masking method for Binds, used b A processor and its REXX parser that can perform syntax checking on OPTIONS elements. +## YAML2REX + + YAML2REX.rex is a utility that can convert (simple) YAML statements into usable REXX. You can allow YAML files to become data for your automated processing. Use the YAML2REX.jcl member to see what the conversion does to your YAML files. + +Practical applications using REXX converted from YAML can be found in the **Dyname-Syslib** members, and others on this GitHub. ## Dynamic-Syslib @@ -43,10 +51,9 @@ Items in this folder support the sharing of input components across developer ef For example, development for a January release might be underway in one sandbox (or environment) at the same time as development for a March release in another sandbox (or environment). This feature allows the March release to include libraries from the January release within its own SYSLIB concatenations, before the January release is Moved to production. -## OPTVALDT, TXTRPLCE, JCLRPLCE and YAML2REX +## OPTVALDT, TXTRPLCE and JCLRPLCE These are REXX subroutines which are used by other FDP solutions: - OPTVALDT processes OPTIONS statements to ensure values are numeric or properly quoted - TXTRPLCE is a generic Search and Replace utility - JCLRPLCE is like TXTRPLCE, but provides precise JCL change instructions, where jobcard and/or Stepname.DDname references point to specific locations within a JCL for changes and inserts. - - YAML2REX is converts many YAML constructs into usable REXX. The conversion might result in REXX stem arrays, so that when accompanied by appropriate Do Loops, various actions are automated. \ No newline at end of file diff --git a/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.jcl b/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.jcl new file mode 100644 index 0000000..da9e4a0 --- /dev/null +++ b/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.jcl @@ -0,0 +1,34 @@ +//IBMUSERY JOB (0000), +// 'ENDEVOR JOB',MSGLEVEL=(1,1),CLASS=B,REGION=0M,MSGCLASS=A, +// NOTIFY=&SYSUID +//*-Convert YAML to REXX -----------------------------* +//*-JCL: YOURSITE.NDVR.TEAM.JCL(YAML2REX) -----------------------------* +//*-Output: SYSTSPRT -----------------------------* +//*-------------------------------------------------------------------* +// SET MEMBER=ACTP0003 +// SET MEMBER=ACTP0001 +// SET MEMBER=WAITSECS +// SET MEMBER=JOBNUM44 +// SET MEMBER=SBOMTEST +// SET MEMBER=TEST4Z +//*-------- +// SET YAML=YOURSITE.NDVR.TEAM.YAML +//*-------------------------------------------------------------------* +//*-- Convert YAML to REXX -----------------------------* +//*-------------------------------------------------------------------* +//SAVEMBR EXEC PGM=IRXJCL,PARM='ENBPIU00 1' +//OPTIONS DD * + Call YAML2REX 'MYYAML' + HowManyYamls = QUEUED(); +* Say 'HowManyYamls=' HowManyYamls + Do yaml# =1 to HowManyYamls; + + Parse pull yaml2rexx; Say yaml2rexx; + + End + Exit +//*YAML2REX DD DUMMY <- Turn on/off REXX trace +//MYYAML DD DISP=SHR,DSN=&YAML(&MEMBER) +//SYSEXEC DD DISP=SHR,DSN=YOURSITE.NDVR.REXX +//TBLOUT DD SYSOUT=* +//SYSTSPRT DD SYSOUT=* +//SYSTSIN DD DUMMY +//*-------------------------------------------------------------------* diff --git a/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.rex b/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.rex index f793376..0646b07 100644 --- a/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.rex +++ b/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.rex @@ -1,5 +1,6 @@ /* 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 @@ -32,6 +33,27 @@ Call YAMLRecordToRexx End /* Do y# = 1 to yaml.0 */ + /* Provide final numeric values for rexx.### entries */ + RexxCounter = newRexx.0 + NewRexxCounter = RexxCounter + ListNumberedRexx = '' + Do rx# = RexxCounter by -1 to 1 + If Words(newRexx.rx#) < 2 then iterate; + RexxSymbol = Word(newRexx.rx#,1) + tempSymbol = Translate(RexxSymbol," ",".") + numberedInx = Word(tempSymbol,Words(tempSymbol)) + numericValue = Verify(numberedInx,$Numbers) + If numericValue > 0 then Iterate + finalnumber = Word(tempSymbol,Words(tempsymbol)) + wherelast = WordIndex(tempSymbol,Words(tempsymbol)) + RexxVarb = Substr(RexxSymbol,1,wherelast-1) || '0' + If Wordpos(RexxVarb,ListNumberedRexx) > 0 then iterate + ListNumberedRexx = ListNumberedRexx RexxVarb + NewRexxCounter = NewRexxCounter + 1 + newRexx.NewRexxCounter = RexxVarb '= ' finalnumber + End + newRexx.0 = NewRexxCounter + /* Place Rexx statements onto the stack for caller */ RexxCounter = newRexx.0 Do rx# = 1 to RexxCounter diff --git a/endevor/Field-Developed-Programs/README.md b/endevor/Field-Developed-Programs/README.md index c5cf704..f2d5ea7 100644 --- a/endevor/Field-Developed-Programs/README.md +++ b/endevor/Field-Developed-Programs/README.md @@ -1,7 +1,9 @@ # Field-Developed-Programs "Field Developed Program" (FDP) is a term used to refer to programs that were created to address specific needs or requirements of customers. These were constructed by your trusted Broadcom Services team and have been implemented at multiple Endevor customer sites. -They are tested, secure and available for your use. + +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). ## New to GitHub ? ##