View previous topic :: View next topic
|
Author |
Message |
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
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 |
|
|
Smita.t2
New User
Joined: 17 Apr 2012 Posts: 31 Location: Bangalore
|
|
|
|
How is current date fetched? Is your job running already in production? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
(Guess)
Maybe related to Daylight savings thing? |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
|