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

To get last and present jcl run date and time


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

New User


Joined: 19 Jun 2009
Posts: 4
Location: Bangalore

PostPosted: Fri Jun 19, 2009 3:15 pm
Reply with quote

Hi,
Currently, I have a requirement where in I need to capture the current date and time of the job run and last job run date and time and compute the difference in between the two runs to compare it with a field value.

Is there a way of capturing last job run date and time as well as present job run date and time??

Kindly let me know.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jun 19, 2009 3:22 pm
Reply with quote

Unfortunately your requirement is not quite clear.

Please elaborate on the requirement, and also some insight into the need for this may help us offer a solution.
Back to top
View user's profile Send private message
madhushreehp

New User


Joined: 19 Jun 2009
Posts: 4
Location: Bangalore

PostPosted: Fri Jun 19, 2009 3:32 pm
Reply with quote

I can better explain you with an example.
Say for example I have a job JCL1 that runs many times a day. Suppose JCL1 runs 2 times today.i.e; 19/06/2009 on 8 AM in the morning and
it is running now.
Then, I need to get the current date and time of run..say 19/06/2009 and 3:40 PM.
And, also the last job run date and time..that is 19/06/2009 and 8.00 AM.

Is there a way of getting these details thru jcl?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 19, 2009 3:35 pm
Reply with quote

I would suggest establishing some kind of central control file;
would contain a minimum of two fields (vsam)/ columns (db2).

each time the job is run
  1. 'move current-run-date field/column to last-run-date field/column
  2. populate the current-run-date field/column
  3. compare
.

if you are expecting to scroll thru SMF data or something to determine the last run date---you are being unrealistic.

a scheduler may be able to provide a last run date for a job.

and a last question---why do you have to do this?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jun 19, 2009 3:36 pm
Reply with quote

What I was really after was the need to know when the last execution was.
Back to top
View user's profile Send private message
madhushreehp

New User


Joined: 19 Jun 2009
Posts: 4
Location: Bangalore

PostPosted: Fri Jun 19, 2009 3:46 pm
Reply with quote

Actually, there is a front-end java application for which I am doing the batch processing.
There are different screen which has diff fields. when the user enters value on the screen, they will be stored in the DB2 tables.In one such screen, there is a field value min duration between the 2 runs ( the value of which will be entered by the user and it is stored in the DB2 table).
To validate this field, i need to get the jcl last run date and time and the jcl current run date and time.Compare those two and if this is less than the value present in the table for this field min duration between the 2 runs, I have to cancel the present run..else continue with the process.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 19, 2009 4:23 pm
Reply with quote

sounds as if that db2 table which contains "min duration between the 2 runs"
should also contain "last-run-date-time", which would be populated by the batch job.
Back to top
View user's profile Send private message
madhushreehp

New User


Joined: 19 Jun 2009
Posts: 4
Location: Bangalore

PostPosted: Fri Jun 19, 2009 4:40 pm
Reply with quote

Okay...Thanks!! This solves my problem:)
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top