Reading Data That Is Aligned in Columns
Understanding Column Input
With column
input, data values occupy the same fields within each data record.
When you use column input in the INPUT statement, list the variable
names and specify column positions that identify the location of the
corresponding data fields. You can use column input when your raw
data is in fixed columns and does not require the use of informats
to be read.
Program: Reading Data Aligned in Columns
The following program also uses the health and fitness
club data, but now two more data values are missing. The data is aligned
in columns and SAS reads the data with column input:
data club1;input IdNumber 1-4 Name $ 6-11 Team $ 13-18 StartWeight 20-22
EndWeight 24-26
; datalines; ...
Get Step-by-Step Programming with Base SAS 9.4 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.