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

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

New User


Joined: 07 Dec 2006
Posts: 51
Location: Bloomington

PostPosted: Wed Jun 09, 2010 11:54 am    Post subject: Date validation
Reply with quote

Hi,

I have a requirement where I need to prepare extract conditionally.

I have a column A which is a date field and defined as CHAR, We need to validate this column to check the day of this column field should be in beween Monday and Firday.

Is there a way to check this condition. If this topic is already discussed then please let me know the link of the post where it was discussed.

Thanks and Regards,
Rajkumar Nerella
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Wed Jun 09, 2010 12:43 pm    Post subject: Reply to: Date validation
Reply with quote

all depends on the format of the <date> field

for the format of things that can be processed by the DATE function

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQK15/2.10.7.5?SHELF=DSNSHKA3&DT=20081120084907#HDRWQ11363

for the DATE function
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQK15/3.2.26?SHELF=DSNSHKA3&DT=20081120084907

for the DAYOFWEEK and DAYOFWEEK_ISO functions
( the second has a more friendly numbering scheme MON = 1 .... SUN = 7)
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQK15/3.2.30?SHELF=DSNSHKA3&DT=20081120084907


and try to use something along the lines of

DAYOFWEEK_ISO(DATE(<yourcolunnname>)) BETWEEN 1 AND 6

( hint not tested )
Back to top
View user's profile Send private message
Rajkumar_n

New User


Joined: 07 Dec 2006
Posts: 51
Location: Bloomington

PostPosted: Wed Jun 09, 2010 2:29 pm    Post subject: Reply to: Date validation
Reply with quote

It Helped me a lot.

Thanks a lot for your help.

Thanks and Regards,
Rajkumar Nerella
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
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


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us