Hi, I'm trying to run some very simple code to read a file (attached). I expect 7 variables Q1 through 7 each with one one-digit number; however, the code below gives me a 7 digit number in Q1, the age in Q2, the IQ in Q3. I tried putting spaces between the Q1-Q7 data in the dat file, but then I get every variable with only one digit (i.e., AGE will be one digit with the second digit being placed in IQ). I'm a new SAS user working my way through exercises and this was one that I couldn't make work (even using a datalines statement instead of infile). Thanks data D1;
infile 'C:/Users/myname/Desktop/volunteer.txt';
input #1 @1 Q1-Q7 1.
@9 AGE 2.
@12 IQ 3.
@16 NUMBER 2.
@19 SEX $1. ;
RUN;
... View more