Reputation: 11
TLDR: Need to update JCL members in a PDS by adding a /*XEQ card to each one there.
We are moving away from one large IT application compamy, switching out a number of our regularly used IT apps, for others, mostly IBM. One of those apps is CA Scheduler. Along with installing IBM Workload Scheduler, it was decided to also switch the LPAR it's installed on to another High Availability LPAR. Currently, CA Scheduler is installed on our main LPAR, plus another LPAR that's paired with, which has been our main LPAR for decades. When Scheduler would submit a job, it started on the CPU that was the main one and where we wanted to run. So, a vast majority of our jobs have never had to use an /*XEQ card to direct it there; it was already starting there. Now, with IWS moving to the HA LPAR, those jobs need an /*XEQ to send them to the main LPAR, else the the submitted jobs would try to run on the HA LPAR.
Another of the apps being replaced is Endevor. All of our programs, jobs, procs, etc are stored with it. We need to change all of the jobs in it that have had it's output element JCL moved to the scheduler JCL library. The Scheduler team lead has read that scheduler JCL library and noted all of the jobs in it. Turning a list over to a team, they came back and said that the Endevor team should come up with a script of some kind the update the entire libraru so that each team does not have to make a large amount of changes. Well... I'm the lead on the Endevor team that that means me doing it.
I figured I could change each JCL member in the Endevor JCL output library, inserting a line and adding the /*XEQ to each of them, then use the updated libary to apply those changes to the Endevor repository. K now there is a way to create an ISPF macro that can read through all of the PDS members, and then add the line. I just don't know how. I can barely swim through REXX: there is one that I work with to automatically bind a DB2 program during an Endevor generate, so I've learned a few things. I need to know how to 1) know how to read througn a PDS members via REXX and 2) set up and run a macro to add the XEQ line. Can someone please help me with that?
Previously, I came across a small macro a prevous Endevor admin created to update members in a PDS; I'm still trying to find it. Concerning REXX app I mention above, an auto bind, I've learned a bit of REXX by having to update it. It seems that I can use a lot of the code in it. It reads the prod bind library, reads the element member and changes prod values to test ones, then submits. The REXX has a lot of IF statements. looking for certain JCL values and replacing them with test values. I figure that I can use those IF values, checking for job card values, and if they are found, the REXX would read the next line until past the job card. What I need help with is reading through each member in the the PDS.
It's been years since I've worked with ISPF dialog, however it's coming back to me. I've only recently learned REXX in the last few years and there are things that still don't understand, however with guidance, I can hopefully figure it out.
Upvotes: 0
Views: 118
Reputation: 696
Another approach is this:
/* REXX */
arg dsn exec
/* -------------------------- *
| Setup Outtrap and do ListD |
* -------------------------- */
x = outtrap("lm.","*")
"LISTD" "'"dsn"'" "MEMBERS"
x = outtrap("off")
/* ------------------- *
| Process all members |
* ------------------- */
do i = 7 to lm.0
parse value lm.i with mem extra
Address ISPEXEC "EDIT DATASET('"dsn"("mem")') MACRO("exec")"
end
Then for the edit macro:
/* rexx */
Address ISREdit
'macro'
'Find " EXEC " first'
'(line) = cursor'
data = '/* XEQ node'
"Line_before" line "= (data)"
'save'
'end'
Upvotes: 0
Reputation: 416
You can use LM services in ISPF to go through all the members of a PDS and invoke EDIT to run a macro that adds a line and then issues END to save the data. As an example here is a REXX exec that removes sequence numbers from an assembler PDS:
/* rexx */
Address ISPEXEC
PDS = "'HLQ.TEST.ASM'"
mem = ' '
rcc = 0
"LMINIT DATAID(did) DATASET("pds")"
"LMOPEN DATAID("did") OPTION(INPUT)"
do while rcc = 0
"LMMLIST Dataid("did") OPTION(LIST) MEMBER(MEM) STATS(YES)"
rcc = rc
if rcc = 0 then
"EDIT DATAID("did") MEMBER("mem") MACRO(EMUNNUM)"
end
"LMCLOSE DATAID("did")"
"LMFREE DATAID("did")"
exit
IN the above EDIT is invoked with a macro that issues an UNNUM command. You would just need to code the Edit macro to add the desired line(s) and END to exit and save the member. Below is the macro that does the unnum.
/* REXX EMUNNUM*/
ADDRESS ISREDIT
"MACRO "
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
"UNNUM"
RCC = RC
IF RCC = 0 THEN
"END"
ELSE
IF RCC = 12 THEN
"CANCEL"
ELSE
DO
SAY "BAD RC OF" RCC
END
This should give you a good starting point. You can reference https://www.ibm.com/docs/en/zos/2.5.0?topic=ispf-zos-edit-edit-macros for all the available Edit macro commands.
Upvotes: 1