data conversion problem

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

Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Which of those 3 values do you expect in extract ?

Look into Field() function if you wish to split.
ETLJOB
Participant
Posts: 87
Joined: Thu May 01, 2008 1:15 pm
Location: INDIA

Post by ETLJOB »

hemaarvind1 wrote:"39368,39399,39429" data is supposed to be falling in a single field.
Have delimiter as comma and Quote as " in the source file. You might be able to read 39368,39399,39429 in a single field using the above combination.
hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

Post by hemaarvind1 »

I tried the option of using comma as delimiter and quote as double , still the error persists.

In the job log, I could see the data picked up correctly from the source. But the same oracle error persists.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Assuming that you are referring to "Invalid Number" error, how do you expect to store the string "39368,39399,39429"into a numeric field ?

It must be a Varchar field with atleast 18 chars length long.

If you want the target to be numeric, you must pick one of the 3 values or derive a new numeric value.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly. Saying you changed the target column in the table to a varchar and still got "the same error" makes absolutely no sense. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

Post by hemaarvind1 »

Yes, that is what is my problem.

Even if I use number or varchar at the target level, the error message returned is the same.

can you please confirm if this error could be due to comma being used in the text which is a delimiter?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No. We're either missing some vital piece of information or you're not doing what you are telling us you are doing. Or both. :?

Read the field as a string. Move it through the job as a string. Send it to a string field (VARCHAR2) in Oracle. Doing that there is no way you'll get an "invalid number" error back from the database.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

My assumption is that you are changing the datatype in DataStage target defn and not in Oracle.
datisaq
Participant
Posts: 154
Joined: Wed May 14, 2008 4:34 am

Post by datisaq »

Hi hemaarvind,
This kind of issues i have faced earlier also, you can solve it using the steps given below:-

1) specify the delimter as "," and quote as "none" at the format tab.
2) The field which is having this issue, go to it's field level properties by double clicking on the column.Then specify the delimter as "," and quote as "double"

This will resolve your issue definitely.

Regards
datisaq
IBM Certified - Information Server 8.1
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

They don't seem to be having any issues actually reading the value from the file, the disconnect seems to be in how they expect to store that in the target table. Even though it has been stated multiple times here already, I'll go through it one more time.

* If you want to store "39368,39399,39429" just like it looks, commas and all - you need to be targeting a VARCHAR2 field in Oracle and pass it through your job as a string.

* If you want to store as a single number, your only choice here is to remove the commas and then use StringToDecimal() to convert it to 393683939939429 and store it in a NUMBER field in Oracle. One with at least a precision of 15.
-craig

"You can never have too many knives" -- Logan Nine Fingers
hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

Post by hemaarvind1 »

Hi all,

I finally got this resolved. I have defined the datatype as varchar and "extended" as "unicode" in both source and target stages and it worked.

Thank you all for your valuable inputs.
devesh_ssingh
Participant
Posts: 148
Joined: Thu Apr 10, 2008 12:47 am

Post by devesh_ssingh »

good to go green(resolved) :D
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:?

Still unclear what the data type of your actual target field in the Oracle table was for this field. Are you saying you were able to load this to some kind of NUMBER field by calling it "unicode"?
-craig

"You can never have too many knives" -- Logan Nine Fingers
rameshkm
Participant
Posts: 24
Joined: Tue May 06, 2008 6:02 am
Location: chennai
Contact:

Post by rameshkm »

Hi,
In Sequential file on format tab in Quote mark as Comma(,). :idea:
Ramesh Kumar.M
Post Reply