Dropping decimal/fractional seconds

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
aartlett
Charter Member
Charter Member
Posts: 152
Joined: Fri Apr 23, 2004 6:44 pm
Location: Australia

Dropping decimal/fractional seconds

Post by aartlett »

G'day,
We are having a data issue reading timestamp 3 records from a sql server database on a unix platform.

First time we noticed it was trying to add decimal seconds to an existing timestamp so Heisenberg remains happy, but the output always truncated the fractional seconds. At first i thought it was an issue with StringToTimestamp, contrary to the posts here, but after the check below I thing it is more endemic.

I ran a simple job to read data from a table with decimal timestamps and peek the output

The job is simple:
ODBC -> TF -> Peek. no transformations or derivations.

Input:

check_time
2013-04-05 09:09:58.55
2013-04-05 09:10:10.667
2013-04-05 09:10:11.487
2013-04-05 09:10:13.01
2013-04-05 09:10:13.69

Output:
Peek_489,0: check_time:2013-04-05 09:09:58
Peek_489,0: check_time:2013-04-05 09:10:10
Peek_489,0: check_time:2013-04-05 09:10:11
Peek_489,0: check_time:2013-04-05 09:10:13
Peek_489,0: check_time:2013-04-05 09:10:13

Field is defined as timestamp length 23 size 3

We are dropping the decimal fraction.

Has anybody seen this before? Is there a configuration issue/tweak to let it know that decimal timestamps are valid?
Andrew

Think outside the Datastage you work in.

There is no True Way, but there are true ways.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Set the extended property of the Timestamp column to microseconds. The default does not include microseconds.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
aartlett
Charter Member
Charter Member
Posts: 152
Joined: Fri Apr 23, 2004 6:44 pm
Location: Australia

Post by aartlett »

Thanks a lot, that got it.
Andrew

Think outside the Datastage you work in.

There is no True Way, but there are true ways.
Post Reply