BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tony5
Fluorite | Level 6

I'm still learning SAS and I'm slightly confused once again.

 

I basically have a table and I just want to see the freq distribution of a few variable totals.

 

Sample data:

data have;
	input zip $ branch $ box1_99 box100_199 box199_200;

	datalines;
	501 52--- 1 1 0
	501 81--- 2 0 0
	501 99--- 1 1 6
	101 22--- 2 10 30
	101 23--- 48 24 60
	101 31--- 40 20 50
	101 42--- 56 36 70
	;
run;

proc print;
run;

And from the sample data, this is the output I'd like to see:

Column Totals.png

 

Bonus question: Should I want to see the output for only a specific zip, how should the code be revised?

 

Any help in the right direction would be greatly appreciated.

 

Regards,

Tony

1 ACCEPTED SOLUTION

Accepted Solutions
Tony5
Fluorite | Level 6

Oops. I found the answer just as I was reading more.

 

For the benefit of future newbies like me...

 

proc means sum maxdec=0;
*** where zip=101;
var box1_99 box100_199 box199_200;
run;

View solution in original post

1 REPLY 1
Tony5
Fluorite | Level 6

Oops. I found the answer just as I was reading more.

 

For the benefit of future newbies like me...

 

proc means sum maxdec=0;
*** where zip=101;
var box1_99 box100_199 box199_200;
run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 245 views
  • 0 likes
  • 1 in conversation