Focal Point
Data Migrator

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/213102324

April 19, 2010, 10:48 PM
ray_In_Vancouver
Data Migrator
In DataMigrator functin to convert $10.00 to 10.00
or $(10.00) to -10.00

thanks


IWay SM 5.6, 6.01, 6.1, 6.9, 7.0
EDI, XML, XSD, WF 8.0, DM 77,8.0 asp.net, SQL Server
April 20, 2010, 04:58 AM
Dan Satchell
You could use function CTRAN to replace both '$' and ')' with a blank and '(' with a minus sign, and then use function ATODBL to turn the result into a double-precision number. This assumes the incoming data (FIELD0) is alphanumeric with a length of x (Ax).

FIELD1/Ax   = CTRAN(x,FIELD0,BYTVAL('$','I3'),BYTVAL(' ','I3'),'Ax');
FIELD2/Ax   = CTRAN(x,FIELD1,BYTVAL(')','I3'),BYTVAL(' ','I3'),'Ax');
FIELD3/Ax   = CTRAN(x,FIELD2,BYTVAL('(','I3'),BYTVAL('-','I3'),'Ax');
FIELD4/Dx.2 = ATODBL(FIELD3,'x','Dx.2');



WebFOCUS 7.7.05