Valid in: | DATA step |
Category: | File-handling |
Type: | Executable |
The pointer continues to read until the next blank column is reached. However, if the field is longer than the formatted length, then the value is truncated to the length of variable.
reads
data values that need the additional instructions that informats can
provide but that are not aligned in columns.1
|
|
1Use formatted input and pointer controls to quickly read data values that are aligned in columns. |
data jansales; input item : $10. amount comma5.; datalines; trucks 1,382 vans 1,235 sedans 2,391 ;
input item $10. +1 amount comma5.;
----+----1----+----2----+----3----+ Joseph 11 Joergensen red Mitchel 13 Mc Allister blue Su Ellen 14 Fischer-Simon green
data scores2; length Team $ 14; infile datalines delimiter=','; input Name $ Score1-Score3 Team $ Final_Date:MMDDYY10.; format final_date weekdate17.; datalines; Joe,11,32,76,Red Racers,2/3/2007 Mitchell,13,29,82,Blue Bunnies,4/5/2007 Susan,14,27,74,Green Gazelles,11/13/2007 ; proc print data=scores2; var Name Team Score1-Score3 Final_Date; title 'Soccer Player Scores'; run;
data scores; infile datalines dsd; input Name : $9. Score1-Score3 Team ~ $25. Div $; datalines; Joseph,11,32,76,"Red Racers, Washington",AAA Mitchel,13,29,82,"Blue Bunnies, Richmond",AAA Sue Ellen,14,27,74,"Green Gazelles, Atlanta",AA ;