Previous Page | Next Page

The TRANTAB Procedure

Example 6: Using Different Translation Tables for Sorting


Procedure features:

PROC SORT statement option:

SORTSEQ=

Other features:

PRINT procedure


This example shows how to specify a different translation table to sort data in an order that is different from the default sort order. Characters that are written in a language other than U.S. English might require a sort order that is different from the default order.

Note:   You can use the TRABASE program in the SAS Sample Library to create translation tables for several languages.  [cautionend]


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
data testsort;
   input Values $10.;
   datalines;
Always
always
Forever
forever
Later
later
Yesterday
yesterday
;
 Note about code
proc sort;
   by values;
run;
 Note about code
proc print noobs;
   title 'Default Sort Sequence';
run;

SAS Output

 Note about figure
                             Default Sort Sequence                             1

                                   Values

                                   Always   
                                   Forever  
                                   Later    
                                   Yesterday
                                   always   
                                   forever  
                                   later    
                                   yesterday

 Note about code
proc sort sortseq=upper;
   by values;
run;
proc print noobs;
   title 'Customized Sort Sequence';
run;

SAS Output

 Note about figure
                            Customized Sort Sequence                           2

                                   Values

                                   Always   
                                   always   
                                   Forever  
                                   forever  
                                   Later    
                                   later    
                                   Yesterday
                                   yesterday

Previous Page | Next Page | Top of Page