Skip to content

Commit ecd7a3b

Browse files
authored
Merge pull request #130 from BroadcomMFD/Automated-Test-Facility-for-Batch-Applications-update
Automated test facility for batch applications update - README update and included items
2 parents c0d140a + 858ab4e commit ecd7a3b

File tree

4 files changed

+219
-1
lines changed

4 files changed

+219
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* REXX */
2+
/* Bump the last character on a Jobname to next value */
3+
Trace O
4+
Arg jobname;
5+
Rotation = '12345678901',
6+
'ABCDEFGHIJKLMNOPQRSTUVWXYZA',
7+
'@#$@'
8+
jobname = word(jobname,1)
9+
lastchar = Substr(jobname,Length(jobname))
10+
wherenext = Pos(lastchar,Rotation) + 1
11+
overlaychar = Substr(Rotation,wherenext,1)
12+
nextJobname = overlay(jobname,overlaychar,Length(jobname))
13+
nextJobname = overlay(overlaychar,jobname,Length(jobname))
14+
Return nextJobname
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* REXX */
2+
Arg whatuser
3+
JobAccountingCode. = '12340'
4+
JobAccountingCode.user#01 = '127398730'
5+
JobAccountingCode.user#02 = '127398730'
6+
JobAccountingCode.user#03 = '106321234'
7+
JobAccountingCode.user#04 = '106321234'
8+
JobAccountingCode.user#05 = '111212340'
9+
JobAccountingCode.user#06 = '124312340'
10+
JobAccountingCode.user#07 = '121412340'
11+
JobAccountingCode.user#08 = '118412340'
12+
JobAccountingCode.user#09 = '124312340'
13+
JobAccountingCode.user#10 = '114412340'
14+
JobAccountingCode.user#11 = '123212340'
15+
JobAccountingCode.user#12 = '111412340'
16+
JobAccountingCode.user#13 = '106341234'
17+
JobAccountingCode.user#14 = '301123400'
18+
Return JobAccountingCode.whatuser
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/* REXX */
2+
/*----------------------------------------------------------*/
3+
/* This Rexx is given a JCL dataset and member name in its */
4+
/* parameter. */
5+
/* The REXX: */
6+
/* o submits the JCL */
7+
/* o watches and waits for it to complete its execution*/
8+
/* o returns to caller */
9+
/* */
10+
/*----------------------------------------------------------*/
11+
CALL BPXWDYN 'INFO DD(SUBMITST)'
12+
If RESULT = 0 Then Trace ?R
13+
Arg SubmitJCL WaitLoops LoopSeconds;
14+
15+
/* Set the value for Phase that indicates job is done */
16+
FinalExpectedPhase = "AWAITING OUTPUT"
17+
18+
/*----------------------------------------------------------*/
19+
/* Get my jobname.... Cannot wait for myself */
20+
/* Ensure the job we submit does not have the same jobname */
21+
/* as my own. */
22+
/*----------------------------------------------------------*/
23+
myJobName = MVSVAR('SYMDEF',JOBNAME ) /*Returns JOBNAME */
24+
25+
/* Submit the JCL named in the parameter */
26+
Call Submit_n_save_jobInfo;
27+
If SelectJobName = myJobName then,
28+
Do
29+
Say 'The job to be monitored is mine. Invalid request'
30+
Exit(8)
31+
End;
32+
33+
/* Wait for the submitted job to finish */
34+
jobnum = SelectJobNumber
35+
jobid = SelectJobName
36+
ownerid = USERID()
37+
retcode. = ' '
38+
daten. = ' '
39+
Timen.= ' '
40+
PhaseName. = ' '
41+
Call Monitor_Job_Status;
42+
43+
exit
44+
45+
Submit_n_save_jobInfo: /* submit SubmitJCL job and save job info */
46+
47+
Address TSO "PROFILE NOINTERCOM" /* turn off msg notific */
48+
CALL MSG "ON"
49+
CALL OUTTRAP "out."
50+
ADDRESS TSO "SUBMIT '"SubmitJCL"'" ;
51+
CALL OUTTRAP "OFF"
52+
JobData = Strip(out.1);
53+
jobinfo = Word(JobData,2) ;
54+
If jobinfo = 'JOB' then,
55+
jobinfo = Word(JobData,3) ;
56+
SelectJobName = Word(Translate(jobinfo,' ',')('),1) ;
57+
SelectJobNumber = Word(Translate(jobinfo,' ',')('),2) ;
58+
59+
Return;
60+
61+
Monitor_Job_Status:
62+
63+
IsfRC = isfcalls( "ON" )
64+
if IsfRC <> 0 then Exit(8)
65+
66+
myMessage = ' ';
67+
isfprefix = SelectJobname
68+
isfowner = USERID()
69+
isfcols = "jname jobid ownerid queue jclass prtdest retcode",
70+
" daten TIMEN PHASENAME "
71+
72+
seconds = LoopSeconds /* Number of Seconds to wait if needed */
73+
74+
/*********************************************/
75+
/* Wait until the submitted job is completed */
76+
/*********************************************/
77+
Do loop# = 1 to WaitLoops
78+
/* call exec_sdsf "0 ISFEXEC ST" opts_sdsf */
79+
Address SDSF "isfexec ST (VERBOSE ALTERNATE DELAYED)"
80+
81+
if RC <> 0 then,
82+
Do
83+
say "RC" RC "returned from ISFEXEC ST" ;
84+
Exit(12);
85+
end;
86+
87+
Sa= 'isfcols=' isfcols
88+
StRows = isfrows
89+
If StRows = 0 then,
90+
Do
91+
say "No rows returned from ISFEXEC"
92+
Call WaitAwhile
93+
Iterate ;
94+
end;
95+
96+
SubmittedJobPhase = 'Submitted'
97+
Call EvaluateSubmittedJob
98+
If SubmittedJobPhase = FinalExpectedPhase then Leave;
99+
100+
Call WaitAwhile
101+
102+
End; /* Do loop# = 1 to WaitLoops */
103+
104+
If SubmittedJobPhase /= FinalExpectedPhase then,
105+
Do
106+
Say 'Job' SelectJobname SelectJobNumber,
107+
' not completed within Wait arguments',
108+
WaitLoops LoopSeconds
109+
exit(8)
110+
End
111+
112+
Say 'Job' SelectJobname SelectJobNumber 'is completed',
113+
' at ' DATE(S) TIME()
114+
115+
Return;
116+
117+
EvaluateSubmittedJob:
118+
119+
Do row# = 1 to StRows
120+
Sa= 'Finding' jname.row# jobid.row# ownerid.row#,
121+
jclass.row# PhaseName.row# Timen.row#
122+
if jobid.row# /= SelectJobNumber then iterate;
123+
124+
SubmittedJobPhase = PhaseName.row#
125+
Sa= 'Status:' SelectJobname SelectJobNumber ,
126+
'retcode.row#=' retcode.row# SubmittedJobPhase ,
127+
' on ' row# 'wait loop'
128+
Leave;
129+
End; /*Do row# = 1 to StRows */
130+
131+
Return;
132+
133+
WaitAwhile:
134+
/* */
135+
/* A resource is unavailable. Wait awhile and try */
136+
/* accessing the resource again. */
137+
/* */
138+
/* The length of the wait is designated in the parameter */
139+
/* value which specifies a number of seconds. */
140+
/* A parameter value of '000003' causes a wait for 3 seconds. */
141+
/* */
142+
/*seconds = Abs(seconds) */
143+
/*seconds = Trunc(seconds,0) */
144+
Say "Waiting for" seconds "seconds at " DATE(S) TIME()
145+
/* AOPBATCH and BPXWDYN are IBM programs */
146+
CALL BPXWDYN "ALLOC DD(STDOUT) DUMMY SHR REUSE"
147+
CALL BPXWDYN "ALLOC DD(STDERR) DUMMY SHR REUSE"
148+
CALL BPXWDYN "ALLOC DD(STDIN) DUMMY SHR REUSE"
149+
150+
/* AOPBATCH and BPXWDYN are IBM programs */
151+
parm = "sleep "seconds
152+
Address LINKMVS "AOPBATCH parm"
153+
154+
Return
155+

