I have a raw data file charity.dat which I have attached with this question. This file contains data about donations made. It contains a charity ID and amount. Following is the code which i have wrote to read the data.
data donate07;
length ID $4.;
infile 'E:\SAS data\Data\base data set\lwprg2\charity.dat';
input ID $ Amount @@;
run;
In the raw data file you can see that the amount 875 is at the starting of the third line. My question here is when during execution line pointer reaches the end of the second data line it wont be able to find amount for that corresponding charity id, therefore in output data set the value of amount there should be a period,since according to my understanding @@ will block the input buffer until the line pointer reaches end of the dataline currently being read. but in output I can see that the data was read correctly and in logs i can see
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
Can anybody please help me in understanding this concept.
There is a default option for infile, FLOWOVER. If the current input statement is trying to read more variables than are currently available then it continues on the next line which generates the warning. The note is basically to let you know something may be going on in your data you possibly didn't expect.
So with two variables on the input coupled with trailing @@ the input reads the first two values, then the nex two etc. When it gets to the end of the second line there is only one value to read so it is read and then the advance to the next line. And continues to the end of the data.
There is a default option for infile, FLOWOVER. If the current input statement is trying to read more variables than are currently available then it continues on the next line which generates the warning. The note is basically to let you know something may be going on in your data you possibly didn't expect.
So with two variables on the input coupled with trailing @@ the input reads the first two values, then the nex two etc. When it gets to the end of the second line there is only one value to read so it is read and then the advance to the next line. And continues to the end of the data.
Hi, this isn't a warning. It is a NOTE. It is describing exactly what happened. So, for example, see this screen shot:
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.