View previous topic :: View next topic
|
Author |
Message |
jai_jain Warnings : 2 New User
Joined: 17 Apr 2007 Posts: 7 Location: new delhi
|
|
|
|
how its possible o run a job at last day of month??? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Automatically? Use your scheduler......
Manually? Use your calendar....... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Aaaaaaaaaaah, but the OP hasn't differentiated between a calendar day or a working day .... |
|
Back to top |
|
|
skkp2006
New User
Joined: 14 Jul 2006 Posts: 93 Location: Chennai,India
|
|
|
|
All i can think is like pass the current date from the JCL to the program and check the date with the following SQL.... if the dates match run the program
Code: |
SELECT LAST_DAY(CURRENT DATE) FROM SYSIBM.SYSDUMMY1; |
Regards,
Syam |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Before there can be an implementation, the observation from Expat must be considered.
The definition of "last day" changes from organization to organization and sometimes from application to application within an organization. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
skkp2006 wrote: |
All i can think is like pass the current date from the JCL to the program and check the date with the following SQL.... if the dates match run the program
Code: |
SELECT LAST_DAY(CURRENT DATE) FROM SYSIBM.SYSDUMMY1; |
Regards,
Syam |
Why not just use this then you don't have to pass any date in the jcl.
Code: |
exec sql set :ws-current-date = current date end-exec.
exec sql set :ws-last-day = last_day(current date) end-exec.
|
Then compare the two dates but rememeber the warnings above about the last day of the month and the last work (or bussiness) day of the month. |
|
Back to top |
|
|
skkp2006
New User
Joined: 14 Jul 2006 Posts: 93 Location: Chennai,India
|
|
|
|
Craq,
The reason to pass date through JCL is for testing purposes. Otherwise we will need to wait till the last day of the month to see the program working.
What i have seen in most of the programs is like if date passed through JCL is spaces the pgm will pick up the current date....
Why not eliminate the first SQL and use the cobol statement below......
Code: |
ACCEPT MyDate FROM DATE YYYYMMDD |
Regards,
Syam |
|
Back to top |
|
|
|