I receive a transaction file in fixed field length format which contains dollar amounts which are processed by using the NUMVAL function. Recently, however, we began receiving dollar data enclosed in parentheses, which causes my program to crash. I was going to use an INSPECT ... REPLACE statement to replace the parentheses with zeros, but that would cause the data on the line to be shifted one bit. Is there a simple way to replace a character in a string with a different number of characters than the replaced portion?
EX:
000000000000000000,1278T,0000024.70,0000024.70,03/07/03
000000000000000000,1276T,(00070.06),(00070.06),03/07/03
becomes
000000000000000000,1278T,0000024.70,0000024.70,03/07/03
000000000000000000,1276T,0000070.06,0000070.06,03/07/03
by replacing '(' with '00' and ')' with NULL.
EX:
000000000000000000,1278T,0000024.70,0000024.70,03/07/03
000000000000000000,1276T,(00070.06),(00070.06),03/07/03
becomes
000000000000000000,1278T,0000024.70,0000024.70,03/07/03
000000000000000000,1276T,0000070.06,0000070.06,03/07/03
by replacing '(' with '00' and ')' with NULL.