Hello,
I would like to know how to eliminate the above mentioned error message after running the following code:
data test;
input name $ age @@;
datalines;
John 13 Monica 12 Sue 15 Stephen 10
Marc 22 Lily 17
;
run;
Regards,
Alain
It might not be worth the trouble, but here's something you can try.
data want;
infile cards truncover;
input @1 @ ;
nrecs = countw(_infile_) / 2;
do _n_=1 to nrecs;
input name $ age @ ;
output;
end;
drop nrecs;
datalines;
John 13 Monica 12 Sue 15 Stephen 10
Marc 22 Lily 17
;
What message? The only message I see is informational:
NOTE: SAS went to a new line when INPUT statement reached past the end of a line. NOTE: The data set WORK.TEST has 6 observations and 2 variables.
Yes you are right. Then what can i do to eliminate this note:
SAS went to a new line when INPUT statement reached past the end of a line.
If your input looks that way, then the message is unavoidable and perfectly natural.
Unless you know beforehand the exact number of items in each line.
You can consider the NONOTES option, but it seems like overkill because it suppresses all notes.
The list of options related to the LOG are in the link below.
Post your code and log, including the ERROR
It might not be worth the trouble, but here's something you can try.
data want;
infile cards truncover;
input @1 @ ;
nrecs = countw(_infile_) / 2;
do _n_=1 to nrecs;
input name $ age @ ;
output;
end;
drop nrecs;
datalines;
John 13 Monica 12 Sue 15 Stephen 10
Marc 22 Lily 17
;
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.