Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us