date conversion

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

deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

Post by deva »

ArndW wrote:Are you talking about a NULL or an empty string? The former, in Server, can only occur if the input is already NULL! ...

I am loading 50 records from file. I have data for begin date. If I am loading in to database I am getting the following err.

I am using the following derivation :

Oconv(Iconv(DSLink44.BEGIN_DATE,"D/E"), "D4/MDY")

for this I am getting follwoing error.

Db_ReInsurance_PP..Risk_Tfm: At row 45, link "Risk_out", while processing column "BEGIN_DATE"
Value treated as NULL
Attempt to convert String value "" to Date type unsuccessful


IF ANY ONE NOT STILL UNDERSTAND PLSEASE LET ME KNOW
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

<sigh> The DataStage value is an empty string. DataStage doesn't care about data types so accepts that value. When that is being written to your Database it won't accept that invalid date, hence it uses NULL.

You need to fix your derivation so that it results in a valid date in the correct format. Your current derivation doesn't handle invalidly formatted input dates.
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

Deva,

Based on the assumption that your input value looks like DD/MM/YYYY , i made the date to get loaded into oracle.

May not be the absolute solution but try this ..

use the below function in the transfomer derivation of the Date field to be loaded.


Field(BEGIN_DATE,'/',3,1):Field(BEGIN_DATE,'/',2,1):Field(BEGIN_DATE,'/',1,1)

Thanks
Paddu
There is nothing good or bad, but thinking makes it so. --William Shakespeare
Post Reply