BookmarkSubscribeRSS Feed
kuridisanjeev
Quartz | Level 8

Dear all,

namesubject1subject2
sanjeev35

40

chaithu

99

100
karthik5625
ramakanth2596
shiva1099

I am applying proc report to above data and computing new variale "total" by adding subject1 and subject2.

i want to print that new variable in descending order....

proc report data=test;

columnname subject1 subject2 total;

define total/computed  ;

compute total;

total=_c2_/_c3_;

endcomp;

run;

help me....

1 REPLY 1
Eva
Quartz | Level 8 Eva
Quartz | Level 8

Dear kuridisanjeev,

I don't think that this is possible within the same proc report. Because proc report works from top the bottom and within that from left to right. You would need a step after that to sort the data.

I suggest you do the sum for "total" in a data step before the proc report and then do the proc report and define the new variable as order / group.

Best wishes,

Eva

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 1309 views
  • 3 likes
  • 2 in conversation