Creating a Single Observation from Multiple Records | |
Combining Line Pointer Controls |
The forward slash (/) line pointer control and the #n line pointer control may be used in combination within a SAS program to read multiple records in both sequential and nonsequential order. |
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; |
|
|
You can also use just the #n line pointer control (as shown earlier in this lesson and below) to read the variables in the order shown above. |
data perm.patients; infile patdata; input #4 ID $5. #1 Fname $ Lname $ #2 Address $23. #3 City $ State $ Zip $ #4 @7 Doctor $6.; run; |
|
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.