BookmarkSubscribeRSS Feed
ttxq
Fluorite | Level 6

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.

4 REPLIES 4
Reeza
Super User

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?

ttxq
Fluorite | Level 6

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

Cynthia_sas
SAS Super FREQ
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
ttxq
Fluorite | Level 6

Thank you so much Cynthia.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1235 views
  • 0 likes
  • 3 in conversation