data generalburndown;
input Trt$ rep$ seven fourteen twentyeight fiftysix;
datalines;
1 1 3.24 0.71 0.71 0.71
1 2 3.24 0.71 0.71 0.71
1 3 3.24 0.71 0.71 0.71
1 4 3.24 0.71 0.71 0.71
2 1 3.24 3.24 0.71 0.71
2 2 3.24 3.24 0.71 0.71
2 3 3.24 3.24 0.71 0.71
2 4 3.24 3.24 0.71 0.71
3 1 3.24 3.24 0.71 0.71
3 2 3.24 3.24 0.71 0.71
3 3 3.24 3.24 0.71 0.71
3 4 3.24 3.24 0.71 0.71
4 1 3.24 3.24 0.71 0.71
4 2 3.24 3.24 0.71 0.71
4 3 3.24 3.24 0.71 0.71
4 4 3.24 3.24 0.71 0.71
5 1 9.58 9.71 8.09 0.71
5 2 9.25 9.58 3.94 0.71
5 3 9.58 9.51 8.97 0.71
5 4 9.71 9.04 6.36 0.71
6 1 8.54 8.69 0.71 0.71
6 2 8.25 7.62 0.71 0.71
6 3 9.04 7.94 0.71 0.71
6 4 9.64 7.28 0.71 0.71
7 1 9.51 8.83 4.53 0.71
7 2 9.64 9.25 8.09 0.71
7 3 9.11 8.54 4.53 0.71
7 4 9.38 8.40 4.24 0.71
8 1 9.45 5.52 8.40 0.71
8 2 9.51 4.53 4.80 0.71
8 3 9.25 6.93 4.53 0.71
8 4 9.31 5.96 5.52 0.71
9 1 8.54 2.35 5.52 0.71
9 2 6.36 2.83 2.35 0.71
9 3 8.09 0.71 0.71 0.71
9 4 8.09 5.05 0.71 0.71
10 1 8.09 8.25 0.71 0.71
10 2 9.38 6.36 0.71 0.71
10 3 9.11 8.69 0.71 0.71
10 4 8.97 7.11 0.71 0.71
11 1 9.77 8.09 8.83 0.71
11 2 9.38 7.94 6.93 0.71
11 3 9.58 8.54 6.36 0.71
11 4 9.64 8.69 5.05 0.71
12 1 3.24 9.31 0.71 0.71
12 2 5.05 9.25 3.24 0.71
12 3 3.94 9.51 3.24 0.71
12 4 3.24 9.18 3.24 0.71
13 1 0.71 0.71 0.71 0.71
13 2 0.71 0.71 0.71 0.71
13 3 0.71 0.71 0.71 0.71
13 4 0.71 0.71 0.71 0.71
;
proc means stderr;
var seven fourteen twentyeight fiftysix;
class Trt;
run;
proc anova;
class Trt rep;
model seven fourteen twentyeight fiftysix=Trt rep;
means Trt rep/lsd tukey;
run;
Where's the log?
Every single one of those "invalid data" messages means one or more variables are missing.
Get enough of those and you don't have complete records to model from
Fix your read program.
A large economy sized clue appears in this:
Trt=113.24 rep=123.24 seven=. fourteen=. twentyeight=. fiftysix=. _ERROR_=1 _N_=1
The _N_=1 tells you the problem occurred with the first iteration of the data step, so check you data lines closely
ZONE 30303233032330323303233222222222222222222222222222222222222222222222222222222222 NUMR 29293E2493E2490E7190E71000000000000000000000000000000000000000000000000000000000
And those 09 highlighted above tells me that your data you are reading is extremely likely to be TAB delimited.
Which would mean that you need
INFILE datalines dlm='09'x;
That's one dirty log.
1. Always look at the log and fix the data until the log is squeaky clean
2. Always look at the data. Why wouldn't you check that it looks clean?
@ChrisNZ ouh, sorry.. i'm new here.. how do i show the error log? i cannot paste the log here.
Hi @Afham
Welcome!
Of course you can paste the log, it is just text.
Use the </> icon so it is formatted properly.
That data set does not create any error or warnings in the log. So how representative of your actual data is it?
A style point to address, while SAS does not require you to state the name of the data set to use for input and will use the last created data set it is highly recommended to always specifically name the data set you intend to use with the Data= option.
That way there is never a question as to exactly which input set is used.
Consider: you run a regression and ask for an output parameters data set. Then realize you missed one of the options you intended to request. If you add the option but do not have the Data= input set specified the regression will use the just created output parameter set for the input. A different input data set is quite often going to generate one or more problems, at a minimum quite unexpected output if not actual errors.
Second, Proc Anova is one of the "interactive" procedures that allows multiple "run;" statements. You want to end it with a Quit; statement.
Your code as posted does indeed create the ERROR, because you have tabs in the datalines, and that causes the INPUT statement to skip over lines and set all variables from the 3rd to missing. Maxim 3: Read the Log.
Adding a matching INFILE statement:
infile datalines dlm='09'x dsd truncover;
created the dataset correctly, and PROC ANOVA ran without ERRORs.
thank you @ChrisNZ @Kurt_Bremser and @ballardw for your response. i try to run my code on my friends computer and it run without any problem. it seems that my sas edition or my computer is broken because i just copy and paste the same command in his computer and get the result without problem. sorry for all the inconvenient.
If your friend has the editor set to replace tabs with blanks, that could explain why it works with her/him.
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!
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.