Conversion of Date in DataStage

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
kris9999
Participant
Posts: 11
Joined: Thu Nov 17, 2005 5:35 am

Conversion of Date in DataStage

Post by kris9999 »

Hi all,
I am new to Datastage & Informatica as well. Right now, i am working on migrating the maps from Informatica to Datastage jobs. I had a field in Informatica as EFFDT with expression as TO_DATE('01-01-1900 12:00:00'). How to give the same expression as derivation in DataStage?As per my analysis DS uses Dec 31,1967 as reference dt. for conversions.But how abt the years before 1967?
I am using the derivation in DS as Timestamp(Oconv(Iconv("1900-01-01","D-YMD[4,2,2]"),"D-YMD[4,2,2]")).
Can u give the right solution for this..................

Thanks in Advance
Thanks & Regards,
Kris
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In DataStage you handle the date and time components independently.

Dates prior to the reference date are stored/processed as negative integers; after the reference date as positive integers.

Because there are no data types in server jobs, there is no necessity to have an actual Date data type. You can, for example, assemble a timestamp from date and time components using concatenation, a string operator.

The only time it has to be right is when you're loading the date, time or timestamp into a database table. Now you have to get it right. Unfortunately, different stage types have different rules (having been written by different authors) - some require internal format dates, others requiring explicitly formatted text strings. Some (such as Oracle stages) actually generate TO_DATE or TO_CHAR functions right there in the SQL.
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