08-08-2015 03:54 PM
i`m currently producing a csv txt file with around 500.000 lines using SAS on mainframe (zos).
It has around 40 columns and its majority are numeric.
At certain point of my program i use the following to format the numbers :
FORMAT field1 field2 field3 field4 field5 field6 8.4;
My goal is to reduce the file output report size and since a lot of data is 0.0000 i thought i could replace this by 0 only.
This would save 5 characters and certainly would save some space.
Any ideia on how could i do this ?
08-08-2015 10:00 PM
I believe picture format will work, please replace 8.4 with picture the below picture format
proc format fmtlib;
picture pct 0='9'
format x pct.;
08-09-2015 07:54 AM
Back in the day we used implied decimal in-formatting. How much space would getting rid of ALL the decimal points save?
How much more space would you save if you got rid of the field delimiters?
08-09-2015 10:17 AM
I assume you wanted to apply the format to limit the display of non-significant precision in the numbers. You would probably have the best results by rounding the values to 4 decimal places and then letting SAS format the values using BEST format.
set mydata ;
array f field1-field8 ;
do over f; f=round(f,0.0001); end;
file 'myfile.csv' dsd ;
format field1-field8 ;
put (_all_) ( ;