View previous topic :: View next topic
|
Author |
Message |
KL.Anitha
New User
Joined: 20 Jul 2007 Posts: 3 Location: Chennai
|
|
|
|
Hi,
Is there any predefined value for current year in JCL. I need to pass the (current year-4) to a control card and cancatenate with month and year. For example, now it is 2007. In the control card, i need 2003-12-31.Or is there any other method to retieve the last date of previous fourth year? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forums,
An easy to do this is to write a small bit of code that does what you want.
I'm not aware of anything in JCL that provides this kind of "date arithmetic".
This is probably not the answer you want, but if you implement the code, you can have your requirement met very quickly (as opposed to hoping for a reply from here). |
|
Back to top |
|
|
KL.Anitha
New User
Joined: 20 Jul 2007 Posts: 3 Location: Chennai
|
|
|
|
Hi dick,
Thanks for the reply. By saying small bit of code, do u mean to say code in COBOL? My requirement is to delete few records from the table based on the date and also to reorganize the table. If I could use REORG with DISCARD option, I can do both in a single step. But the problem is how to compare the date. I tried the following and it worked.
REORG TABLESPACE ....
.....
DISCARD WHEN DATE_COLUMN < (CURRENT DATE - 4 YEARS).
But I do not want compare with current date instead with Jan 1st or Dec 31st. I tried
DISCARD WHEN YEAR(DATE_COLUMN) < [YEAR(CURRENT TIMESTAMP)-4].
This works in Spufi. But in JCL it gives error saying DATE_COLUMN is an invalid keyword.Hope I am clear in stating my query. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Yes, i meant a small cobol program.
Your initial post didn't mention that you wanted to reorg at the same time.
I'm not sure that the reorg will be able to do this, but i'll move your request to DB2 and if someone knows how to do this within a reorg, they will post a way. |
|
Back to top |
|
|
|