Reading Raw Data in Fixed Fields |
Using Formatted
Input |
Reading Columns in Any Order
Column pointer controls are very useful. For instance, you can use the @n to move a pointer forward or backward when reading a record.
In this INPUT statement, the value for |
input @9 FirstName $5. |
EVANS DONNY 112 29,996.63 |
HELMS LISA 105 18,567.23 |
HIGGINS JOHN 111 25,309.00 |
Now let's read the values for LastName that begin
in the first column. Here, you must use the @n pointer control to
move the pointer back to column 1. |
input @9 FirstName $5. @1 LastName $7. |
EVANS DONNY 112 29,996.63
HELMS LISA 105 18,567.23
HIGGINS JOHN 111 25,309.00
The rest of the INPUT statement indicates the column locations
of the raw data values for JobTitle and Salary . |
input @9 FirstName $5. @1 LastName $7. @15 JobTitle 3. @19 Salary comma9.; |
EVANS DONNY 112 29,996.63
HELMS LISA 105 18,567.23
HIGGINS JOHN 111 25,309.00
The $5. , $7., 3., and comma9. informats are explained later in this lesson. |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.