SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating a Single Observation from Multiple Records
Reading Multiple Records in Any Order


The #n Line Pointer Control

You already know how to read multiple records in sequential order using the / line pointer control. Now take a look at reading multiple records in any order using the #n line pointer control.

The #n specifies the absolute number of the line to which 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, then the values for Lname and Fname in the first record. Finally, the value for Salary is read in the third record.
 




input #2 Department $ 1-12 JobCode $ 15-19 
      #1 Lname $ 1-8 Fname $ 10-15 
      #3 Salary comma10.;

1---+----10---+----
ABRAMS THOMAS 
MARKETING     SR01
$25,209.03  
BARCLAY ROBERT 
EDUCATION     IN01
$24,435.71  
COURTNEY MARK 
PUBLICATIONS  TW01
$24,006.16  



back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement