The SAS Output Delivery System and reporting techniques

csv output format

Reply
Occasional Contributor
Posts: 7

csv output format

Hi all, 

I just got a question about csv output file.

This is the headings I got from ods csv 

2013   2014   2015   
TotalADMISSION RECORD FOUND  TotalADMISSION RECORD FOUND  TotalADMISSION RECORD FOUND  
 FoundNot found9FoundNot found9FoundNot found9  
NumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber

but what I want is 

2013   2014   2015   
TotalADMISSION RECORD FOUND  TotalADMISSION RECORD FOUND  TotalADMISSION RECORD FOUND  
 FoundNot found9 FoundNot found9 FoundNot found9

What should I do to adjust the headings, Thanks a lot.

Grand Advisor
Posts: 16,316

Re: csv output format

Post your code. 

 

CSV is comma delimited file, is this the type of file you want, or do you want an Excel file?

Also, what version of SAS do you have?

Occasional Contributor
Posts: 7

Re: csv output format

ODS csv FILE = "test.csv" ;

proc tabulate missing format=7. formchar=' ' data=a;
class statefip sub recfnd disyr / preloadfmt;
tables statefip all, sub all, disyr*(all recfnd) /box='Characteristics' condense rts=53 printmiss misstext='0';
keylabel N='Number' ALL='Total' PctN='Pct';
run;

ods csv close;

 

Yes, the csv file is what I want. And I use SAS 9.4

SAS Super FREQ
Posts: 8,643

Re: csv output format

Hi: It appears that you do not want "Number" to appear in the results. Is that correct? Your code is putting "Number" in the final row of header cells. You should be able to suppress it by altering your KEYLABEL statement.

Instead of this:
keylabel N='Number' ALL='Total' PctN='Pct';

Try this:
keylabel N=' ' ALL='Total' PctN='Pct';

after the N=, it is quote-space-quote.

cynthia
Occasional Contributor
Posts: 7

Re: csv output format

Thank you so much Cynthia.

Post a Question
Discussion Stats
  • 4 replies
  • 178 views
  • 0 likes
  • 3 in conversation