yyyymmdd to timestamp

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
Gius
Participant
Posts: 29
Joined: Mon Mar 09, 2015 2:10 am

yyyymmdd to timestamp

Post by Gius »

hello,
I have two variables
var1 is the Date : YYYYMMDD
var2 is the time : HHMMSSTH

and I would like to concatenate those two variable in one, with the timestamp format ?

Thank you for your help
Gius
Participant
Posts: 29
Joined: Mon Mar 09, 2015 2:10 am

Re: yyyymmdd to timestamp

Post by Gius »

I tried this but it give me an error

StringToTimestamp(%DSLink8.PutDate:Left(DSLink8.PutTime,8)
%,[%"%yyyy%mm%dd %hh%nn%ss"%])
Gius
Participant
Posts: 29
Joined: Mon Mar 09, 2015 2:10 am

Re: yyyymmdd to timestamp

Post by Gius »

I'm still trying things,

StringToTimestamp( "2015-01-01 11:11:11" ,'%YYYY-%MM-%DD %hh:%nn:%ss')

But this simple expresion give me an error

Transformer_6,1: Caught exception from runLocally(): APT_ParseError: Parsing parameters "%YYYY-%MM-%DD %hh:%nn:%ss" for conversion "timestamp=timestamp_from_ustring[%yyyy-%mm-%dd %hh:%nn:%ss](ustring)": APT_Conversion_String_TimeStamp: Invalid format [%YYYY-%MM-%DD %hh:%nn:%ss] used for string_from_time type conversion.
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Try with this, which is having all in lower case.
StringToTimestamp("2015-01-01 11:11:11",'%yyyy-%mm-%dd %hh:%nn:%ss')
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

It is marked as RESOLVED. Post your resolution please.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I marked it as resolved because of the rating on your previous post: "Solved my problem!". Hover your mouse over it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

oops.. my bad. Sorry craig. I did not notice that.
Post Reply