Advanced variable/informat lists
Depending on the structure of the data and the needs of project, you may want to intermix pointer controls and informats to achieve specific ends.
DATA PAIRS; INPUT @1 ID 3. @6 (QN1-QN5)(1. +3) @7 (QC1-QC5)($1. +3) @26 (HEIGHT AGE)(2. +1 2.); DATALINES; 101 1A 3A 4B 4A 6A 68 26 102 1A 3B 2B 2A 2B 78 32 103 2B 3D 2C 4C 4B 62 45 104 1C 5C 2D 6A 6A 66 22 ; PROC PRINT DATA=PAIRS; TITLE 'Example 9.3'; RUN;
Follow through the execution of the INPUT statement, and you will see that all the numeric QN's are read first and then the character QC's are read. The output of Proc Print is as follows.
Example 9.3 OBS ID QN1 QN2 QN3 QN4 QN5 QC1 QC2 QC3 QC4 QC5 HEIGHT AGE 1 101 1 3 4 4 6 A A B A A 68 26 2 102 1 3 2 2 2 A B B A B 78 32 3 103 2 3 2 4 4 B D C C B 62 45 4 104 1 5 2 6 6 C C D A A 66 22