I am trying following:
I am getting a column TRAN_AMT. This amount am reading as string from file.
The amount is spaces sometimes which indicates it is 0.
Now I have to generate three columns AmtPls8(as TRAN_AMT + and AmtMult8 (as TRAN_AMT * .
If while deriving above columns, I directly use the derivations as:
Code: Select all
AmtPls8 = StringToDecimal(TRAN_AMT) + 8
AmtMult8 = StringToDecimal(TRAN_AMT) * 8
Now I tried a bit diff approach to it. I added one stage variable AmtSVar and code is changed as follows:
Code: Select all
Stage variable:
AmtSVar = StringToDecimal(TRAN_AMT)
Cols Derivation:
AmtPls8 = AmtSVar + 8
AmtMult8 = StringToDecimal(TRAN_AMT) * 8
Then I change the cols to have derivations as:
Code: Select all
AmtPls8 = AmtSVar + 8
AmtMult8 = AmtSVar * 8
One more thing if the incoming column value is proper number and not spaces, then everything works fine and no need for the stage variable. But if it spaces, then it needs stage var to make the logic work proper.