Page 1 of 1

Modify Operator - Error

Posted: Fri Jun 19, 2015 3:34 am
by TonyInFrance
Morning / Afternoon / Evening folks

I'm using the MODIFY operator to change 950 columns which are decimals at their source. The precision is decimal(31,3) whereas I need them in decimal(15,3)

The syntax I'm using in the MODIFY stage is:

#ZF:decimal(15,3]=#ZF;
#ZG:decimal(15,3]=#ZG;
#ZH:decimal(15,3]=#ZH;
#ZI:decimal(15,3]=#ZI;
#ZJ:decimal(15,3]=#ZJ;
#ZK:decimal(15,3]=#ZK;
#ZL:decimal(15,3]=#ZL;
#ZR:decimal(15,3]=#ZR;

I get the error:

Error parsing modify adapter: Error in binding: Expected destination field selector, got: ";"; input:

Can someone please give me the correct syntax?

Thanks

Tony

Posted: Fri Jun 19, 2015 4:00 am
by ShaneMuir
My modify stage syntax is a bit rusty, but I would lose the # symbols and/or close the meta data type with parenthesis rather than square brackets.

Posted: Fri Jun 19, 2015 9:07 am
by TonyInFrance
I corrected that error. Now I have:

#02:decimal[15,3]=decimal_from_decimal(#02);
#03:decimal[15,3]=decimal_from_decimal(#03);
#04:decimal[15,3]=decimal_from_decimal(#04);
#05:decimal[15,3]=decimal_from_decimal(#05);
#06:decimal[15,3]=decimal_from_decimal(#06);
#07:decimal[15,3]=decimal_from_decimal(#07);
#08:decimal[15,3]=decimal_from_decimal(#08);
#09:decimal[15,3]=decimal_from_decimal(#09);
NOWARN

The job seems to be running fine without any warning.
But on trying to insert this dataset into my table, the insertion job crashes with the message:
Schema reconciliation detected a size mismatch for column #02. When writing column DECIMAL(31,3) into database column DECIMAL(15,3), truncation, loss of precision or data corruption can occur.

Please note that the column in question is the first one. Its almost as if the modify is doing nothing although it appears to be fulfilling its duty since there's no error messages or warnings and the job finishes.

Any ideas?

Posted: Sat Jun 20, 2015 12:29 am
by ray.wurlod
Do the metadata on the output link specify Decimal(15,3)?

And you really should try to avoid "#" characters in identifier names, since DataStage uses these to flag job parameter references.

Posted: Tue Jun 23, 2015 4:21 am
by TonyInFrance
No Ray. I have no metadata defined. The idea is to use RCP.
Avoiding the # can be done if that is the only problem (although that would require me to go through a temp table since the final table has # as column names and that can't change) but at the moment I don't think it is.

Posted: Wed Jun 24, 2015 2:57 am
by TonyInFrance
It appears that RCP doesn't work.

I defined the columns explicitly and now it seems to modify its format correctly.