Reading multiple fields
It is common to have a number of fields with the same input format. For instance, if you have a questionnaire with 100 items they all probably are keyed into a 1 or a 2 character field. Consider the following code.
DATA LONGWAY; INPUT ID 1-3 Q1 4 Q2 5 Q3 6 Q4 7 Q5 8 Q6 9-10 Q7 11-12 Q8 13-14 Q9 15-16 Q10 17-18 HEIGHT 19-20 AGE 21-22; DATALINES; 1011132410161415156823 1021433212121413167221 1032334214141212106628 1041553216161314126622 ; PROC PRINT DATA=LONGWAY; TITLE 'Example 9.1'; RUN;
There is no hint in the data where the fields begin and end but it is clear from the INPUT statement that the records are structured to have an ID number, ten questions, and then two fields of demographic information.