Help using Base SAS procedures

proc tabulate percentage numerator/denominator

Frequent Contributor
Posts: 133

proc tabulate percentage numerator/denominator

Hi SAS Experts,

I have been digging for many hours through the internet now but could not find a way to calculate the simple percentage of (N/sgu)*100.

proc tabulate data=data.data01;

class main_cat_text sub_cat_text timeframe;

var normmw nummberOf_nnnb nummberOf_b sgu rwsgalt rwsgneu;

table main_cat_text='Main Cat'*sub_cat_text='SubCat'*timeframe='timeframe',

    N='nummberOfahl' nummberOf_nnnb='nummberOfahl NN/NB'*f=4.0 nummberOf_b='nummberOfahl B'*f=4.0

    normmw=' '*(min mean median p75 p90 p95 max)

    rwsgalt='RW/SG old'*mean rwsgneu='RW/SG new'*mean sgu='nummberOfahl>RW/SG' *f=4.0;


Reading through various PDF´s I tried to adjust solutions to suit my proc tabulate but....none worked. Error are many, most common:

There are multiple analysis variables associated with a single table cell in the following nesting : MAIN_CAT_TEXT *

       Main_KAT_TEXT * timeframe* All * nummberOf_nnnb * 'sgu'n * Sum.

main_cat_text All='Total',nummberOf_nnnb*sgu*(sum colpctn) ALL='Total';

main_cat_text all, (N='Gender (Count)'all)*n*f=4.(sgu='Gender (%)'all)*PCTN/box='Example of using PCTN';

(N all)*sgu*(sum*f=dollar10. rowpctsum) / rts=8;

It would be greatly appreciated if you could help to enlighted me what am I not understanding here.


Super User
Posts: 13,523

Re: proc tabulate percentage numerator/denominator

Provide some data we can use, what you want the output to look like and reduce the example code to just the elements of interest.

Are you actually trying to divide the count of records (N) by individual values of SGU or a sum of SGU?

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation