Good Afternoon,
I need to build a sequntial file for a vendor. They need the amount fields in the format +000100.01 or -000100.01. The data is coming from a DB2 table and looks like -100.01 or 100.01. I've tryed messing with the FMT and OCONV functions, but I can't seem to hit the nail on the head. I was also thinking of breaking the output data into seperate fields and doing some sort of position by position read of the input field, but I have to believe there's an easier way. I'm kind of frustrated since this seems to be a fairly simple thing to accomplish. I'm new to Datastage and am still learning on the job, so any help is appreciated.
Leading Sign and Zero Filled Decimal Amount Fields
Moderators: chulett, rschirm, roy
With your advice I did the seperate sign field. I check the first byte of the input amount field for the sign and populate the output field. I then used the following code in my transform to handle the leading zeros:
If substrings(DSLink4.OPEN_AMT,1,1) = '-' then
FMT(DSLink4.OPEN_AMT*-1,"16'0'R2") else
FMT(DSLink4.OPEN_AMT,"16'0'R2")
It seems to work just fine. Thanks again.
Carl .. :D
If substrings(DSLink4.OPEN_AMT,1,1) = '-' then
FMT(DSLink4.OPEN_AMT*-1,"16'0'R2") else
FMT(DSLink4.OPEN_AMT,"16'0'R2")
It seems to work just fine. Thanks again.
Carl .. :D
