Community, I am just trying to figure out how to write a string to .csv file. Here is my attempt. data one;
input (acct_id gender)($) charge $20.;
datalines;
101 M 20000,10000,20000
102 F 20000,21000,11000
103 F 50000,18000,49000
;
run;
data _null;
set one;
file 'C:\statements\expenses.csv';
if _n_=1 then do;
put "Acct_id,Gender,Expenses";
end;
put Acct_id ',' gender ',' charge ;
run; The output in csv file I want it to look like exactly how the input data looked like. The commas are breaking in each cell (for example the first row with charge should look like 20000,10000,20000 in a single excel cell instead of showing up as 20000 10000 20000 in 3 different cells). I can't think of a way to do it. Any suggestions please Thanks,
... View more