Page 1 of 1

Converting integer to date

Posted: Wed May 03, 2006 7:08 pm
by seanc217
I have source data loaded into an Oracle database. The fields I want to convert are defined as number(7) which are defined in my metadata as integers. The format of the date is YYYYDDD. What is the best way of converting them to dates in DataStage?

Thanks for all the help.

Posted: Wed May 03, 2006 8:38 pm
by ray.wurlod
In a Transformer stage explore the conversion functions and the casting functions. You can also search the forum, since this question has been addressed in the recent past.

Posted: Thu May 04, 2006 7:48 am
by seanc217
Thanks for the hint on the function.
Here is my derivation. Does this look right?

if DSLink2.CIRAMST_DATE_LAST_BNOTICE =0 then setnull() else DateFromDaysSince(DSLink2.CIRAMST_DATE_LAST_BNOTICE[5,3],StringtoDate(DSLink2.CIRAMST_DATE_LAST_BNOTICE[1,4]:"-01-01"))

Thanks!!

Posted: Thu May 04, 2006 2:20 pm
by ray.wurlod
Does it do what you require? I can assert that it's syntactically correct, but can not comment on its semantics.