type 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
laxmi_etl
Charter Member
Charter Member
Posts: 117
Joined: Thu Sep 28, 2006 9:10 am

type conversion

Post by laxmi_etl »

Hi-

I have one funny thing going on with my job.

One of the fields in my job needs string to timestamp conversion for that
I used the fallowing function.

StringToTimestamp((DSLink5.SrcFileDt): "00:00:00","%yyyy-%mm-%dd %hh:%nn:%ss")
This is working good.

But when I use the same function in another job
for the same field it's giving output **********

Anybody can tell what might be the reason.

Thanks.
Yuan_Edward
Participant
Posts: 73
Joined: Tue May 10, 2005 6:21 pm
Location: Sydney

Re: type conversion

Post by Yuan_Edward »

That means StringToTimestamp fails. Check the format of the input value where you got the output **********.
laxmi_etl wrote:Hi-

I have one funny thing going on with my job.

One of the fields in my job needs string to timestamp conversion for that
I used the fallowing function.

StringToTimestamp((DSLink5.SrcFileDt): "00:00:00","%yyyy-%mm-%dd %hh:%nn:%ss")
This is working good.

But when I use the same function in another job
for the same field it's giving output **********

Anybody can tell what might be the reason.

Thanks.
Edward Yuan
mansoor_nb
Participant
Posts: 48
Joined: Wed Jun 01, 2005 7:10 am

Post by mansoor_nb »

You will get these kind of results if your source string field is converted properly into the timestamp format before conversion or there migght be nulls in your source string column.

If there are nulls then check for nulls and then convert it into timestamp.
laxmi_etl
Charter Member
Charter Member
Posts: 117
Joined: Thu Sep 28, 2006 9:10 am

Post by laxmi_etl »

mansoor_nb wrote:You will get these kind of results if your source string field is converted properly into the timestamp format before conversion or there migght be nulls in your source string column.

If there are nulls then check for nulls and then convert it into timestamp.
Ok, source field data is in 20050503 (sting) format I want to conver it to timestamp.
Bisically I am getting ****** type of data in the output file for each and every record.

There are no nulls as you said.
laxmi_etl
Charter Member
Charter Member
Posts: 117
Joined: Thu Sep 28, 2006 9:10 am

Post by laxmi_etl »

Ok, source field data is in 20050503 (sting) format I want to convert it to timestamp.
Bisically I am getting ****** type of data in the output file for each and every record.

There are no nulls as you said.[/quote]
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Re: type conversion

Post by us1aslam1us »

laxmi_etl wrote: But when I use the same function in another job
for the same field it's giving output **********
Thanks.
The only difference in you previous post's code and new one is Trim function. Try using trim here. Also check the length of the field in the target.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Its not only trim, but the pattern that you use to convert.
"%yyyy-%mm-%dd %hh:%nn:%ss" is what you had given, but actual current pattern is

Code: Select all

"%yyyy%mm%dd %hh:%nn:%ss"
no '-'s delimited.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Sorry Laxmi. I haven't seen that part closely kumar.Thanks
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is the receiving field big enough to receive the data?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply