Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for Rexx Solution to Externalize Job Step Return Codes 1

Status
Not open for further replies.

IDC3044

Technical User
Apr 17, 2003
12
US
We recently obtained pagers that allow staff to be
e-mailed text messages. I use this technology coupled with z/OS mainframes in our Batch Environment. Important Batch Jobs include steps that page software technicians when certain return codes are encountered. I would like to include other information within the e-mail including the return code(s) of the Job and/or each Job Step.

Has anyone succeeded in using Rexx to do someting like this?

Any ideas on how to accomplish this will be appreciated.
 
You could have different return codes for different conditions, which trigger different emails.

eg. You have two different conditions within a program. One is a 'must-be-looked-at-immediately' and the other is 'leave-til-morning'. You want both to send an email.

Within the program, set the return code to 2 for the 1st condition and 3 for the 2nd.

Within the JCL, set an IF statement that checks the return code of the program step and executes to different steps for return code 2 and return code 3. Those steps can then send a different email with hardcoded text as required.
 
I have the JCL mechanics Marc mentions already in place. I was hoping to include the actual Return Code with the message. I use IF/THEN syntax to check RC < 5 and send thumbs up message ELSE send an alert message. I also include a step with COND=ONLY to send an alert message in cases where abends cause the IF/THEN/ELSE steps to FLUSH.
 
This one I call GETRC. I cannot take credit for the content:

/* REXX */
/* GET THE STEP NAME AND RETURN CODE */
NUMERIC DIGITS(32) /* ENSURE MAX PRECISION */
TCB=STORAGE(D2X(540),4) /* PSATOLD IN PSA */
JSCB =STORAGE(D2X(C2D(TCB)+180),4) /* TCBJSCB IN TCB */
JCT = STORAGE(D2X(C2D(JSCB)+261),3) /* JSCBJCTA IN JSCB */
THIS_STEP_NO = X2D(C2X(STORAGE(D2X(C2D(JSCB)+228),1)))
/* THIS STEP NO. */
FSCT = STORAGE(D2X(C2D(JCT)+48),3) /* JCTSDKAD IN JCT */
/* IS FIRST SCT */
TEMP_SCT = FSCT
DO I = 1 TO (THIS_STEP_NO - 1)
STEP = STORAGE(D2X(C2D(TEMP_SCT)+68),8)
RCSTEP = X2D(C2X(STORAGE(D2X(C2D(TEMP_SCT)+24),2)))
/* SCTSEXEC IN SCT */
BYPASS = STORAGE(D2X(C2D(TEMP_SCT)+188),1)
IF X2D(C2X(BYPASS)) = 80 THEN /* CHECK IF STEP WAS NOT EXECUTED */
DO
RCSTEP = 'FLUSHED '
END
SAY 'STEP ==>' STEP ' RC ==>' RCSTEP
TEMP_SCT = STORAGE(D2X(C2D(TEMP_SCT)+36),3)
END
EXIT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top