BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ajb
Obsidian | Level 7 ajb
Obsidian | Level 7

This is a first for me and I confused about why sas is giving me the following  log message

 

NOTE: LOST CARD.
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.

 

Here is the code I wrote:

 

data work.pt4;
    input education $ region $  response $  count;
cards;
college west disagree 18    
college west neutral 15   
college west agree 48
college midwest disagree 13    
college midwest neutral 19   
college midwest agree 21
college east disagree 28   
college east neutral 28   
college east agree
hs west disagree 46  
hs west neutral 23   
hs west agree 24
hs midwest disagree 22   
hs midwest neutral 20   
hs midwest agree 21
hs east disagree 48  
hs east neutral 18
hs east agree 23
lesshs west disagree 13  
lesshs west neutral 15
lesshs west agree 28
lesshs midwest disagree 15
lesshs midwest neutral 16
lesshs midwest agree 17
lesshs east disagree 15
lesshs east neutral 17
lesshs east agree 24
;
run;

 

Can someone set me straight? I am assuming that it is a simple problem but I have never encountered it before.

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

It is happening for this line of data ...

 

college east agree

 

Your INPUT statement is looking for 4 variables, but there are only 3 on this line.  So the INPUT statement goes to the next line, looking for a value for COUNT.

 

 

View solution in original post

3 REPLIES 3
Astounding
PROC Star

It is happening for this line of data ...

 

college east agree

 

Your INPUT statement is looking for 4 variables, but there are only 3 on this line.  So the INPUT statement goes to the next line, looking for a value for COUNT.

 

 

ajb
Obsidian | Level 7 ajb
Obsidian | Level 7

Thanks so much! I thought I was losing my mind

Reeza
Super User
Use the TRUNCOVER option to avoid the error, if you are actually missing data.

data work.pt4;
infile cards truncover;
input education $ region $ response $ count;
...
run;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 17286 views
  • 3 likes
  • 3 in conversation