Date Format DD-MM-YYYY

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
praburaj
Premium Member
Premium Member
Posts: 133
Joined: Thu Jun 30, 2005 1:26 am
Location: philippines

Date Format DD-MM-YYYY

Post by praburaj »

Hi,

In my source file one of the column is Date. My requirement is If any Date Format is DD-MM-YYYY then I have to load the records into target table. If records are not in DD-MM-YYYY format move the records to rejected files. Plz guide me how to Identify that the record in DD-MM-YYYY?.
prabakaran.v
jpraveen
Participant
Posts: 71
Joined: Sat Jun 06, 2009 7:10 am
Location: HYD

Post by jpraveen »

Hi,

you can have a reject link in the target ,
so that if records are not in DD-MM-YYYY format the records go to reject file.
Jaypee
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In a Transformer stage, IsValid("date", inLink.TheDate, "%dd-%mm-%yyyy")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
praburaj
Premium Member
Premium Member
Posts: 133
Joined: Thu Jun 30, 2005 1:26 am
Location: philippines

Post by praburaj »

Thanks Ray. I fixed my problem :D
prabakaran.v
premupdate
Participant
Posts: 47
Joined: Thu Oct 04, 2007 3:37 am
Location: chennai

Post by premupdate »

Hi,

When I tried to validate the date format of YYYY-MM-DD through IsValid function I can see only two values that can be passed to IsValid function.
IsValid(%typestring%,%valuestring%)
If I give the date format as third value to the IsValid function it throws basic syntax error.
Cheers,
prem
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post by zulfi123786 »

use a stage variable and split-concatenate the incoming data to bring it to the format YYYY-MM-DD format and then use "Isvalid" function over the stage variable.

stage varaible=X[7,4]:'-':X[4,2]:'-':X[1,2]
Constraint=Isvalid('DATE',stage varaible)
Post Reply