Char to Date Datatype

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

Post Reply
phillip.small
Participant
Posts: 29
Joined: Mon Aug 16, 2004 8:12 am

Char to Date Datatype

Post by phillip.small »

I have a DB2 column and cannot populate it. My derivation is Ereplace(Oconv(Iconv(DataIN.EFFDT,"D-YMD[4'',2'',2]"), "D-YMD[4'',2'',2]"),"-",'').

Here is one of the error messages: Attempt to convert String value "2004 06 28" to Date type unsuccessful

Some values are null and I have this derivation within an If Else statement to cover the null values but have tried numerous derivations to try to get rid of the spaces and this String conversion is unsuccessful. I have taken out the dash, put a slash, used ICONV, OCONV, and a combination of the two. I have received some other ideas and tried those, and am out of suggestions.
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

for your input string try the following syntax

Iconv(DataIN.EFFDT,"D YMD[4,2,2]")

Thanks
Siva
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Phillip, this is exactly what Ken told you to do last week in your first post with this question. No 'OConv' needed as the DB2 stage expects the date in internal format.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply