O'Reilly logo

SAS Certification Prep Guide, 4th Edition by SAS Institute

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

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 ...

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