DATA Step, Macro, Functions and more

Rollup ?

Reply
SAS Employee
Posts: 73

Rollup ?

Is there a Rollup (sql function) or similar function in SAS to get the total or subtotal ?

Thanks
Trusted Advisor
Posts: 2,115

Re: Rollup ?

IN PROC SQL, there are several. Check the documentation for "summary functions." I don't recall one being called "rollup", but SUM provides subtotals or a total.
SAS Super FREQ
Posts: 8,864

Re: Rollup ?

Hi:
In addition to Doc's suggestion, SAS has reporting procedures like PROC MEANS, PROC TABULATE and PROC REPORT that will produce summary reports (that would only show the subtotals and/or grand totals). PROC REPORT and PROC PRINT have the ability to create "detail" reports where the subtotals and grandtotals are added to the report as extra summary lines. (For purposes of explanation, a detail report contains one report row for every observation in your original dataset or subset, with additional summary lines added to the report; a summary report contains one report row for every summarized group of observations, with additional summary lines added to the report for subtotals and grand totals.)

Some SQL queries are used for reporting purposes, and if this is your goal, then you might investigate the SAS reporting procedures mentioned above (to name just a few).

cynthia
Ask a Question
Discussion stats
  • 2 replies
  • 1718 views
  • 0 likes
  • 3 in conversation