[R] SAS

Jonathan Lisic jlisic at gmu.edu
Mon Dec 7 20:18:56 CET 2009


Marshall Feldman <marsh <at> uri.edu> writes:

> 
> Regarding the various methods people have suggested, what if a typical 
> tab-delimited data line looks like:
> 
>       SMS11000000000000001 1990 M01 688.0
> 
> and the SAS INPUT statement is
> 
>     INPUT survey $ 1-2 seasonal $ 3 state $ 4-5 area $ 6-10 supersector 
> $ 11-12 @13 industry $8. datatype $ 21-22  year period $ value footnote $ ;
> 
> Note that most data lines have no footnote item, as in the sample.
> 
> Here (I think) we'd want all the character variables to be read as 
> factors, possibly "year" as a date, and "value" as numeric.
> 
>     Marsh


Hi Marshall, 

Maybe I'm missing the point, but wouldn't read.fwf do most of what you want?

Cheers,

Jonathan




More information about the R-help mailing list