IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Date validation Program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mohd Asad

New User


Joined: 12 Feb 2008
Posts: 3
Location: India

PostPosted: Wed Feb 13, 2008 9:40 am
Reply with quote

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
View user's profile Send private message
Santoshdorge

New User


Joined: 27 Jun 2006
Posts: 48
Location: Pune

PostPosted: Wed Feb 13, 2008 10:54 am
Reply with quote

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
View user's profile Send private message
Mohd Asad

New User


Joined: 12 Feb 2008
Posts: 3
Location: India

PostPosted: Wed Feb 13, 2008 11:40 am
Reply with quote

yeah it can be done it DB2 bt i wanted it in a simple date validation program in COBOL.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Feb 13, 2008 12:56 pm
Reply with quote

google
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Feb 13, 2008 12:59 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Wed Feb 13, 2008 5:35 pm
Reply with quote

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
View user's profile Send private message
Mohd Asad

New User


Joined: 12 Feb 2008
Posts: 3
Location: India

PostPosted: Wed Feb 13, 2008 6:20 pm
Reply with quote

hey biil thanks a lo. its helping icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Using API Gateway from CICS program CICS 0
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top