IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL/REXX code to find whether a batch job run or not


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Anbutheone

New User


Joined: 08 Oct 2008
Posts: 15
Location: Bangalore

PostPosted: Thu Nov 13, 2008 3:32 pm
Reply with quote

In our application, batch jobs are running.

Is there a jcl or rexx code to find out whether the job is run or not on a particular day?

PS: The output is copied into CA7-view(SAR). We have to update a file which contains the list of job names, as run or not.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Nov 13, 2008 5:57 pm
Reply with quote

Anbu,

Quote:
s there a jcl or rexx code to find out whether the job is run or not on a particular day?


what kind of job is that? Is it creating any output files? If yes, you can check the availability of those datasets to confirm whether the job has run.


Else if the job name is unique, u can write a REXX to submit SDSF in batch to access the spool and the contents of the DD. You can check for today's date and all.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Nov 13, 2008 6:11 pm
Reply with quote

Can you check the scheduler to see if the job ran?

As a last-ditch effort, you could hit the SMF records to find out if the job ran.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Nov 17, 2008 3:07 pm
Reply with quote

Not sure this is the efficient way, but this works icon_smile.gif

Find out in which mainframe image the SAR database resides and access it via batch.
With the SAR details determine if the job has run using REXX.

Quote:
As a last-ditch effort, you could hit the SMF records to find out if the job ran.

Digging SMF records will also be equally interesting.

U can access the individual SAR reports in batch via GEN and SEQ parameter.
Or u can also access them like a GDG, through relative reference. -1,-2,-3 like that.


In our shop we use the below JCL to extract SAR details.
The program SARBCH might be different in your shop.


Code:
//UNLOAD   EXEC PGM=SARBCH,PARM='SAR.SARI01'                 
//SYSPRINT DD SYSOUT=*,DCB=BLKSIZE=133                       
//REPORT   DD SYSOUT=*,DCB=BLKSIZE=133                       
//SARLOAD  DD DSN=XK89.BORED.PROGRAMR,DISP=OLD                   
//SYSIN    DD *                                             
/LOAD ID=DLEN-AU20                                           
/*       
Back to top
View user's profile Send private message
Simon Jia

New User


Joined: 21 Nov 2008
Posts: 5
Location: China

PostPosted: Fri Nov 21, 2008 9:41 am
Reply with quote

You need to address sdsf command from rexx program.
If you are not familiar with addressing sdsf in rexx program, you should try this one:
Online education for sdsf rexx execution

I completed this using less than 20 minutes and I created my own rexx program invoking sdsf.
Basically you should use the jobname/jobid as a key, then get an array with the job info, iterate the items in the array to find which one is the correct job, then output the job messages, then evaluate the messages to see if it contains some keywords like "HASP ENDED" etc.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top