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
 

 

Date validation Program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Date validation Program
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    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Wed Feb 13, 2008 12:59 pm    Post subject: Reply to: Date validation Program
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 13, 2008 5:35 pm    Post subject: Date validation Program
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    Post subject:
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    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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12: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 Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
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