Here I am collecting most of the warnings developers encounter when coding datastage jobs and trying to resolve them.
1. Warning: Possible truncation of input string when converting from a higher length string to lower length string in Modify.
Resolution: In the Modify stage explicitly specify the length of output column.
Ex: CARD_ACCOUNT:string[max=16] = string_trim[" ", end, begin](CARD_ACCOUNT) instead of just CARD_ACCOUNT = string_trim[" ", end, begin](CARD_ACCOUNT);
2. Warning: A Null result can come up in Non Nullable field. Mostly thrown by DataStage when aggregate functions are used in Oracle DB stage.
Resolution: Use a Modify or Transformer stage in between lookup and Oracle stage. When using a modify stage, use the handle_null clause.
EX: CARD_ACCOUNT:string[max=19] = handle_null(CARD_ACCOUNT,-128);
-128 will be replaced in CARD_ACCOUNT wherever CARD_ACCOUNT is Null.
3. Warning: Some Decimal precision error converting from decimal [p,s] to decimal[x,y].
Resolution: Specify the exact scale and precision of the output column in the Modfiy stage specification and use trunc_zero (the default r_type with decimal_from_decimal conversion)
Ex: CREDIT_LIMIT:decimal[10,2] = decimal_from_decimal[trunc_zero](CREDIT_LIMIT);instead of just CREDIT_LIMIT = decimal_from_decimal[trunc_zero](CREDIT_LIMIT);
For further information on where to specify the output column type explicitly and where not necessary, refer to the data type default/manual conversion guide
For default data type conversion (‘d’) size specification is not required. For manual conversion (‘m’) explicit size specification is required. The table is available in parallel job developer’s guide
4. Warning: A sequential operator cannot preserve the partitioning of input data set on input port 0
Resolution: Clear the preserve partition flag before Sequential file stages.
5. Warning: A user defined sort operator does not satisfy the requirements.
Resolution: In the job flow just notice the columns on which sort is happening . The order of the columns also must be the same. i.e if you specify sort on columns in the order X,Y in sort stage and specify join on the columns Y,X in order then join stage will throw the warning, since it cannot recognise the change in order. Also , i guess DataStage throws this warning at compile time . So if you rename a column in between stages, then also this warning is thrown. Say i have sorted on Column X in sort stage, but the column name is changed to Y at the output interface, then also the warning is thrown. Just revent the output interface column to ‘X’ and the warning disappears.