I would like to export a sas dataset to json. I need to apply the commax10.1 format to make it suitable for some language versions. The problem is that the fmtnumeric option applies the format correctly but inserts extra blanks inside the quotes. I have tried trimblanks and other options but have not been able to get rid of them. How to delete the empty blanks inside the quotes? Note: I would like the values to remain inside the quotes
In addition, is it possible to replace the null values with “” ?
Sample data:
data testdata_;
input var1 var2 var3;
format _all_ commax10.1;
datalines;
3.1582 0.3 1.8
21 . .
1.2 4.5 6.4
;
proc json out = 'G:\test.json' pretty fmtnumeric nosastags trimblanks keys;
export testdata_;
run;
In the link you can see what the output looks like.

