SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Reading Free-Format Data
Modifying List Input


You can make list input more versatile by using modified list input. There are two modifiers that can be used with list input.
  • The ampersand (&) modifier is used to read character values that contain embedded blanks.

  • The colon (:) modifier is used to read nonstandard data values and character values longer than eight characters, but without embedded blanks.

You can use modified list input to read the file shown below. This file contains the names of the ten largest U.S. cities ranked in order based on their 1986 estimated population figures.

Notice that some of  the values for city names contain embedded blanks. Also, note that the values representing the population of each city are nonstandard numeric values (they contain commas).


Raw Data File Topten

1---+----10---+----20---+--
 1 NEW YORK  7,262,700 
 2 LOS ANGELES  3,259,340 
 3 CHICAGO  3,009,530 
 4 HOUSTON  1,728,910 
 5 PHILADELPHIA  1,642,900 
 6 DETROIT  1,086,220 
 7 SAN DIEGO  1,015,190 
 8 DALLAS  1,003,520 
 9 SAN ANTONIO  914,350 
10 PHOENIX  894,070 


In the following sections you will learn how to use the ampersand (&) modifier to read the values for city (City). Then you will learn how the colon (:) modifier can be used to read the nonstandard numeric values representing population (Pop86).


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement