[SOLVED] How to -READ or -READFILE into variable with display formats like , and %
I was trying to read numbers from a hold file, but found that in the hold file they are just raw numbers without formatting. All comma and percentage sign % are gone. Is there a way to read the formatted number in to a variable?
Thanks.This message has been edited. Last edited by: <Kathryn Henning>,
7.66 and 7.704 System: Windows / AIX / Linux Output: Mostly HTML, with some PDF, Excel and Lotus(!)
August 15, 2013, 02:54 PM
nd
Use FPRINT to convert the contents to a string, and include any formatting tweaks in the arguments.
In this example, in the master file, DEALER_COST is a D7 field.
Here's an example with CAR:
-DEFAULTH &NDEALER_COST='';
SET HOLDLIST = PRINTONLY
SET ASNAMES = ON
-*
TABLE FILE CAR
SUM
COMPUTE NDEALER_COST/A30=FPRINT(DEALER_COST,'D9.2CM',NDEALER_COST);
ON TABLE NOTOTAL
ON TABLE HOLD AS MYCAR
END
-RUN
-READFILE MYCAR
-TYPE &NDEALER_COST