Reading Variable-Length Records |
Reading Variable-Length Fields |
Holding the First Record |
Let's see how we can use reclen to determine
the length of Name in each record. You know that the values
for each employee ID number are always located in columns 1-4 of every record.
So the INPUT statement reads the values for ID .
You must hold the record with the single trailing @
line-hold specifier until the values
for |
1---V----10---+----20 |
1802JOHNSON2123 |
1803BARKER2142 |
1804EDMUNDSON2325 |
1805RIVERS2543 |
1806MASON2646 |
1807JACKSON2049 |
1808LEVY2856 |
1809THOMAS2222 |
data perm.phones; infile phondat length=reclen; input ID 4. @; |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.