BookmarkSubscribeRSS Feed
Mohannad
Calcite | Level 5

Hi all, could you please correct my input, as I got this message, and no results 

Code:

DATA MD1;
INPUT I R RL;
CARDS;
1 1 13
1 2 12
1 3 9
2 1 7
2 2 5
2 3 9
3 1 5
3 2 4
3 3 6
8 1 5
8 2 5
8 3 5
;
PROC ANOVA;
CLASS I R;
MODEL RL = I R;
MEANS I / LSD;
MEANS I /TUKEY;
MEANS I / DUNCAN;
RUN;

 

LOG

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 DATA MD1;
74 INPUT I R RL;
75 CARDS;
 
NOTE: Invalid data for I in line 76 1-6.
NOTE: Invalid data for R in line 77 1-6.
NOTE: Invalid data for RL in line 78 1-5.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
 
78 CHAR 1.3.9
ZONE 30303222222222222222222222222222222222222222222222222222222222222222222222222222
NUMR 19399000000000000000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
I=. R=. RL=. _ERROR_=1 _N_=1
NOTE: Invalid data for I in line 79 1-5.
NOTE: Invalid data for R in line 80 1-5.
NOTE: Invalid data for RL in line 81 1-5.
 
81 CHAR 2.3.9
ZONE 30303222222222222222222222222222222222222222222222222222222222222222222222222222
NUMR 29399000000000000000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
I=. R=. RL=. _ERROR_=1 _N_=2
NOTE: Invalid data for I in line 82 1-5.
NOTE: Invalid data for R in line 83 1-5.
NOTE: Invalid data for RL in line 84 1-5.
 
84 CHAR 3.3.6
ZONE 30303222222222222222222222222222222222222222222222222222222222222222222222222222
NUMR 39396000000000000000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
I=. R=. RL=. _ERROR_=1 _N_=3
NOTE: Invalid data for I in line 85 1-5.
NOTE: Invalid data for R in line 86 1-5.
NOTE: Invalid data for RL in line 87 1-5.
 
87 CHAR 8.3.5
ZONE 30303222222222222222222222222222222222222222222222222222222222222222222222222222
NUMR 89395000000000000000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
I=. R=. RL=. _ERROR_=1 _N_=4
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.MD1 has 4 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
 
88 ;
89 PROC ANOVA;
90 CLASS I R;
91 MODEL RL = I R;
92 MEANS I / LSD;
93 MEANS I /TUKEY;
94 MEANS I / DUNCAN;
95 RUN;
 
ERROR: One or more variables are missing or freq or weight is zero on every observation.
96
97 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
109

 

4 REPLIES 4
Reeza
Super User
Your data doesn't appear to be reading in correctly for some reason, that's the main issue. It reads in fine for me, and the ANOVA generates the expected results.

Is the code shown the actual code you're running?
Shmuel
Garnet | Level 18

Looking at your log it seems that you have a TAB (='09'x ) delimiter.

change your code to:

DATA MD1;
infile cards dlm='09'x truncover;
INPUT I R RL;
CARDS;
.........
ballardw
Super User

When you get invalid data and stuff like this in the log

81 CHAR 2.3.9
ZONE 30303222222222222222222222222222222222222222222222222222222222222222222222222222
NUMR 29399000000000000000000000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.

the two rows Zone an NUMR represent hex values of ASCII codes. You read the top row as the first digit (zone) and the second row as the second character. 09 in hex is a tab character. The 20 hex you see repeated is a simple space.

If you do not tell SAS that tabs are your delimiter then space is used in the data step and you get errors.

 

Your editor should have a "save tabs as spaces" setting. Use that and you shouldn't run into this with entered data in a Cards block.

Reeza
Super User
And this is one of the cases where posting your code into a code block would allow for that to be seen more effectively, as it would be reproducible on someone else's machine. As posted, the HTML or copy/paste strips that issue away.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1451 views
  • 4 likes
  • 4 in conversation