Syntax, PROC SORT step:
PROC SORT DATA=SAS-data-set <OUT=SAS-data-set>;
BY <DESCENDING> BY-variable(s);
RUN;
|
proc sort data=cert.admit out=work.wgtadmit; /*#1*/ by weight age; run; proc print data=work.wgtadmit; /*#2*/ var weight age height fee; /*#3*/ where age>30; /*#4*/ run;
1 | The PROC SORT step sorts the permanent SAS data set Cert.Admit by the values of the variable Age within the values of the variable Weight. The OUT= option creates the temporary SAS data set Wgtadmit. |
2 | The PROC PRINT step prints a subset of the Wgtadmit data set. |
3 | The VAR statement selects only the variables Weight, Age, Height, and Fee to be printed in the output. |
4 | The WHERE statement subsets the data by printing only those observations where the values of Age are greater than 30. |
proc sort data=cert.admit out=work.wgtadmit;
by descending weight age;
run;
proc print data=work.wgtadmit;
var weight age height fee;
where age>30;
run;