75 proc sort data=EMPLOYEE_INFO;
76 by descending IDNumber descending Expenses;
NOTE: There were 4 observations read from the data set WORK.EMPLOYEE_INFO.
NOTE: The data set WORK.EMPLOYEE_INFO has 4 observations and 2 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.02 seconds
cpu time 0.03 seconds
The sort procedure orders the observations in a SAS dataset by the values of one or more character or numeric variables. By default, PROC SORT sorts the data in ascending order. To sort data in descending order we need to explicitly define a variable after the DESCENDING keyword. Here we need to sort data sequentially by descending values of Expenses within each descending IDNumber value, so first we need to sort data by variable IDNumber in descending order then by Expenses in descending order.
The following is the newly sorted dataset WORK.EMPLOYEE_INFO:
The one and only FREE resource for general SAS online training as well as study guides for the SAS Base Certification. My goal is to create the SAS Certification prep guide that I never found but always wanted. This should also be a place to come if you are new to the language but are simply looking for online SAS training.