Example 10: Code
Consider the following example code that reads the same three fields from records that may be laid out in two different ways.
DATA MIXED;
INPUT @20 TYPE $1. @;
IF TYPE = '1' THEN
INPUT ID 1-3
AGE 4-5
WEIGHT 6-8;
ELSE IF TYPE = '2' THEN
INPUT ID 1-3
AGE 10-11
WEIGHT 15-17;
DATALINES;
00134168 1
00245155 1
003 23 220 2
00467180 1
005 35 190 2
;
PROC PRINT DATA=MIXED;
TITLE 'Example 10';