The input statement is used in the datastep to read raw data from data cards and assign the data as values of SAS variables.
The most basic type of input statement is list input. Here the variables are simply listed in the order in which they are to be read from the data cards. Example:
data second;
input name $ age income;
....
The trailing $ denotes the fact that name is to be a
character variable, while age and income are
numeric variables.
NOTE: The value of a character variable read using this simple input statement will be truncated to a length of 8 characters and can contain no embedded blanks. This restriction on character variables can be overcome by using a formatting description called a SAS informat.
As SAS reads raw data from a data card an internal SAS pointer moves along the card and points to the next position from which data will be read. For list input, the pointer moves until reaching the next non-space (non-blank) character.
Placing the @ or @@ at the END of an input statement holds the column pointer in position for the correct processing of data cards in which multiple or incomplete records appear on each card.
Copyright © 1997 by Jerry Alan Veeh. All rights reserved.