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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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