Timestamp to String Conversion with microseconds

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
clmhwyfe
Premium Member
Premium Member
Posts: 42
Joined: Mon Jun 18, 2012 1:39 pm

Timestamp to String Conversion with microseconds

Post by clmhwyfe »

Hi All,

Am working on migrating jobs from DS 7.5 to DS8.7 , There is a instance where they are converting a Timestamp to a string.

Am unable to get the microseconds printed out correctly. I used the below mentioned function and got the output as 17530101000000.000

Is there a direct way to get the output without the dot or should i use other functions to remove it

TimestampToString(DSLink2.ATXR_TM,"%yyyy%mm%dd%hh%nn%ss.3")

Desired Output : -

Input Data - 1753-01-01 00:00:00.000000

Output Data - 17530101000000000 but am getting 17530101000000.000
srinivasudatastage
Participant
Posts: 5
Joined: Sun Dec 26, 2010 12:08 am
Location: bangalore

Re: Timestamp to String Conversion with microseconds

Post by srinivasudatastage »

Use convert function

convert('.','',columnname)

Hope this will help you
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Just want to clarify something. The output you are getting is correct, dot and all. If you want the dot gone for some reason, then use the solution srinivasu posted to remove it from the string.
-craig

"You can never have too many knives" -- Logan Nine Fingers
clmhwyfe
Premium Member
Premium Member
Posts: 42
Joined: Mon Jun 18, 2012 1:39 pm

Post by clmhwyfe »

Thanks all.
Post Reply