Skip to content

Commit f6dd0b6

Browse files
authored
Merge pull request #127 from BroadcomMFD/YAML-To-Rexx-Update
Yaml to rexx update
2 parents 83fd036 + bfa7881 commit f6dd0b6

File tree

4 files changed

+68
-3
lines changed

4 files changed

+68
-3
lines changed

endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/README.MD

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
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.
44

5+
These samples are provided as is and are not officially supported (see [license](https://github.com/BroadcomMFD/broadcom-product-scripts/blob/main/LICENSE
6+
) for more information).
7+
58
## VALUECHK
69

710
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,17 +39,21 @@ A processor REXX program that simulates the DB2 Masking method for Binds, used b
3639

3740
A processor and its REXX parser that can perform syntax checking on OPTIONS elements.
3841

42+
## YAML2REX
43+
44+
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.
45+
46+
Practical applications using REXX converted from YAML can be found in the **Dyname-Syslib** members, and others on this GitHub.
3947

4048
## Dynamic-Syslib
4149

4250
Items in this folder support the sharing of input components across developer efforts/projects that are underway in parallel.
4351

4452
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.
4553

46-
## OPTVALDT, TXTRPLCE, JCLRPLCE and YAML2REX
54+
## OPTVALDT, TXTRPLCE and JCLRPLCE
4755

4856
These are REXX subroutines which are used by other FDP solutions:
4957
- OPTVALDT processes OPTIONS statements to ensure values are numeric or properly quoted
5058
- TXTRPLCE is a generic Search and Replace utility
5159
- 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.
52-
- 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.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//IBMUSERY JOB (0000),
2+
// 'ENDEVOR JOB',MSGLEVEL=(1,1),CLASS=B,REGION=0M,MSGCLASS=A,
3+
// NOTIFY=&SYSUID
4+
//*-Convert YAML to REXX -----------------------------*
5+
//*-JCL: YOURSITE.NDVR.TEAM.JCL(YAML2REX) -----------------------------*
6+
//*-Output: SYSTSPRT -----------------------------*
7+
//*-------------------------------------------------------------------*
8+
// SET MEMBER=ACTP0003
9+
// SET MEMBER=ACTP0001
10+
// SET MEMBER=WAITSECS
11+
// SET MEMBER=JOBNUM44
12+
// SET MEMBER=SBOMTEST
13+
// SET MEMBER=TEST4Z
14+
//*--------
15+
// SET YAML=YOURSITE.NDVR.TEAM.YAML
16+
//*-------------------------------------------------------------------*
17+
//*-- Convert YAML to REXX -----------------------------*
18+
//*-------------------------------------------------------------------*
19+
//SAVEMBR EXEC PGM=IRXJCL,PARM='ENBPIU00 1'
20+
//OPTIONS DD *
21+
Call YAML2REX 'MYYAML'
22+
HowManyYamls = QUEUED();
23+
* Say 'HowManyYamls=' HowManyYamls
24+
Do yaml# =1 to HowManyYamls; +
25+
Parse pull yaml2rexx; Say yaml2rexx; +
26+
End
27+
Exit
28+
//*YAML2REX DD DUMMY <- Turn on/off REXX trace
29+
//MYYAML DD DISP=SHR,DSN=&YAML(&MEMBER)
30+
//SYSEXEC DD DISP=SHR,DSN=YOURSITE.NDVR.REXX
31+
//TBLOUT DD SYSOUT=*
32+
//SYSTSPRT DD SYSOUT=*
33+
//SYSTSIN DD DUMMY
34+
//*-------------------------------------------------------------------*

endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.rex

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* REXX - Convert YAML to REXX. */
22
/* in some cases Stem arrays, to support Mainframe processing */
3+
34
isItThere = ,
45
BPXWDYN("INFO FI(YAML2REX) INRTDSN(DSNVAR) INRDSNT(myDSNT)")
56
If isItThere = 0 then TraceRc = 1
@@ -32,6 +33,27 @@
3233
Call YAMLRecordToRexx
3334
End /* Do y# = 1 to yaml.0 */
3435

36+
/* Provide final numeric values for rexx.### entries */
37+
RexxCounter = newRexx.0
38+
NewRexxCounter = RexxCounter
39+
ListNumberedRexx = ''
40+
Do rx# = RexxCounter by -1 to 1
41+
If Words(newRexx.rx#) < 2 then iterate;
42+
RexxSymbol = Word(newRexx.rx#,1)
43+
tempSymbol = Translate(RexxSymbol," ",".")
44+
numberedInx = Word(tempSymbol,Words(tempSymbol))
45+
numericValue = Verify(numberedInx,$Numbers)
46+
If numericValue > 0 then Iterate
47+
finalnumber = Word(tempSymbol,Words(tempsymbol))
48+
wherelast = WordIndex(tempSymbol,Words(tempsymbol))
49+
RexxVarb = Substr(RexxSymbol,1,wherelast-1) || '0'
50+
If Wordpos(RexxVarb,ListNumberedRexx) > 0 then iterate
51+
ListNumberedRexx = ListNumberedRexx RexxVarb
52+
NewRexxCounter = NewRexxCounter + 1
53+
newRexx.NewRexxCounter = RexxVarb '= ' finalnumber
54+
End
55+
newRexx.0 = NewRexxCounter
56+
3557
/* Place Rexx statements onto the stack for caller */
3658
RexxCounter = newRexx.0
3759
Do rx# = 1 to RexxCounter

endevor/Field-Developed-Programs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Field-Developed-Programs
22

33
"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.
4-
They are tested, secure and available for your use.
4+
5+
These samples are provided as is and are not officially supported (see [license](https://github.com/BroadcomMFD/broadcom-product-scripts/blob/main/LICENSE
6+
) for more information).
57

68
## New to GitHub ? ##
79

0 commit comments

Comments
 (0)