endevor/Automated-Test-Facility-for-Batch-Applications/README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,37 @@ These samples are provided as is and are not officially supported (see [license]
55

66
This procedure allows Endevor processors to automate the tailoring, submission and evaluation of Batch application tests. Tests are triggered automatically by the Move or Generate actions of elements of any element type. For example, you may initiate automated tests when a COBOL program is Moved or Generated at a certain stage of Endevor. The test will locate, tailor, submit and evaluate results for one or more JCL elements whose names appear in the "OPTIONS" content of the COBOL program.
77

8+
## Features and Choices
9+
The collection of items in this folder provides for automating Tests of your Endevor inventory.
10+
11+
- **Generate and/or Move actions** on an element of any type can be accompanied by the automated submission of a batch test of that element. You can choose to test programs, JCL, PROCS, PARMS or other elements that you want to be tested.
12+
13+
- **Simple instructions** you give to your Endevor processors can be written in either of two simple formats:
14+
1) OPTIONS format - like the syntax given to CONPARMX steps
15+
2) YAML - a popular, modern data serialization language that is widely used for writing configuration files. It is designed to be human-readable.
16+
17+
You can establish unique tests on an element for selected Stages in Endevor, and have the submitted test automatically adjust lines of JCL for the Stage name where the element is found. STEPLIB concatenations, for example, can be automatically adjusted in a TEST stage, and different than the adjustment in the QA stage.
18+
19+
You can use broad statements to tailor the JCL or use Step and DDName references to pinpoint where changes are to be made.
20+
21+
- **Test evaluations** may be bypassed entirely, or masked and compared to a test baseline. A failed comparison can then reflect onto the element as a failed Generate or Move action.
22+
23+
## OPTIONS
24+
825
The use of "OPTIONS" is not a new concept to Endevor. Typically, they are objects that provide detailed instructions to the CONPARMX steps of an Endevor processor. To implement this procedure, it is not necessary that you be familiar with the use of OPTIONS or with the CONPARMX utility. Example OPTIONS and processors are provided with this procedure. However, if you would like to know more about the use of OPTIONS in an Endevor processor, see [this doc](https://techdocs.broadcom.com/us/en/ca-mainframe-software/devops/ca-endevor-software-change-manager/18-1/administrating/processors/processor-utilities.html#concept.dita_f657792fe5b63ba8cd9304095175664793517854_CONPARMXUtility).
926

27+
## YAML
28+
29+
Data can be constructed into a YAML format, and is easily readable by humans. YAML is a valid choice on the mainframe too - being known mostly to be used in distributed processes.
30+
31+
If you are new to YAML, you can find some introductions here:
32+
33+
- [YAML Site](https://yaml.org/spec/1.2.2/)
34+
- [YAML (YAML Ain't Markup Language)](https://www.techtarget.com/searchitoperations/definition/YAML-YAML-Aint-Markup-Language)
35+
- [What is YAML?](https://www.freecodecamp.org/news/what-is-yaml-the-yml-file-format/)
36+
37+
## Items in this collection
38+
1039
With this procedure, sample processor code is provided in the form of "Includes". Endevor optionally supports either a Panvalet include ("++INCLUDE"), or a Librarian include ("-INC"). If you are not using either, then just copy the sample "Include" code into the processors where you need them. If you are using the Panvalet include, then change the "-INC" references to "++INCLUDE" references (starting in column 8).
1140

1241
Options provide the details for the Automated Test Facility for Batch Applications. Two categories of OPTIONS are a part of this procedure.
@@ -43,4 +72,6 @@ Setup steps for the Automated Test Facility for Batch Applications:
4372
The provided OPTIONS specify the Endevor C1STAGE, where Automated Testing is to occur. You can modify it to meet your needs, including using C1ENVMNT or C1SUBSYS to provide Automated Testing for Deploy to Test actions.
4473

4574

46-
Note: Members **OPTVALDT**, **TXTRPLCE**, **JCLRPLCE** and **YAML2REX** are REXX subroutines required for the **Automated Test Facility for Batch Applications**. They are used by more than one solution on this GitHub, but can be found under the **Field-Developed-Programs** folder in the **Processor-Tools-and-Processor-Snippets** subfolder.
75+
Note: Members **[OPTVALDT](https://github.com/BroadcomMFD/broadcom-product-scripts/blob/main/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/OPTVALDT.rex)**, **[TXTRPLCE](https://github.com/BroadcomMFD/broadcom-product-scripts/blob/main/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/TXTRPLCE.rex)**, **[JCLRPLCE](https://github.com/BroadcomMFD/broadcom-product-scripts/blob/main/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/JCLRPLCE.rex)** and **[YAML2REX](https://github.com/BroadcomMFD/broadcom-product-scripts/blob/main/endevor/Field-Developed-Programs/Processor-Tools-and-Processor-Snippets/YAML2REX.rex)** are REXX subroutines required for the **Automated Test Facility for Batch Applications**. They are used by more than one solution on this GitHub, but can be found by clicking their names, as shown above, or by navigating to the **Field-Developed-Programs** folder and the **Processor-Tools-and-Processor-Snippets** subfolder.
76+
77+
You may use a moveout file to collect all members related to the **Automated Test Facility for Batch Applications**.

0 commit comments

Comments
 (0)