Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Monitoring jobs in SDSF using Rexx

585 views
Skip to first unread message

Mohan, Jayaraj , Cognizant

unread,
Mar 20, 2003, 3:02:03 AM3/20/03
to

Hi,

Is there a way to monitor a job submitted in SDSF through Rexx.

My requirement is this:
I want to execute a flow of jobs, one after another (and only if previous job gives a returncode of Zero) and to generate an automated mail with the output file name. Mail generation part is quite simple. But monitoring job is confusing.

What i need is
(1) to know through Rexx, when a job is over in SDSF.
(2) to validate if the return code of that job is zero.

Thanks in advance

Jayaraj

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

InterScan_Disclaimer.txt

Prasanna Kannan , Tidel Park - Chennai

unread,
Mar 20, 2003, 8:09:54 AM3/20/03
to
mohan,

the same requirement has been raised in the list by one of ur cognizant
guys..
it is not possible,.....i think you want some utility which will work like
job scheduler..

Regards,
Prasanna K

Nigel Barrable

unread,
Mar 20, 2003, 8:30:21 AM3/20/03
to
You can add a RC check step after each step in your
executing jobs to update a dataset with all the
relevant data -- and then your REXX script can easily
monitor that dataset.

Schwarzbauer, Joe

unread,
Mar 20, 2003, 10:30:05 AM3/20/03
to
Others have pointed out that running the jobs really wants a
job scheduler, but if all you need is an email when the
last job is done, run the email sending step right in the
batch job itself.

If you use a TSO-REXX exec to send the email, include a
step that runs PGM=IKJEFTIB. I use Lionel B. Dyck's excellent
XMITIP REXX package for sending automated email from batch jobs
using jcl like that below. Inline datasets here are normally
in cataloged datasets for production. They are inline here
for clarity...
I set this up as two steps. One to notify a list of users of
successful completion of one job (or the last of a sequence)
and the other to notify a troubleshooter team of failure.
This code uses high RC or a jobstep abend to determine failure.
You could also rely on your job scheduler package to notify
you on abends.

