conversion to timestamp

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
arun_im4u
Premium Member
Premium Member
Posts: 104
Joined: Mon Nov 08, 2004 8:42 am

conversion to timestamp

Post by arun_im4u »

hi,

I have a job which extracts data from one table to another table in Oracle database. There are 3 columns in the table which has a number in milliseconds. The number represents number of milliseconds from jan1 1970. So if a record was created on jan1 1970 at 12:00 am then the value in those columns would be 0.

I have to take these columns and convert it into timestamp. Is there a inbuilt function in DS to do it or any other way.

Thanks,
Arun.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

No but you can do the math in a reusable function.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The DataStage internal date is an integer denoting the number of days since Dec 31st, 1967. So Day 1 is January 1, 1970. There are (60*60*24*1000) Milliseconds in a day. The mathematical conversion between your millisecond representation and the DataStage internal representation is known, and the conversion of a DataStage internal date to any external display format you wish can be done using the appropriate conversion and the OCONV() function.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There are a couple of SDK routines dealing with 1970-01-01-based dates.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arun_im4u
Premium Member
Premium Member
Posts: 104
Joined: Mon Nov 08, 2004 8:42 am

Post by arun_im4u »

Thanks for the suggestions.
Post Reply