02-25-2016 01:50 PM
Flat file structure is as below
dan 23 45
bob 44 50
sue 30 80
mam 40 50
The following code is submitted.
infile ‘file specification’;
input x $ 1-3;
if x='sue' then input age 5-6;
else input height 8-9;
what would be the value of variable AGE in the dataset TEMP when
variable X has the value ‘Sue’?
02-25-2016 02:27 PM
A program is not obliged to read in all the data on every line. You can pick and choose what you want to read and what you want to skip. So when the INPUT statement ends, that's the signal to SAS that you're done with that line of data and don't want to read any more items from it.
In this program, then, the subsequent INPUT statement is reading from the next line of data.