SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Reading Variable-Length Records
Reading Records with a Varying Number of Fields


The first three lines of the DATA step are similar to the previous example.

     data perm.health;    
        infile bpdata length=reclen;
        input ID 4. @; 
The LENGTH= option creates a variable named reclen, whose value is the length of the current record. Later you can use reclen to specify how many times to execute an INPUT statement that reads the values which represent date and blood pressure readings.

The trailing @ line-hold specifier at the end of the INPUT statement holds the current record so that a later INPUT statement can read the values for Date and BP.


back||next


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

Terms of Use & Legal Information | Privacy Statement