Help using Base SAS procedures

Proc Tabulate All Label Not In Out Data

Reply
Occasional Contributor
Posts: 18

Proc Tabulate All Label Not In Out Data

Hi All,

Can someone help me figure out if I'm missing a subcommand or using the 'all' feature in proc tabulate inapproriately?  I'm creating a table summarizing rates across interactions between a number of student demographic variables.  I'm using the 'all' feature to get the subtotals for each demographic feature, which works fine in the SAS output (HTML or classic).  But, i'm using the out= feature to output the data to then export to Excel.  However, in doing so, the label i apply to 'all' does not come along for the ride, the cells are left blank.

It's obviously not a huge deal to use a data step to populate these cells, but it seems like this is something that's easily avoidable by bringing those labels along.  The code i'm using appears as follows:

proc tabulate data=cgraudit order=data out=summary;

     class school_id school_year school_name sex ethnic ed lep ec;

    var grad_flag;

    format grad_flag pmult.;

    table school_name=' '*(sex=' '(all={label='Total'}))*(ethnic=' '(all={label='Total'}))*(ed=' '(all={label='Total'}))*(lep=' '(all={label='Total'}))*(ec=' '(all={label='Total'})),

        school_year=' '*grad_flag=' '*(mean='%'*f=pmult.)//*misstext='Total'*/;

    run;

Thanks,

Jason

Super User
Posts: 10,483

Re: Proc Tabulate All Label Not In Out Data

The 'Total' is only a value substitue for the class variables.Your original data does not have a value so is missing in the data set.

IF you use a format for the class variables that assigns the text 'Total' for missing values it will appear in the data due to the format. Which should export.

Ask a Question
Discussion stats
  • 1 reply
  • 161 views
  • 0 likes
  • 2 in conversation