Help using Base SAS procedures

HOW TO GIVE ORDER TO COMPUTED VARIABLES IN PROC REPORT

Reply
Super Contributor
Posts: 276

HOW TO GIVE ORDER TO COMPUTED VARIABLES IN PROC REPORT

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....

Regular Contributor
Regular Contributor
Posts: 156

HOW TO GIVE ORDER TO COMPUTED VARIABLES IN PROC REPORT

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

Ask a Question
Discussion stats
  • 1 reply
  • 170 views
  • 3 likes
  • 2 in conversation