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
 
Date vaildation using CICS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
neoarvind

New User


Joined: 28 Oct 2006
Posts: 6

PostPosted: Fri May 11, 2007 10:01 am    Post subject: Date vaildation using CICS
Reply with quote

Hi,
I am getting date as input from an unprotected field in the format YYYY-MM-DD and validate that date. Do anyone know any routine to validate the date? Like for a non-leap year user cannot enter Feb 29 or invalid date like 2007-14-31 :!:
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri May 11, 2007 2:52 pm    Post subject:
Reply with quote

Have you looked at some of the intrinsic functions?
Back to top
View user's profile Send private message
neoarvind

New User


Joined: 28 Oct 2006
Posts: 6

PostPosted: Mon May 14, 2007 10:43 am    Post subject: Re: Date vaildation using CICS
Reply with quote

Not yet Thom...tell me if you know any
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon May 14, 2007 4:50 pm    Post subject:
Reply with quote

Intrinsic functions
Back to top
View user's profile Send private message
neoarvind

New User


Joined: 28 Oct 2006
Posts: 6

PostPosted: Tue May 15, 2007 9:24 am    Post subject:
Reply with quote

Hi Thompson,
Thank you for the link. But i really have no idea how to use these functions in my program and how can i use this to validate the date entries..Please help me out!
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue May 15, 2007 2:20 pm    Post subject:
Reply with quote

Look at INTEGER-OF-DATE and DATE-OF-INTEGER. If you removed the "-"s and converted the date to an integer and back to a date, you could compare the first to the second - if they are different, the first date was invalid.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu May 24, 2007 6:00 pm    Post subject:
Reply with quote

neoarvind wrote:
But i found that a small query can be used to evaluate the input date. The query is,
EXEC SQL
SELECT CHAR(DATE(:WS-VLD-DT))
INTO :WS-VLD-DT
FROM SYSDUMMY1
WITH UR
END-EXEC
where ws-vld-dt is the input date in the format YYYY-MM-DD. if the response of this query is normal, then the date is valid!!
Good for you....
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How do you attach a DB2 plan to a CIC... John Poulakos DB2 0 Wed Apr 18, 2018 1:49 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm
No new posts How do I define a DB2 plan for a web ... John Poulakos CICS 4 Sat Apr 14, 2018 1:58 am
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts Limit in Length for a CICS START seahawk789 CICS 6 Mon Apr 02, 2018 8:34 pm

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