INPUT NAME :$25. AGE GENDER :$1.; DATALINES; RASPUTIN 45 M BETSY ROSS 62 F ROBERT LOUIS STEVENSON 75 M Proc Print; Title 'Blanks in List Input';
List input uses blanks as field delimiters (one or more blank). Since there are single blanks within the names, the above code will not work.
Output
Blanks in List Input OBS NAME AGE GENDER 1 RASPUTIN 45 M 2 BETSY . 6 3 ROBERT . S
Log
27 DATA WontWork; 28 INPUT NAME :$25. AGE GENDER :$1.; 29 DATALINES; NOTE: Invalid data for AGE in line 31 7-10. RULE:----+----1----+----2----+----3----+----4----+----5 31 BETSY ROSS 62 F NAME=BETSY AGE=. GENDER=6 _ERROR_=1 _N_=2 NOTE: Invalid data for AGE in line 32 8-12. 32 ROBERT LOUIS STEVENSON 75 M NAME=ROBERT AGE=. GENDER=S _ERROR_=1 _N_=3 NOTE: The data set WORK.WONTWORK has 3 observations and 3 variables.