I am trying to read this fixed width data into SAS:
John Garcia 114 Maple Ave.
Sylvia Chung 1302 Washington Drive
Martha Newton 45 S.E. 14th St.
I used this code:
libname mysas 'c:\users\LELopez243\mysas';
filename address 'c:\users\LELopez243\mysas\address.dat';
data mysas.address2;
infile address;
input Name $ 1-15 Number 16-19 Street $ 22-37;
run;
proc print data=mysas.address2;
run;
Got this result:
Obs Name Number Street
1 John Garcia 114 Sylvia Chung 1
2 Martha Newton 45
If I edit the .dat file and manually add spaces at the end of each line until they are each the same length, the code works. Any ideas for code that takes into account differing line lengths (w/o manually entering spaces).