I can't fix this and it keeps giving me errors. I have worked on this for a long time.
proc summary nway missing data=somename.allofthem;
(where = (MBR_STATE="CA"));
var cnt pos neg;
output out=result_by_state (drop=_TYPE_ _FREQ_) sum=;
2970 proc summary nway missing data=somename.allofthem; 2971 (where = (MBR_STATE="CA")); _ 180 170 The SAS System 14:38 Friday, March 24, 2023 ERROR 180-322: Statement is not valid or it is used out of proper order. 2972 var cnt pos neg; 2973 class Mbr_State; 2974 output out=result_by_state (drop=_TYPE_ _FREQ_) sum=; 2975 run;
proc summary nway missing data=somename.allofthem; where MBR_STATE="CA";
this gives errors.
How many times do we have to recommend that when you have errors that you copy the code with the error text and paste it into a text box?
I placed it in a text box. It is in a grey text box. Or I can’t understand what you mean.
I took out semicolon from proc summary and the log still shows that I have placed semicolon after proc summary,
This is what I have: Proc summary…. Var…….; Class; Where….; Run; The log shows that I have ; after proc summary while I deleted ;
Open the log window. Mark the complete text from the beginning of the procedure to the final message. Copy it to the clipboard. Open a window here with the </> button. Paste the clipboard contents into it.
Please go to very first post. You will see that I placed the log.
You were told where the mistake in that code was. Since you still get an ERROR, we need to see the log from the current code you submit.
proc summary data=sashelp.class where Age = 12; class sex; var Height; output out=class sum=sum; run; proc print data=class; run; data test1; set sashelp.class; run;
The result that I get from this program doesn't seem correct. I assume proc summary can't take a where clause. Just I would like to gain confirmation.
a peach on a tree!
You can use a where STATEMENT with PROC SUMMARY, just like with almost every other PROC.
But you forgot to end your PROC statement before you started the WHERE statement.
proc summary data=sashelp.class; where Age = 12; class sex; var Height; output out=class sum=sum; run;
If you never end the PROC statement then is going to try to treat WHERE and AGE as additional syntax on the PROC SUMMARY statement. Neither WHERE or AGE are valid parts of the PROC SUMMARY statement.
thanks for the response. I put semicolon after proc summary, it gives error, really I have changed the location of where and started placing semicolon after proc and then I took it, but no success.
I have be been doing this for three days and no success.
Originally the code was like this:
proc summary ….;
I was running this code for more than two years but all of sudden the word were changed to red and I change the place of where and it edited the code as below:
I am going crazy!
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.