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 SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm


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