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.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 4396 views
  • 5 likes
  • 6 in conversation