Unable to load time stamp

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
sriec12
Participant
Posts: 56
Joined: Mon Nov 01, 2010 5:34 pm

Unable to load time stamp

Post by sriec12 »

Hello Good Morning !!

I am receiving a Time stamp in char format 2013071820209386.....I need to load all the 16 bytes......


I am using StringToTimestamp(date,"%yyyy-%mm-%dd %hh:%nn:%ssss")

Error: Caught exception from runLocally(): APT_ParseError: Parsing parameters "%yyyy-%mm-%dd %hh:%nn:%ssss" for conversion "timestamp=timestamp_from_string[%yyyy-%mm-%dd %hh:%nn:%ss](string)": APT_Conversion_String_TimeStamp: Invalid format [%yyyy-%mm-%dd %hh:%nn:%ssss] used for string_from_time type conversion. [api\operator_rep.C:3828]


I am able to load using StringToTimestamp(date,"%yyyy-%mm-%dd %hh:%nn:%ss") but when i try to load last 2 bytes its give me an error
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your format string needs to match the incoming data. Since your incoming string does not have dashes or spaces or colons in it, remove them from the format you are specifying. It's all about what it is, not what you want it to be.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sriec12
Participant
Posts: 56
Joined: Mon Nov 01, 2010 5:34 pm

Post by sriec12 »

chulett Thanks for replying....

I changed input string into StringToTimestamp(date,"%yyyy-%mm-%dd %hh:%nn:%ssss") ......


Now i want to load all 4 bytes into seconds position....... is it possible ?

If so in place of %ssss what should i keep
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Please reread my response... pay particular attention to the 'remove them' part.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply