View previous topic :: View next topic
|
Author |
Message |
Mohd Asad
New User
Joined: 12 Feb 2008 Posts: 3 Location: India
|
|
|
|
Hi all,
I have been struck with the validation of a particular date,as there are lots of checks to be made.Is there any single consolidated code which can validate all kind of dates(keeping in mind leap year etc) .Please inform if there is any.
Thanks |
|
Back to top |
|
|
Santoshdorge
New User
Joined: 27 Jun 2006 Posts: 48 Location: Pune
|
|
|
|
Hi,
If you don't want to code all date validating checks in cobol and you have a DB2 in your system you can validate dates in a single query.
select date ( :date-value ) into :some-var from sysibm.sysdummy1
SQLCODE -181 will give you invalid date format and value
Thanks,
Santosh. |
|
Back to top |
|
|
Mohd Asad
New User
Joined: 12 Feb 2008 Posts: 3 Location: India
|
|
|
|
yeah it can be done it DB2 bt i wanted it in a simple date validation program in COBOL. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
google |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Why don' t You try asking Your peers,
date validation is an issue that has been around since the birth of IT
and all the decently managed IT shops have a set of utility subroutines
designed for the most common tasks,
and usually the date related ones are among them,
no need to reinvent the wheel every time |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Review the LE Callable Service routine "CEEDAYS". If the date passed to this routine is invalid, bytes 01-02 of the 12-byte "Feedback Return Area" will NOT equal LOW-VALUES.
Use of "CEEDAYS" to validate dates in COBOL (as well as PL/I and Assembler) is a common approach in many shops.
HTH....
Regards,
Bill |
|
Back to top |
|
|
Mohd Asad
New User
Joined: 12 Feb 2008 Posts: 3 Location: India
|
|
|
|
hey biil thanks a lo. its helping |
|
Back to top |
|
|
|