O'Reilly logo

Combining and Modifying SAS® Data Sets: Examples Second Edition by Michele M. Burlew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example 9.7 Shifting Nonmissing Values Left in an Observation

Goal

Shift to the left the nonmissing values in a list of values that are stored in an array.

Example Features

Featured StepDATA step
Featured Step Options and StatementsArray processing MAX, N, WHICHN functions
Related TechniqueDATA step: Array processing, MAX, N, WHICHN functions

Input Data Set

Data set TEST_MONTHS contains the admission test scores for five applicants over a six-month period.

                          TEST_MONTHS

Obs   applicant   sept09   oct09   nov09   jan10   feb10   mar10
 1     BN0Q6B       387       .       .       .     381       .
 2     ENAD1C       297     327       .     354       .       .
 3     EM5OBF       252       .     301       .       .     276
 4     HVPGZH         .       .       .       .       .     398
 5     2V1E4D       365       .       .       .       .       .

Resulting Data Set

Output 9.7 ADMISSION_TESTS Data Set

 Example 9.7 ADMISSION_TESTS Obs applicant ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required