Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Predefined value for current year in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Predefined value for current year in JCL
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

Site Director


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

PostPosted: Sat Jul 21, 2007 10:55 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sun Jul 22, 2007 7:13 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Wishing everyone a very Happy Diwali ... Rohit Umarjikar General Talk & Fun Stuff 1 Sat Oct 29, 2016 1:54 am
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Retrieve current year or month using ... vnktrrd DFSORT/ICETOOL 15 Tue Mar 15, 2016 4:14 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Openings for 3-10 year exp ... yogeshwar_ade Mainframe Jobs 0 Wed Jan 13, 2016 2:52 pm
No new posts Merry Christmas and Happy New Year! Rohit Umarjikar General Talk & Fun Stuff 3 Thu Dec 24, 2015 3:58 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us