Reading Multiple Records Non-Sequentially

The #n Line Pointer Control

The #n specifies the absolute number of the line where you want to move the input pointer. The #n pointer control can read records in any order. Therefore, it must be specified before the instructions for reading values in a specific record.
The INPUT statement below first reads the values for Department and JobCode in the second record, and then reads the values for Lname and Fname in the first record. Finally, it reads the value for Salary in the third record.
input #2 Department $ 1-12 JobCode $ 15-19 
      #1 Lname $ Fname $ 
      #3 Salary comma10.;
Figure 20.19 The Records of the First Observation

Using the #n Line Pointer Control

The raw data file Patdata contains ...

Get SAS Certification Prep Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.