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

Predefined value for current year in JCL


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
KL.Anitha

New User


Joined: 20 Jul 2007
Posts: 3
Location: Chennai

PostPosted: Sat Jul 21, 2007 7:45 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Jul 21, 2007 10:55 pm
Reply with quote

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
View user's profile Send private message
KL.Anitha

New User


Joined: 20 Jul 2007
Posts: 3
Location: Chennai

PostPosted: Sun Jul 22, 2007 5:45 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sun Jul 22, 2007 7:13 pm
Reply with quote

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
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts Changeman - how can we know the curr... Compuware & Other Tools 2
No new posts Fetch data from programs execute (dat... DB2 3
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
Search our Forums:

Back to Top