Combining Line Pointer Controls
The forward slash (/) line pointer
control and the #n line pointer
control can be used together in a SAS program to read multiple records
both sequentially and non-sequentially.
For example, you could
use both the / line pointer control and the #n line
pointer control to read the variables in the raw data file Patdata
in the following order:
1. ID 2. Fname 3. Lname 4. Address |
5. City 6. State 7. Zip 8. Doctor |
data perm.patients; infile patdata; input #4 ID $5. #1 Fname $ Lname $ / Address $23. / City $ State $ Zip $ / @7 Doctor $6.; run;
Figure 20.29 Raw Data File with the First Four Records Highlighted
-
To read the values for ID in the fourth record, specify #4 before naming the variable ...
Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.