BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
mkeintz
PROC Star

The problem is that what you want is to double count in the ALL row (actually "up to ten" count), for which tabulate does not provide a mechanism.

 

I suggest a data set VIEW with a new variable, to be included in the proc tabulate.

 


data vneed / view=vneed;
  set have (keep=columnvar rowvar1-rowvar10);
  row_count=n(of rowvar:);
run;

proc tabulate data=vneed;
  class columnvar rowvar1-rowvar2;
  var row_count;
  table  rowvar1-rowvar2
         row_count*sum='Col Total'
         ,columnvar;
run;
--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
Curt
Obsidian | Level 7

Hi mkeintz,

 

thanks for you suggestion.

Unfortunately, the code doesn't seem to work: the row_count always displays a zero and the table  shows only one value of each variable.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 16 replies
  • 6379 views
  • 5 likes
  • 6 in conversation