Greetings:
Got confused here while learning how informat works in reading raw data files. Could any expert give a hint?
Raw data in a txt file:
NewYork 12
LA 24
Here is what I tried first.
data work.ny;
infile ny;
input city $7. visit;
run;
This landed me with only the first row plus an error message:
SAS went to a new line when INPUT statement reached past the end of a line.
Could someone help me to understand why would SAS reach past the end of the first line at all? I know if "LA" is "Seattle" (a longer value), my code will work fine so I don't think the first ob is the problem. To stop SAS reaching past the end, I tried MISSOVER. This did bring in a second row with values missing. In the end, I had to use a colon modifier.
My SAS book says "The informat in modified list input determines only the length of the variable, not the number of columns that are read. " But in this case if I don't use an informat for city, the original code will work fine so I'm puzzled.
Thank you for your time!
... View more