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

CA7 set up to make sure job always runs before midnight


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Mon May 28, 2012 3:21 pm
Reply with quote

hi,
i have a job which runs at around 8PM. problem here is there is a current date getting step. and based on current date am extracting some data.
so i should make sure your JOB always runs before midnight(because if it runs after midnit the date will change and it will extract next days data which is wrong).is there any way we can find out whether the job runs after or before midnit?

is there any CA7 SET UP? or any jcl step from which we can determine?

regds,
useit
Back to top
View user's profile Send private message
Smita.t2

New User


Joined: 17 Apr 2012
Posts: 31
Location: Bangalore

PostPosted: Mon May 28, 2012 4:55 pm
Reply with quote

How is current date fetched? Is your job running already in production?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon May 28, 2012 4:57 pm
Reply with quote

I'm confused - what kind of solution are you looking for? Are you, by any chance, talking about Time Triggered Jobs in CA7?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon May 28, 2012 5:44 pm
Reply with quote

Why don't you use a Business Date/Data Date, instead of current date, then you don't have to worry about Midnight, or re-runs.
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Mon May 28, 2012 5:45 pm
Reply with quote

hi,
its an existing job .inside there is a step to extract all the current days data . (current date is fetched using (DATE1).it usuall runs between 8-8.30 .

say if todays job got abended for some reason and we restarted it after 12.
the date1 wil be tomorrows date whic is actually incorrect. i want to empty out the extracted file in case if todays job runs after 12.

is there any way which we can find out and empty out the file in case if job runs after 12?? either through jcl step or ca7 set up?

regds,
useit
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon May 28, 2012 5:53 pm
Reply with quote

Have a job - possibl;y your job - have a step that gets the date and stores it. The step that needs it can then read it either right there and then or after a restart. This assumes that you have restart control. If not, then make the date-getting step a prior job.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon May 28, 2012 6:06 pm
Reply with quote

Quote:
say if todays job got abended for some reason and we restarted it after 12.
the date1 wil be tomorrows date whic is actually incorrect. i want to empty out the extracted file in case if todays job runs after 12.
One possible solution is that, which probaly must be in use already, in RESTART instruction you mention about the specific use of date.

2nd, possibly, you can make use of EZACFSM1 and use the information from it in your favor:
Code:
//SYMBOLS EXEC PGM=EZACFSM1   
//SYSOUT    DD  SYSOUT=*       
//SYSIN     DD  *             
CCYY/MM/DD '&YR4./&LMON./&LDAY'
HH:MM:SS   '&HR.:&MIN.:&SEC'   
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 29, 2012 12:20 am
Reply with quote

Hello,

Another possibility is to have the code check the time and if the time is between midnight and some time (i.e. 9am) calculate the data as yesterday, not today. . .

This would only work as long as the job is always run in the evening.

My preference would be to put the data in a file and use this to control the run.
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Tue May 29, 2012 11:43 am
Reply with quote

anju,

tested the jcl it ran fine. but am getting one hour difference in the time. what is the reason for this?

in JES2 JOB LOG -THE JOB START TIME AND END TIME IS "06.59.58"

BUT MY OUTPUT IS AS BELOW

Code:
********************************* TOP OF DATA **********************************
CCYY/MM/DD '2012/05/29' HH:MM:SS   '05:59:58'                                   
******************************** BOTTOM OF DATA ********************************


Is there any specific reason for this?

Regds,
useit
Back to top
View user's profile Send private message
vasanthz

Global Moderator


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

PostPosted: Tue May 29, 2012 11:50 am
Reply with quote

(Guess)
Maybe related to Daylight savings thing?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


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

PostPosted: Tue May 29, 2012 12:12 pm
Reply with quote

I think the job produces UTC time and your system time is UK time.
UK time is 1 hour ahead of UTC time, So this maybe the difference?

Difference between GMT and BST.
publib.boulder.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.halz002%2Fhead6.htm
this link says that the job produces UTC times
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue May 29, 2012 12:18 pm
Reply with quote

No that's not related to Day-Light savings.

When "&HR" is used with EZACFSM1, symbol translator utility, hour of the day is calculated based on UTC. And it'll be shown in two decimal digits, 00-23. Same is applicable to minutes and seconds part of the time.

Use the below symbols for the local time:
Code:
//SYMBOLS EXEC PGM=EZACFSM1   
//SYSOUT    DD  SYSOUT=*       
//SYSIN     DD  *             
CCYY/MM/DD '&YR4./&LMON./&LDAY'
HH:MM:SS   '&LHR.:&LMIN.:&LSEC'
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts trying to make sense of keylists TSO/ISPF 11
No new posts Make cobol variable value a variable COBOL Programming 3
No new posts DB2 Query runs very long DB2 21
No new posts Single COPY CICS TS datasets and when... CICS 2
No new posts DFSORT VB File make 2 lines from 1 DFSORT/ICETOOL 2
Search our Forums:

Back to Top