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

Date validation


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jun 09, 2010 12:43 pm
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

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

for the DATE function
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)
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
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 Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top