String to Timestamp conversion

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
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

String to Timestamp conversion

Post by agathaeleanor »

I have gone through the forum topic posted for topic string to timestamp conversion. Knew that I should follow the source data format,

input data: 20100801093010
derivation: StringToTimestamp(Trim(Lnk_InValidation.TIMESTAMP),"%yyyy%mm%dd%hh%nn%ss")

I am still getting error,
Data string '20100801093010' does not match format '%yyyy-%mm-%dd %hh:%nn:%ss': an integer was expected to match tag %nn.

Need your help in this matter.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm unclear how you can be saying that you are using "%yyyy%mm%dd%hh%nn%ss" in your function call and yet the error message shows "%yyyy-%mm-%dd %hh:%nn:%ss"... can you double-check, please? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

Post by agathaeleanor »

Yes, confirmed that error message is expecting format '%yyyy-%mm-%dd %hh:%nn:%ss'

However, right before the error message, there is a warning saying,

SEQ_LU_ROUTE: When validating import schema: Unrecognized top level format property: timestamp_format="%yyyy-%mm-%dd %hh:%nn:%ss"

Would this cause by any setting in the sequential file?
manoj_23sakthi
Participant
Posts: 47
Joined: Tue Feb 23, 2010 12:16 am
Location: CHENNAI

Post by manoj_23sakthi »

chulett wrote:I'm unclear how you can be saying that you are using "%yyyy%mm%dd%hh%nn%ss" in your function call and yet the error message shows "%yyyy-%mm-%dd %hh:%nn:%ss"... can you double-check, please? :?
convert string to timestamp
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

Post by agathaeleanor »

This has been resolved when i found that the reject link is expecting a timestamp. When i change the datatype to varchar in reject link, it works fine.
Post Reply