//* ONLY SEND THIS EMAIL IF MAX RC = 0
// IF (RC = 0 AND ABEND = FALSE) THEN
//* **************************************************************
//* * STEP EMAIL SEND E-MAIL TO NOTIFY SUCCESSFUL COMPLETION *
//* **************************************************************
//EMAIL EXEC PGM=IKJEFT1B
//ADDRESS DD DATA
TO "Mohan, Jayaraj (Cognizant)" <MJay...@CHN.COGNIZANT.COM>
/*
//MESSAGE DD DATA
This is a sample email message.
If this had been an actual email message it would have
contained actual information and you would now know something
that you didn't know before you read it.
/*
//SIGNED DD DATA

This is an automated email message. Please do not reply to it.
/*
//SYSEXEC DD DSN=HLQ.YOUR.EXECLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DATA
%XMITIP *CompletionNotificationList* -
ADDRESSFILEDD ADDRESS -
MSGDD MESSAGE -
SIGDD SIGNED -
FROM "jobname" <real...@yourdomain.com> -
SUBJECT "JOB &JOB - has completed successfully"
FILE 'HLQ.LOGFILE.LIST'
/*
//* FILE 'HLQ.LOGFILE.LIST' IS ACCUMULATED ALONG THE WAY
//* AND MIGHT BE SENT FOR COMPLETION, OR JUST FOR
//* PROBLEM DETERMINATION, YOUR CHOICE
//*
// ELSE
//* ******* THIS EMAIL IS FOR FAILURE.
//* **************************************************************
//* * STEP EMAIL SEND E-MAIL TO NOTIFY UNSUCCESSFUL COMPLETION *
//* **************************************************************
//FAILMAIL EXEC PGM=IKJEFT1B
//* THIS COULD BE THE SAME ADDRESS LIST AS FOR COMPLETION
//* OR IT COULD BE AN ADDRESS FOR A TROUBLESHOOTER
//ADDRESS DD DATA
TO "Mohan, Jayaraj (Cognizant)" <MJay...@CHN.COGNIZANT.COM>
/*
//MESSAGE DD DATA
This is a sample email message.
If this had been an actual email message it would have
contained actual information and you would now know something
that you didn't know before you read it.
/*
//SIGNED DD DATA

This is an automated email message. Please do not reply to it.
/*
//SYSEXEC DD DSN=HLQ.YOUR.EXECLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DATA
%XMITIP *PROBLEMNotificationList* -
ADDRESSFILEDD ADDRESS -
MSGDD MESSAGE -
SIGDD SIGNED -
FROM "jobname" <real...@yourdomain.com> -
SUBJECT "JOB &JOB - has a problem. Please fix and resubmit"

FILE 'HLQ.LOGFILE.LIST'
/*
//*
// ENDIF-----Original Message-----


From: Mohan, Jayaraj (Cognizant) [mailto:MJay...@CHN.COGNIZANT.COM]

Sent: Thursday, March 20, 2003 1:48 AM


To: TSO-...@VM.MARIST.EDU
Subject: Monitoring jobs in SDSF using Rexx
Importance: High

Hi,

Is there a way to monitor a job submitted in SDSF through Rexx.

My requirement is this:
I want to execute a flow of jobs, one after another (and only if
previous job gives a returncode of Zero) and to generate an automated mail
with the output file name. Mail generation part is quite simple. But
monitoring job is confusing.

What i need is
(1) to know through Rexx, when a job is over in SDSF.
(2) to validate if the return code of that job is zero.

Thanks in advance

Jayaraj


-----------------------------------------
CONFIDENTIALITY NOTICE: The information contained in this e-mail and attached document(s) may contain confidential information that is intended only for the addressee(s). If you are not the intended recipient, you are hereby advised that any disclosure, copying, distribution or the taking of any action in reliance upon the information is prohibited. If you have received this e-mail in error, please immediately notify the sender and delete it from your system.

Harrington, Mark

unread,
Mar 20, 2003, 1:07:06 PM3/20/03
to
Make the last step of each job submit the next obne. no prob

-----Original Message-----
From: Mohan, Jayaraj (Cognizant) [mailto:MJay...@CHN.COGNIZANT.COM]
Sent: Wednesday, March 19, 2003 11:48 PM
To: TSO-...@VM.MARIST.EDU
Subject: Monitoring jobs in SDSF using Rexx
Importance: High

Hi,

Is there a way to monitor a job submitted in SDSF through Rexx.

My requirement is this:
I want to execute a flow of jobs, one after another (and only if
previous job gives a returncode of Zero) and to generate an automated mail
with the output file name. Mail generation part is quite simple. But
monitoring job is confusing.

What i need is
(1) to know through Rexx, when a job is over in SDSF.
(2) to validate if the return code of that job is zero.

Thanks in advance

Jayaraj

----------------------------------------------------------------------

Sylvanus A. Currie

unread,
Mar 25, 2003, 10:26:48 PM3/25/03
to sylvanu...@british-energy.com

> LIST...@VM.MARIST.EDU with the message: INFO TSO-REXXThis e-mail and any files transmitted with it are for the sole use of the
> intended recipient(s) and may contain confidential and privileged
> information. If you are not the intended recipient, please contact the
> sender by reply e-mail and destroy all copies of the original message. Any
> unauthorised review, use, disclosure, dissemination, forwarding, printing
> or copying of this email or any action taken in reliance on this e-mail is
> strictly prohibited and may be unlawful.
>
> Visit us at http://www.cognizant.com


>
> ---------------------------------------------------------------------- For
> TSO-REXX subscribe / signoff / archive access instructions, send email to
> LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

I will send info from work later.
In mean time check SDSF manuals as SDSF can be run in batch

Mohan, Jayaraj , Cognizant

unread,
Mar 26, 2003, 1:50:41 AM3/26/03
to

Thanks Robert for your detailed mail. This is the same tool i am planning to code. Can you please send me the rexx program you used for sending...

" 1) A startup notification step (usually email) that identifies the target
program, jobname, jobnumber, start time and diagnostic and notification
symbolic values (I tend to use REXX to collect this stuff and send the email) "

Thanks a lot
Jayaraj

-----Original Message-----
From: Robert Zenuk [mailto:Robz...@AOL.COM]
Sent: Tuesday, March 25, 2003 9:59 PM
To: TSO-...@VM.MARIST.EDU
Subject: Re: Monitoring jobs in SDSF using Rexx


Most of the suggestions already provided will work in this situation. This
type of regression testing is a fairly common activity. When I have set up
these testing flows before I try to give myself footprints to see where and
when things went wrong. This can end up being some fairly elaborate job
flows. I have usually bypassed job schedulers for these since I want to have
a greater degree of control over the jobs and may want to just end the whole
mess early if things are going badly. In some shops the batch schedulers get
irritated with development flows with unpredictable results.

I tend to break the jobs up into several "single step" jobs. Each "single
step" job is actually a single step from the original job wrapped in multiple
steps to help control the flow, monitoring, comparisons, notification and
propagation. Some of the "rules" for these jobs are:

1) No temporary datasets unless used entirely within a single step.
2) All dataset cleanup is done by a special manually submitted final job so
all the footprints are available.
3) All jobs use PROCs and all inputs are provided using symbolics
4) All PROC's use some common symbolic names to govern diagnostic reporting
and notifications
5) All PROC's use a common INCLUDE to specify the default diagnostic
reporting and notifications
6) Nested PROC's are used to keep a consistent implementation of comparison
and notification steps
7) JCL IF statements are used extensively to control processing
8) A "SUBMIT" step (a nested PROC) is used to launch the successor job.

Each job will usually contains the following types of steps:

1) A startup notification step (usually email) that identifies the target
program, jobname, jobnumber, start time and diagnostic and notification
symbolic values (I tend to use REXX to collect this stuff and send the email)
2) The step for the actual target program from the original regression test
3) Next a step using an intelligent Compare utility (Batch ISPF SuperC,
Comparex, Fileaid, etc) to compare current results with prior results (if
appropriate for the step/program)
4) Alternatively, a step using an intelligent Search utility (Batch ISPF
Searchfor, Fileaid, REXX, REXX using batch edit macros, etc) to confirm the
existence or absence of key strings or values
5) Based on the RC from the above steps, the decision may be made to email
the output from the target program to someone (another symbolic used in the
INCLUDE/PROC's)
6) Also based on the RC from above, decide whether to submit the next job
7) Send a status email notification that this step has completed and whether
an email with the program output should be expected
8) If it is decided not to submit the next job, send an email stating where
the testing was stopped

As always there is a bazillion ways to do this stuff, this is my two cents.

Hope This Helps,
Robert Zenuk
robz...@aol.com

InterScan_Disclaimer.txt

Robert Zenuk

unread,
Mar 26, 2003, 10:38:08 AM3/26/03
to
The REXX email steps always vary due to message content, but here is a
generic one that you can start tailoring from. If you use the PROC approach,
you can just pass in all the symbolics as parms to this NOTIFY EXEC. The
first value must be the recipient and the remaining values can be the other
things to pass along. Even though there is a 100 character limit to EXEC
card parms, sometimes if the message is short you can format text along with
the symbolics. Since this is a limitation, this is usually the biggest
reason I have special versions of this technique for the many unique
situations.

I can't find it right now, but I did have an SMTP EXEC that would allow you
to create canned text for the message body (special members in a PDS). If
you coded #VAR# strings in the text for supported substitution strings, then
those strings would be substituted. I had things like #JOBNAME#, #JOBNUM#,
#USERID#, #DATE#, #TIME#, #ABCODE#, etc. I suspect it got lost during a job
change. If I find it I'll post it or maybe I'll just recreate it.

/*********************************************************************/

/* REXX */

/*********************************************************************/

/* Purpose: Send an SMTP email to someone after a job failure */

/*-------------------------------------------------------------------*/

/* Syntax: NOTIFY oncall message */

/*-------------------------------------------------------------------*/

/* Parms: oncall - email id of the person to notify */

/* message - any optional text to send in the body */

/* */

/* Notes: */

/* */

/* oncall could be a pager number (i.e. 88844...@skytel.com) */

/* message can be use for the following type messages: */

/* */

/* Call the Data Center at 888-222-3333 immediately */

/* This is a Critical Path batch job, the clock is ticking */

/* */

/* // IF (ABEND | RC > 0) */

/* //NOTIFY EXEC PGM=IKJEFT01,PARM='NOTIFY xxxx...@yyy.com' */

/* //SYSEXEC DD DSN=your.exec.pds,DISP=SHR */

/* //SYSTSPRT DD SYSOUT=* */

/* //SYSTSIN DD DUMMY */

/* // ENDIF */

/* */

/*********************************************************************/

/* Change Log */

/* */

/* Author Date Reason */

/* -------- --------- ----------------------------------------- */

/* R. Zenuk Dec 1999 Initial Creation */

/* */

/*********************************************************************/

/* Get the email address */

/*********************************************************************/

parse arg oncall message

if oncall = '' then exit(20)

if message = '' then message = 'No additional message'

/*********************************************************************/

/* Get the jobnumber */

/*********************************************************************/

tcb = storage(21c,4)

jscb = storage(d2x(c2d(tcb)+180),4)

ssib = storage(d2x(c2d(jscb)+316),4)

jobnum = strip(storage(d2x(c2d(ssib)+15),5),l,0)

/*********************************************************************/

/* Build the email message */

/*********************************************************************/

subject = mvsvar('SYMDEF','JOBNAME') 'J'jobnum 'failed' date() time()

mail.1 = 'HELO' mvsvar('SYSNAME')

mail.2 = 'MAIL FROM:<'mvsvar('SYSNAME')'>'

mail.3 = 'RCPT TO:<'oncall'>'

mail.4 = 'DATA'

mail.5 = 'FROM:<'mvsvar('SYSNAME')'>'

mail.6 = 'Subject:' subject

mail.7 = message

mail.8 = 'QUIT'

"ALLOC F(MAIL) SYSOUT(B) WRITER(SMTP) REU"

EXITRC = RC

if EXITRC <> 0 then say 'ALLOC error on MAIL'

"EXECIO * DISKW MAIL (STEM MAIL. FINIS"

EXITRC = RC

if EXITRC <> 0 then say 'EXECIO error on MAIL'

"FREE F(MAIL)"

/*********************************************************************/

/* Exit */

/*********************************************************************/

exit(EXITRC)

0 new messages