Problem wit Decimal Field

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
sshettar
Premium Member
Premium Member
Posts: 264
Joined: Thu Nov 30, 2006 10:37 am

Problem wit Decimal Field

Post by sshettar »

Hi All,

I have this simple job where in i am extracting data from a db2 table. I am using the DB2API stage.
i have defined the custom sql and also mentioned the columns with their datatypes and lengths.
there is one field of type decimal and lenth being just 12 . no precision mentioned even in the database.
i have given the datatype in the DB2 stage as decimal and length to 12 and precision as 0.
but the job right now is aborting with following error message

main_program: Syntax error: Error in "tsort" operator: Error in output redirection: Error in output parameters: Error in modify adapter: Error in binding: Error in field type: Parsing parameters "0,0" for schema type "decimal": Precision must be > 0 and <= 255, got: "0"

main_program: Creation of a step finished with status = FAILED.

I even tried giving 2 as the scale but still its giving out this error.
I have another similar job where in i had not given any scale for the decimal field and the job ran fine.

Could someone let me know as to where i am going wrong

any help is highly appreciated.

Thanks in advance
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

While you can set the scale to zero, you cannot do so for the precision so saying that you set "length to 12 and precision as 0" is invalid. Correct that and you should be fine.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sshettar
Premium Member
Premium Member
Posts: 264
Joined: Thu Nov 30, 2006 10:37 am

Post by sshettar »

I'm sorry for the confusion , i have set the length to 12 and ther scale to 0 in the DB2API stage.

What is it that i must correct now?

any help is highly appreciated
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't have any DB2 access here but try setting the Display value to 12 as well and see if that helps.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sshettar
Premium Member
Premium Member
Posts: 264
Joined: Thu Nov 30, 2006 10:37 am

Post by sshettar »

Hi Craig,

I tried giving display to 12 as well . but no luck . still the same error.
but the strange thing here is i can view the data from the DB2API stage without any problems with just giving length =12 and datatype decimal, its only when i run the job i'm facing this problem.

Any help is appreciated.

Thanks in advance
Post Reply