Skip to content

Yaml to rexx update #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -36,17 +39,21 @@ 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

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

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.
Original file line number Diff line number Diff line change
@@ -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
//*-------------------------------------------------------------------*
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion endevor/Field-Developed-Programs/README.md
Original file line number Diff line number Diff line change
@@ -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 ? ##

Expand Down