Posted: Fri Feb 24, 2006 4:40 am Post subject: dropped decimal place on wbimb 5 - CAST as DECIMAL
Centurion
Joined: 01 Nov 2003 Posts: 101
Problem. Testing of flows under wbimb 5 broker has shown that one subflow is failing i.e. one decimal place (data is sterling amount) is being dropped off.
CAST as DECIMAL used , data o/p is xml and described in mrm as <Price> xsd:decimal
Any help would be much appreciated.
See following for more details.
RESULTS
2.1 csd7 output
<Price>0.10</Price>
5.0 csd6 output
<Price>0.1</Price>
ESQL extract
IF CAST(wasprcInstance.WWW_PRC AS DECIMAL) > 0 THEN
SET "OutputRoot"."MRM"."CascadePrices"."CascadePrice"[itemPointer]."StoreGroupCode" = ConvertBranchPriceCode(wasprcInstance.BRANCH_PRICE_GROUP);
SET "OutputRoot"."MRM"."CascadePrices"."CascadePrice"[itemPointer]."EffectiveDate" = Manual_DATETIMEFormat_TO_YYYYMMDD_BugFix( itemPointer, wasprcInstance.EFFECTIVEDATE );
SET "OutputRoot"."MRM"."CascadePrices"."CascadePrice"[itemPointer]."Level" = '3';
SET "OutputRoot"."MRM"."CascadePrices"."CascadePrice"[itemPointer]."Price" = fix_2decpl(wasprcInstance.WWW_PRC);
IF wasprcInstance.BAR_CD IS NOT NULL THEN ............................
-- e.g. if input does not have a decimal point
IF (pos_point = 0) THEN
SET before_point = number_in;
SET after_point = '00';
SET retval = before_point || '.' || after_point;
SET adjustment_made = TRUE;
END IF;
-- decimal point is last character in the string
IF ((pos_point = LENGTH(number_in) AND adjustment_made = FALSE)) THEN
IF (number_in = '.') THEN
SET before_point = '00';
SET after_point = '00';
ELSE -- e.g. '12.'
BEGIN
SET before_point = SUBSTRING(number_in FROM 1 FOR LENGTH(number_in)-1);
SET after_point = '00';
END;
END IF;
SET adjustment_made = TRUE;
SET retval = before_point || '.' || after_point;
END IF;
-- Only one digit after decimal point ?
IF (((LENGTH(number_in) - pos_point) = 1) AND adjustment_made = FALSE) THEN
SET number_in = number_in || '0';
SET adjustment_made = TRUE;
SET retval = number_in;
END IF;
IF (adjustment_made = FALSE) THEN
SET retval = number_in;
END IF;
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum