date conversion from small int

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
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

date conversion from small int

Post by hargun »

Hi,

i am getting the source date field data like "15299 "and small int as datatype and want to convert to date format (yyyy-mm-dd).How can i convert .Which function i will use.Can you provide the whole function syntax.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

What is the format of the date supplied in the integer?

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Post by stuartjvnorton »

Days since 1/1/1970, at a guess.

As for spoon-feeding you so that you learn nothing, why don't you have a think about it and try some stuff out first?
Then ask us something specific and you be more likely to get the help you need.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Two places in the documentation to help jumpstart the thinking process:

http://publib.boulder.ibm.com/infocente ... tions.html
http://publib.boulder.ibm.com/infocente ... tions.html

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Day zero could be 1968-12-31 if it's come from UniVerse or UniData.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chandra.shekhar@tcs.com
Premium Member
Premium Member
Posts: 353
Joined: Mon Jan 17, 2011 5:03 am
Location: Mumbai, India

Post by chandra.shekhar@tcs.com »

As asked above you need to find the "Day 0" value.
Mostly it is generic but sometimes project specific like in my project its 1899-12-31.
So once you find it you can use any of the below functions :-

Code: Select all

date('1899-12-31') + n days
If you are having a database as your source.

Code: Select all

DateFromDaysSince(<column>,'1899-12-31')
If you want to do it in transformer.

Also do a Null handling in the transformer if you are using 2nd option, because the record will drop from the transformer if Null comes in the source.
Thanx and Regards,
ETL User
Post Reply