Hello, I'm bit new in SAS. I have a dataset made via a proc report like this one:
Central Generation
Central1 394
Central2 8384
Central3 384
Total H (sum)
Central4 2342
Central5 2321
Total T (sum)
Total Agent (total sum)
What I want is change the position of the 'Total' rows to the beggining of each block. The original dataset has 52 of these blocks, I mean, somethig like this
Central Generation
Total Agent (total sum)
Total H (sum)
Central1 394
Central2 8384
Central3 384
Total T (sum)
Central4 2342
Central5 2321
Is there any way to perform this? Thanks in advance.
@MathJack901015 wrote:
Hello, I'm bit new in SAS. I have a dataset made via a proc report like this one:
Central Generation
Central1 394
Central2 8384
Central3 384
Total H (sum)
Central4 2342
Central5 2321
Total T (sum)
Total Agent (total sum)
What I want is change the position of the 'Total' rows to the beggining of each block. The original dataset has 52 of these blocks, I mean, somethig like this
Central Generation
Total Agent (total sum)
Total H (sum)
Central1 394
Central2 8384
Central3 384
Total T (sum)
Central4 2342
Central5 2321
Is there any way to perform this? Thanks in advance.
You might be able to do the "report" with proc tabulate as that allows group totals to come first.
proc tabulate data=sashelp.class; class age sex; table all='Overall Count' ( age='')*(all='Age Count' sex=''), n; run;
Proc tabulate also creates output data sets but working with them may be a tad daunting.
Use
break before cental/summarize;
rbreak before cental/summarize;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.