while convert timespamp to string getting warnings

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
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

while convert timespamp to string getting warnings

Post by deesh »

Hi Friends,
While changing from timespamp to string i am getting below warning and data showing null, i tried some ways but again and agin showing the same warning, can any one help in this solution.


APT_CombinedOperatorController(0),0: Data string '19971001' does not match format '%yyyy-%mm-%dd %hh:%nn:%ss': an integer was expected to match tag %dd.
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

Remove the %hh%mm%ss and try to execute
RAJ
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

Post by deesh »

showing same message
gssr wrote:Remove the %hh%mm%ss and try to execute
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

are you trying to convert "Timestamp to String" or "String to Timestamp"..Can you able to read the data in the Source file?? :?
RAJ
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Re: while convert timespamp to string getting warnings

Post by ArndW »

Try "StringToTimeStamp(In.column:" 00:00:00","%YYYY%MM%DD %HH:%NN:%SS")
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Re: while convert timespamp to string getting warnings

Post by gssr »

ArndW wrote:Try "StringToTimeStamp(In.column:" 00:00:00","%YYYY%MM%DD %HH:%NN:%SS") ...
I think he want to convert Timestamp to String ""while convert timespamp to string getting warnings""
RAJ
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

Re: while convert timespamp to string getting warnings

Post by deesh »

from TimestampToString

ArndW wrote:Try "StringToTimeStamp(In.column:" 00:00:00","%YYYY%MM%DD %HH:%NN:%SS") ...
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post by gssr »

Which function are you using..?
Try this TimestampToString(DATA,[%yyyy-%mm-%dd])
RAJ
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

Post by deesh »

it's not working
gssr wrote:Which function are you using..?
Try this TimestampToString(DATA,[%yyyy-%mm-%dd])
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The syntax is wrong. Explain "not working", please and include the error message.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

'19971001' is not a Timestamp.
-craig

"You can never have too many knives" -- Logan Nine Fingers
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

Post by deesh »

When i use this
TimestampToString(LNK_CONV_TRANS2.SERVICE,"%yyyy-%mm-%dd") in Trnsformer showing below warning


APT_CombinedOperatorController(0),0: Data string '2009-11-01' does not match format '%yyyy-%mm-%dd %hh:%nn:%ss': the data string has fewer characters than expected.

chulett wrote:'19971001' is not a Timestamp. ...
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

'2009-11-01' is a Date and cannot be converted to a timestamp they way you are writing it.
Try :

Code: Select all

TimestampToString(LNK_CONV_TRANS2.SERVICE:' 00:00:00',"%yyyy-%mm-%dd %hh:%nn:%ss")
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

But again, all that presupposes the input is already a timestamp which this isn't. And the formatting mask in the TimestampToString function is what you want the string to look like. :?
-craig

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