The SAS Output Delivery System and reporting techniques

CSVAll : output files

Reply
Frequent Contributor
Posts: 100

CSVAll : output files

Experts:
Another beginner question. I'm writing the results of a proc freq and a proc print to a CSVAll file, as part of my learning exercise. Unlike the PDF, RTF destinations, I got two CSV files, instead of having both (proc freq and proc print) results in one CSV file. Did I do something wrong? If not, is there an option that we can use so the multiple proc step results can go to a single CSV file?
Thank you!

ods csvall file='Flight.csv';

proc freq data=sasuser.Europe;
tables dest*orig /crosslist;
run;
proc print data=sasuser.Europe;
id Dest;
var flight revenue;
run;
ods csvall close;
Super User
Posts: 10,048

Re: CSVAll : output files

I am curious that I run your code and get only one csv file.
What release is your sas?
Or can use an option.


[pre]
ods csvall file='c:\Flight.csv' newfile=none;

proc freq data=sashelp.class;
tables sex*age /crosslist;
run;
proc print data=sashelp.class;
id name;
var sex age;
run;
ods csvall close;
[/pre]



Ksharp
Frequent Contributor
Posts: 100

Re: CSVAll : output files

Thanks! Your solution works great.
I have to apologize that I pasted in the wrong code yesterday. There were titles and footnotes in the code, which might be the reason.

Ods csvall file='Flight.csv';
Title 'Frequency by destination and origin';
Footnote 'Update needed';

Proc freq data=sasuser.Europe;
tables dest*orig /crosslist;
Run;

Title 'Details';
Footnote 'Listed by destination';

Proc print data=sasuser.Europe;
id Dest;
var flight revenue;
Run;
Ods csvall close;
Ask a Question
Discussion stats
  • 2 replies
  • 1202 views
  • 0 likes
  • 2 in conversation