Chapter Contents

Previous

Next
The SORT Procedure

Example 2: Reversing the Order of the Sorted Values


Procedure features:
BY statement option:
DESCENDING
Other features
PROC PRINT
Data set: ACCOUNT

This example


Program

options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
proc sort data=account out=sorted;
 Note about code
   by town descending debt accountnumber;
run;

 Note about code
proc print data=sorted;
 Note about code
   var company town debt accountnumber;
   title  'Customers with Past-Due Accounts';
   title2 'Listed by Town, Amount, Account Number';
run;


Output
Note that sorting last by AccountNumber puts the businesses in Apex with a debt of $37.95 in order of account number. [HTML Output]
 [Listing Output]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.