Example 9.6 Sorting Variable Values within an Observation
Sort a series of character variable values and a series of numeric variable values within an observation.
|Featured Step||DATA step|
|Featured Step Options and Statements||CALL SORTC and CALL SORTN CALL routines LARGEST, ORDINAL, and SMALLEST functions|
|Related Technique||DATA step and ORDINAL function: ORDINAL sort in descending order|
Input Data Set
Data set ADSURVEY contains responses from five partipants in a survey for a store. The three character variables NOTICED1, NOTICED2, and NOTICED3 list where the respondent saw an ad. The three numeric variables AMOUNT1, AMOUNT2, and AMOUNT3 are the amounts spent (if positive) or refunded (if negative) as recalled by the respondent ...