| Reading Free-Format Data | |
| Modifying List Input |
| Reading Values That Contain Embedded Blanks
The ampersand (&) modifier enables you to read character values that contain single embedded blanks. The & indicates that a character value that is being read with list input may have one or more single embedded blanks. The value is read until two or more consecutive blanks are encountered. The & modifier precedes a specified informat if one is used. input Rank City & . . .
In the raw data file shown below, each value of |
| Using the & Modifier with a LENGTH
Statement
As shown below, you can use a LENGTH statement to define the length of
|
data perm.cityrank;
infile topten;
length City $ 12;
input Rank city &
|
|
| Using the & Modifier with an Informat
You can also read the values for |
data perm.cityrank;
infile topten;
input Rank City & $12.
|
|
| Remember that two consecutive blanks are required delimiters when using the & modifier. You cannot use another delimiter to indicate the end of the field. |
![]() ![]() |
|
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.