IF TYPE = '1' OR TYPE = '01' THEN ... ... lines ommitted ELSE IF TYPE = '2' OR TYPE = '02' THEN ...
Not too bad in this case but what if TYPE was a 3 or 4 character variable? What if TYPE could have 20 discrete values rather than just two. The possibilities quickly get unwieldy.
In general, it is probably better to go with the change of code below.
DATA MIXED; INPUT @20 TYPE 2. @; 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 01 005 35 190 02 ;
This code works just fine. TYPE is numeric so even though the characters that are read in the last data line are 02, the value that is stored internally is 2.