How to check if a column is in valid date format

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

O, the switch over, the switch over, why didnt it hit me, for some reason i thought something was going wrong on my end.
Well Sheema, thats a routine by Ray, so you could request him to make it visible for a day so that it can help you.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sheema
Premium Member
Premium Member
Posts: 204
Joined: Sat Jul 22, 2006 10:20 am

Post by sheema »

Hi Ray,

I need a routine which checks if the date is in valid format ,if not convert it into desired format.
I came to know that you have a routine written for this purpose,can you please display it .

Thanks

sheema
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Since server jobs are lacking in IsValid() function. Follow Ray's approach to use Status() to check if the conversion using ICONV() is valid and assing NULL based on the result.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I do have a server IsValid() function. However, I'm not at a DataStage site this week, so won't be able to post it until I am (need a DataStage client to get at it). I will update this thread once I've done that.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sheema
Premium Member
Premium Member
Posts: 204
Joined: Sat Jul 22, 2006 10:20 am

Post by sheema »

Ray,

I am waiting for the IsValid() function for server Jobs which you promised to post.

Thanks
Sheema
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sorry about the delay. You can find it here - right-click and Save Target As... to get the DSX file.
Please heed copyright requirements (can be re-used if copyright notice is preserved).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Very nice Uncle Ray. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
sheema
Premium Member
Premium Member
Posts: 204
Joined: Sat Jul 22, 2006 10:20 am

Post by sheema »

Thank you for sending the routine ray.

Sheema
diamondabhi
Premium Member
Premium Member
Posts: 108
Joined: Sat Feb 05, 2005 6:52 pm
Location: US

ISVALID.dsx

Post by diamondabhi »

ray.wurlod wrote:Sorry about the delay. You can find it here - right-click and Save Target As... to get the DSX file.
Please heed copyright requirements (can be re-used if copyright notice is preserved).
Ray,
Do you have this function built in C++. Please share it if you can.

Thanks,
Abhishek
Every great mistake has a halfway moment, a split second when it can be recalled and perhaps remedied.
Manfred Hagedorn
Participant
Posts: 58
Joined: Wed Apr 04, 2007 10:02 am

Post by Manfred Hagedorn »

Hello,
i use to check dates with "IsValid" in a Transformer
If IsValid('date',StringToDate(L1.LOANAF_DAT_CRE,"%yyyy%mm%dd")) then ... else ...
Manfred
Manfred Hagedorn
Participant
Posts: 58
Joined: Wed Apr 04, 2007 10:02 am

Post by Manfred Hagedorn »

sorry, i didn't read the second page of posts
Manfred
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: ISVALID.dsx

Post by ray.wurlod »

diamondabhi wrote:Do you have this function built in C++. Please share it if you can.
I don't.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply