09-19-2016 03:18 PM - last edited on 09-19-2016 03:25 PM by Reeza
Hello Sas community; /* gives a summary of a variable age */ Every time I run this code,it gives an error saying VAR AGE IS OUT OF ORDER.
PROC MEANS DATA = sun.demographics NWAY MISSING; N NMISS MEAN MIN P1 P5 P10 P25 P50 P75 P90 P95 P99 MAX; VAR AGE;; RUN;
Where as when I run this code , it gives an output.:
PROC MEANS DATA = sun.demographics NWAY MISSING; VAR AGE;; RUN;
Please can somebody explain why the first code keeps giving me an error? with Regards!
09-19-2016 03:25 PM
The code that doesn't run:
PROC MEANS DATA = sun.demographics NWAY MISSING; N NMISS MEAN MIN P1 P5 P10 P25 P50 P75 P90 P95 P99 MAX;
Has a ; after missing. That ends the Proc means statement.
You are likely misunderstanding that an error message like:
ERROR 180-322: Statement is not valid or it is used out of proper order.
Is actually referring to the line Above where the message appears in the log. There should be an underscore under the N. That indicates that the place you referred to the N statistic is incorrect.
09-19-2016 03:34 PM
In addition to the extra semicolon, note that the message you got is consistent with your actual program containing this statement:
If that statement appears in the code, it needs to come out. The VAR statement is correct.
09-19-2016 03:42 PM
09-19-2016 03:50 PM
Please post your code using the input box opened by "running man" icon on the top row. Your unformatted code is very hard to read.
And the question has been answered.