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

End the job into error / abend state


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

New User


Joined: 13 Jul 2018
Posts: 8
Location: Nederlands

PostPosted: Wed Sep 11, 2019 6:37 pm
Reply with quote

Hi Team,

I need a help for, one of my job i need to make it into error / abend state if its waiting for more than 15 mint in scheduler.

Code:

//SDADCFP2  JOB AD000000,MSGCLASS=2,COND=(8,LE)     
//*OPCEXIT                                         
//*ROUTING                                         
/*JOBPARM PROCLIB=PROC66                           
//**                                               
//STEP01  EXEC ZJ073,                               
//             DSN='AD#S@.CTNTRA.###.SORTCDB.ERROR'
//STEP02  EXEC ADCFP2                               


this is the data in the job and its a 2nd job in the batch.

Code:

                                           
Operation  Text                                     Jobname 
ws   no. t                             
CGEN 004 Checks for Error file___         SDADCFP2
CMFX 005 MQ-FTE JOB FOR DELIVERY_  SDADF#P2



As per my understand TIME parameter we can use only when if its executing phase.

can any one please help ?

thanks in advance.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 870
Location: The Universe

PostPosted: Wed Sep 11, 2019 7:14 pm
Reply with quote

If I understand what you are asking, you want to determine the time from when the job was submitted to the current time. This can be done, though it is not trivial. You need to traverse some control blocks to get the submission date & time. I have the notes, but I can't access them at the moment. Another problem is you have to compute current date & time minus submission date & time which can be moderately difficult if the dates are different. I think there is an example of this computation over in the beginner's forum from several years ago and I'm too lazy to find it now. It was intended for SMF data and potentially has problems if the difference is in months, but this is not an issue you are likely to face.

However, I'm not so certain that what I think you want is something that is useful, but ...
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2573
Location: NYC,USA

PostPosted: Wed Sep 11, 2019 7:42 pm
Reply with quote

This may be what you need. If not then suggest you to see Scheduling documentation that your site has to know possible options within scheduler.
Scheduling Tips: Querying the Status of Work in Progress via LISTSTAT in BATCH
Quote:
As per my understand TIME parameter we can use only when if its executing phase.
Yes.TIME parameter
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 197
Location: UK

PostPosted: Wed Sep 25, 2019 4:29 am
Reply with quote

Not an easy answer to this one. If I understand it correctly, you want the job to go in to error status in TWS if it's been waiting for more than 15 minutes? What it's waiting for is not clear, but perhaps not relevant. Essentially you cannot do that as far as I'm aware, but there are perhaps other ways to accomplish something similar.

Assuming you can identify the start of the 15 minute interval then the easiest way would probably be to run a job on a "wait" work-station for 15 minutes, then run a TWS batch script to check the status of the job you're interested in. If it's still waiting, this new job could go in to error, or even just set the waiting one to error state.

Other options that spring to mind are to use the deadline WTO function to issue an alert to the console/your automation package if it has not started within the allowable time frame, or if you have the TWSemon product from APS you can set up an alert in there.
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 Secondary index error while loading d... IMS DB/DC 2
No new posts Error 0C1 Reason Code 1 with branch i... PL/I & Assembler 3
No new posts Getting error while xped JCL & VSAM 10
No new posts ABEND=04E FOR REASON=00E50013 DB2 4
No new posts can someone please help me in finding... IBM Tools 9
Search our Forums:

Back to Top