How can I have complete control over the return code of the job step running Co:Z Launcher?
Based on what the script is doing I need to set the job step return code to values like: 0, 1, 4, 8, 16, 100, etc...
I also need to be able to set the status of the job step to USER abend codes, such as U2000.
How can this be done when running Co:Z Launcher?
Thanks,
Scott Bennett
Setting return code of Co:Z Launch job step
I need to have the job step running coz generate the abend code.
Is there a recommended way to execute coz launcher from within a wrapper type program.
For example, could I code something that will preform some pre coz logic such as derive server user name and server name, then execute coz launcher and follow up with post processing logic that could derive the appropriate job step RC/Abend code and if needed abend the job step?
I am open to any language suggestions and code samples.
Thanks,
Scott
Is there a recommended way to execute coz launcher from within a wrapper type program.
For example, could I code something that will preform some pre coz logic such as derive server user name and server name, then execute coz launcher and follow up with post processing logic that could derive the appropriate job step RC/Abend code and if needed abend the job step?
I am open to any language suggestions and code samples.
Thanks,
Scott
Scott,
Sure, it is possible to have a program written in almost any language that would invoke the COZLNCH load module and then execute it and get the return code back and then do something. But wouldn't a conditional step (COND= or IF..) in the JCL that invokes an ABEND program accomplish the same thing?
Sure, it is possible to have a program written in almost any language that would invoke the COZLNCH load module and then execute it and get the return code back and then do something. But wouldn't a conditional step (COND= or IF..) in the JCL that invokes an ABEND program accomplish the same thing?
Yes, having COND|IF will accomplish almost the same thing. I need to incorporate the use of coz into existing jobs with existing schedules. Because the jobs are existing I also must ensure the job step RC processing is not affected, current STEP1 of the job is monitored by scheduling for a specific RC or ABEND code and after replacing STEP1 with coz, STEP1 must still be the step with the specific RC or ABEND code.
To ensure the current JCL around the step being replaced by coz executes as expected and the schedule monitors also continue to work as expected I would like to have a single job step replacement with the coz launcher and all my pre/post coz logic exist within the same single job step.
To ensure the current JCL around the step being replaced by coz executes as expected and the schedule monitors also continue to work as expected I would like to have a single job step replacement with the coz launcher and all my pre/post coz logic exist within the same single job step.
I see.
One way might be to invoke a REXX EXEC from a batch TSO jobstep (adding the DDs that you need for batch TSO, and leaving the rest that COZLNCH uses), and then have the REXX exec us "ADDRESS LINKMVS" to invoke COZLNCH.
The problem with this is that IKJEFT1A will trap user abends and abend with completion code 04C. None of the various batch TSO programs (IKJEFTxx) seem to allow you to abend with your own code. Does it matter to your scheduler which abend code you get?
One way might be to invoke a REXX EXEC from a batch TSO jobstep (adding the DDs that you need for batch TSO, and leaving the rest that COZLNCH uses), and then have the REXX exec us "ADDRESS LINKMVS" to invoke COZLNCH.
The problem with this is that IKJEFT1A will trap user abends and abend with completion code 04C. None of the various batch TSO programs (IKJEFTxx) seem to allow you to abend with your own code. Does it matter to your scheduler which abend code you get?
I like the possibility of using the REXX approach.
The specific value of the ABEND code is important to our processes, if needed we could code up an assembler module to generate the approporate abend code. And call the assembler module when needed.
Do you happen to have examples of calling coz from rexx using ADDRESS LINKMVS?
The specific value of the ABEND code is important to our processes, if needed we could code up an assembler module to generate the approporate abend code. And call the assembler module when needed.
Do you happen to have examples of calling coz from rexx using ADDRESS LINKMVS?
Unfortunately, IRXJCL won't work either. I was able to invoke COZLNCH from REXX just fine, but then when I called a utility program from REXX that did an ABEND, I just get:
IRX0251E User abend code 4093, reason code 00000144.
IRX0255E Abend in host command COZABEND or address environment routine LINKMVS
And then it sets the REXX RC to 4093.
So, it seems to me that an Assembler, C, or COBOL program will be required.
IRX0251E User abend code 4093, reason code 00000144.
IRX0255E Abend in host command COZABEND or address environment routine LINKMVS
And then it sets the REXX RC to 4093.
So, it seems to me that an Assembler, C, or COBOL program will be required.
Here's an example Assembler routine that you can use as a front-end to COZLNCH which will issue an ABEND if the return code is > 0.
You should be able to tweak to issue the ABENDs that you want, assemble and link with RENT,AMODE=31 and put into the STEPLIB (or COZ.LOADLIB) and change COZPROC to use PGM=CALLCOZ.
You should be able to tweak to issue the ABENDs that you want, assemble and link with RENT,AMODE=31 and put into the STEPLIB (or COZ.LOADLIB) and change COZPROC to use PGM=CALLCOZ.
Code: Select all
CALLCOZ TITLE 'Front End to COZLNCH'
SYSSTATE ARCHLVL=2
CALLCOZ RSECT
CALLCOZ AMODE 31
CALLCOZ RMODE ANY
J BEGIN
DC AL1(27)
DC CL9'CALLCOZ'
DC CL9'&SYSDATE'
DC CL9'&SYSTIME'
BEGIN DS 0H
BAKR R14,0
LR R12,R15
USING CALLCOZ,R12
LR R5,R1 Save our parmlist
USING WORKAREA,R13
STORAGE OBTAIN,LENGTH=WORKLEN
LR R13,R1
XC WORKAREA(WORKLEN),WORKAREA
*
LR R1,R5 Restore original parmlist
LINK EP=COZLNCH
LR R5,R15 Save return code
*
STORAGE RELEASE,ADDR=(R13),LENGTH=WORKLEN
LTR R5,R5 Check return code
BE EXIT
*
WTO 'CALLCOZ - ISSUING ABEND due to RC>0',ROUTCDE=11,DESC=6
ABEND 1024,REASON=12 U1024/R12
*
EXIT DS 0H
LR R15,R5
PR
LTORG ,
WORKAREA DSECT
SAVEAREA DS 18F
WORKLEN EQU *-WORKAREA
YREGS ,
END