Date validation

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
adarsh shrinagesh
Premium Member
Premium Member
Posts: 68
Joined: Sat Feb 05, 2005 4:59 am
Location: India

Date validation

Post by adarsh shrinagesh »

Hi

As part of our Error Handling logic we need to check
>whether a given date valid or not
Ex - 2/2/1999 - Valid
2-02-2000 - Valid
>whether a given timestamp is valid or not

the Date conversion functions in the Parallel Transformer/Modifier need explicit specification of the delimiter and format string
This does not allow single digit months and days

Have tried using the IsValid Function as well to no avail

Are there any workarounds?

The source field is of type Varchar and extracting the individual field for padding etc does not seem clean.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I recently had to go through the same type of issues with dates, the format needs to be explicit in PX - a %yyyy-%mm-%dd format will error on a "2005-1-1" date! There is no direct and easy workaround for this in PX; you will need to cater for these types of formats yourself. Or think about using a slow BASIC transform stage or coding your own c++ routine to take care of this if high speed is required.
pavankvk
Participant
Posts: 202
Joined: Thu Dec 04, 2003 7:54 am

Post by pavankvk »

what we did is..

if u know the format of date like if it comes in 12/5/2005 we use to parse it and then build 12-05-2005 and then use the existing functions.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you please provide details of how you do this in parallel jobs?
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