DATA Step, Macro, Functions and more

LOST CARD /input statement past end of line?

Accepted Solution Solved
Reply
Occasional Contributor ajb
Occasional Contributor
Posts: 18
Accepted Solution

LOST CARD /input statement past end of line?

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.


Accepted Solutions
Solution
‎10-26-2015 08:02 PM
Super User
Posts: 5,498

LOST CARD /input statement past end of line?

[ Edited ]

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


All Replies
Solution
‎10-26-2015 08:02 PM
Super User
Posts: 5,498

LOST CARD /input statement past end of line?

[ Edited ]

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.

 

 

Occasional Contributor ajb
Occasional Contributor
Posts: 18

Re: LOST CARD /input statement past end of line?

Posted in reply to Astounding

Thanks so much! I thought I was losing my mind

Super User
Posts: 19,770

Re: LOST CARD /input statement past end of line?

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;
🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 2205 views
  • 2 likes
  • 3 in conversation