Problem The original code from the question: data sales;
input EmployeeID $ 1-9 Name $ 11-29 @30 HireDate date9. Salary HomePhone $;
format HireDate date9.;
datalines;
429685482 Martin, Virginia 09aug1990 34800 493-0824
244967839 Singleton, MaryAnn 24apr1995 27900 929-2623
996740216 Leighton, Maurice 16dec1993 32600 933-6908
675443925 Freuler, Carl 15feb1998 29900 493-3993
845729308 Cage, Merce 19oct1992 39800 286-0519
;
proc print data=sales; run; This code produces the following incorrect output: Solution The correct code for the 'name' var defines the input with an "&" and requires rows to have two spaces between columns. SAS reads in the next variable when the space between columns is more than two (>2): data sales1;
input EmployeeID $9. Name & $29. HireDate date9. Salary HomePhone $;
format HireDate date9.;
datalines;
429685482 Martin, Virginia 09aug1990 34800 493-0824
244967839 Singleton, MaryAnn 24apr1995 27900 929-2623
996740216 Leighton, Maurice 16dec1993 32600 933-6908
675443925 Freuler, Carl 15feb1998 29900 493-3993
845729308 Cage, Merce 19oct1992 39800 286-0519
;
proc print data=sales1; run; The following output shows what I think you're looking for: For more information, see Method 3 here: HOW DO I READ IN A CHARACTER VARIABLE WITH VARYING LENGTH IN A SPACE DELIMITED DATASET? | SAS FAQ
... View more