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
 
Is thier any inbuilt function for Date validation in cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
anilsanda

New User


Joined: 07 Jun 2007
Posts: 15
Location: chennai

PostPosted: Wed May 21, 2008 3:20 pm    Post subject: Is thier any inbuilt function for Date validation in cobol
Reply with quote

HI,

Can u suggest any inbuilt function for date validation in cobol like CURRENT_DATE function which can be used for getting up the current date.

My purpose is to verify whether a given date is valid or not using inbuilt functions in cobol without wriiting code for validating the date.
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed May 21, 2008 3:35 pm    Post subject: Re: Is thier any inbuilt function for Date validation in cob
Reply with quote

Unfortunately, if you used a COBOL FUNCTION in an attempt to validate a date, the FUNCTION will abend as well as abend your program.

However, review the LE (Language Environment) Callable Service routine "CEEDAYS", which has the ability to return a feedback-halfword (as the first 2-bytes of the 12-byte feedback-parm), indicating a good or bad date had been passed, with good being zero.

Search the IBM.MAINFRAME archives and you should get some hits with examples or find it in an LE manual. It hasn't changed in over 15 years so there shouldn't be any problems with its usage.

The overhead in calling "CEEDAYS" is negligible and this method is used by many shops for date validation. As like many LE Date-Routines, it uses internal tables, so CPU usage is not a worry.

HTH....

Regards,

Bill
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed May 21, 2008 7:12 pm    Post subject: Re: Is thier any inbuilt function for Date validation in cob
Reply with quote

One other point I'd like to mention. You can save yourself a CALL to "CEEDAYS" by first validating the month and the day, providing that the date-format is "CCYYMMDD", which seems to be the ISO-Standard adopted by many shops for Y2K compliance.

Note that when I had said in the previous post, that validating a date using the COBOL FUNCTION could cause an abend, the abend would occur when the FUNCTION has detected an invalid date.

The COBOL FUNCTION equvilent to "CEEDAYS", using a "CCYYMMDD" date-format, is FUNCTION INTEGER-OF-DATE.

Regards,

Bill
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

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