Reading alph-numeric data

Reading in data that contains numeric and alphabetic characters is a bit different than reading plain numeric variables. The alpha-numeric symbol ($) is required when reading in variables whose values can be letters or numbers (i.e., ownchld=02 or ownc hld=na).

In the following example msapmsa and ownchld are being defined as alpha-numeric.

 data blkmen;
 infile '/usr/shared/race.dat';
*input state $msapmsa  age born grad rearning $ownchld;
 if age=...

NOTE: Another reason to define a variable as alpha-numeric is to maintain a variable's format. For example, when the census tract number 024671 is read into SAS as a numeric variable the leading zero is dropped. The tract value becomes 24671 and a merge based on the tract variable would not be possible with another dataset that contained the complete alpha-numeric tract number (024671). The result would be 0 matches.



W A R N I N G

If you are reading this, it may be that you are using rather old web browsing software that does not support modern international Web technology standards. For a better experience of the Web and this site in particular, please upgrade your web browser software today. The following are good choices: Firefox 2; Opera 9; Safari 3.