INPUT statement as long as you mix them in a way that appropriately describes the raw
data records. For example, this DATA step uses all three input styles:
input IdNumber 1
Name $18. 2
Team $ 25-30 3
1023 David Shaw red 189 165
1049 Amelia Serrano yellow 145 124
1219 Alan Nance red 210 192
1246 Ravi Sinha yellow 194 177
1078 Ashley McKnight red 127 118
1221 Jim Brown yellow 220 .
proc print data=club1;
title 'Weight Club Members';
The following list corresponds to the numbered items in the preceding program:
The variables IdNumber, StartWeight, and EndWeight are read with list input.
The variable Name is read with formatted input.
The variable Team is read with column input.
The following output demonstrates that the data is read correctly.
Figure 4.13 Data Set Created with Mixed Styles of Input
Understanding the Effect of Input Style on Pointer Location
Why You Can Get into Trouble By Mixing Input Styles
When you mix styles of input in a single INPUT statement, you can get
unexpected results if you do not understand where the input pointer is
positioned after SAS reads a value in the input buffer. As the INPUT statement
reads data values from the record in the input buffer, it uses a pointer to keep track of
its position. Read the following sections so that you understand how the pointer
66 Chapter 4 • Starting with Raw Data: The Basics