<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Proc summary syntax in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866465#M342191</link>
    <description>I have copied the code and place it in a text box. His is what I see.</description>
    <pubDate>Mon, 27 Mar 2023 06:36:43 GMT</pubDate>
    <dc:creator>GN0001</dc:creator>
    <dc:date>2023-03-27T06:36:43Z</dc:date>
    <item>
      <title>Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866249#M342091</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;I can't fix this and it keeps giving me errors. I have worked on this for a long time.&lt;/P&gt;
&lt;P&gt;proc summary nway missing data=somename.allofthem;&lt;BR /&gt;(where = (MBR_STATE="CA"));&lt;BR /&gt;var cnt pos neg;&lt;BR /&gt;class Mbr_State;&lt;BR /&gt;output out=result_by_state (drop=_TYPE_ _FREQ_) sum=;&lt;BR /&gt;run;&lt;/P&gt;
&lt;PRE&gt;2970       proc summary nway missing data=somename.allofthem;
2971        (where = (MBR_STATE="CA"));
            _
            180
&amp;#12;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;&lt;/PRE&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;blue&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 22:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866249#M342091</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2023-03-24T22:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866251#M342093</link>
      <description>&lt;P&gt;Your where clause is a data set option. So delete the semicolon in front of it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 23:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866251#M342093</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2023-03-24T23:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866252#M342094</link>
      <description>&lt;P&gt;Make up your mind.&lt;/P&gt;
&lt;P&gt;Either use the WHERE= dataset option.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary nway missing data=somename.allofthem(where = (MBR_STATE="CA"));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or use a WHERE statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary nway missing data=somename.allofthem;
 where MBR_STATE="CA";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 25 Mar 2023 00:45:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866252#M342094</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-25T00:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866397#M342134</link>
      <description>Hello,&lt;BR /&gt;It is a where clause. The second one gives errors.&lt;BR /&gt;What does data option do? Doesn’t bring same result as where clause?</description>
      <pubDate>Sun, 26 Mar 2023 17:52:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866397#M342134</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2023-03-26T17:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866398#M342135</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;proc summary nway missing data=somename.allofthem;
 where MBR_STATE="CA";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;this gives errors.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 17:55:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866398#M342135</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2023-03-26T17:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866406#M342139</link>
      <description>&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/ledsoptsref/titlepage.htm" target="_blank" rel="noopener"&gt;Data Set Options&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 19:26:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866406#M342139</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-26T19:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866408#M342141</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;proc summary nway missing data=somename.allofthem;
 where MBR_STATE="CA";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;this gives errors.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;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?&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 19:39:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866408#M342141</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-26T19:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866415#M342148</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I placed it in a text box. It is in a grey text box. Or I can’t understand what you mean.&lt;/P&gt;
&lt;P&gt;I took out semicolon from proc summary and the log still shows that I have placed semicolon after proc summary,&lt;/P&gt;
&lt;PRE&gt;This is what I have:
Proc summary….
Var…….;
Class;
Where….;
Run;
The log shows that I have ; after proc summary while I deleted ; 

&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Mar 2023 20:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866415#M342148</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2023-03-26T20:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866418#M342151</link>
      <description>&lt;P&gt;Open the &lt;STRONG&gt;&lt;U&gt;log&lt;/U&gt;&lt;/STRONG&gt; window. Mark the&amp;nbsp;&lt;U&gt;complete&lt;/U&gt; text from the beginning of the procedure to the final message. Copy it to the clipboard. Open a window here with the &amp;lt;/&amp;gt; button. Paste the clipboard contents into it.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 21:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866418#M342151</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-26T21:03:33Z</dc:date>
    </item>
    <item>
      <title>Can we use a where clause in a proc summary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866429#M342180</link>
      <description>&lt;PRE&gt;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;&lt;/PRE&gt;
&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;a peach on a tree!&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 23:27:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866429#M342180</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2023-03-26T23:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use a where clause in a proc summary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866430#M342181</link>
      <description>&lt;P&gt;Yes you can. Correct your syntax error (missing semicolon):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.class;
where Age = 12;
class sex;
var Height;
output out=class sum=sum;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS 101: SAS statements start with a key word and end in a semicolon.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 23:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866430#M342181</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-03-26T23:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use a where clause in a proc summary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866445#M342182</link>
      <description>&lt;P&gt;You can use a where STATEMENT with PROC SUMMARY, just like with almost every other PROC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you forgot to end your PROC statement before you started the WHERE statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.class;
  where Age = 12;
  class sex;
  var Height;
  output out=class sum=sum;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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.&amp;nbsp; Neither WHERE or AGE are valid parts of the PROC SUMMARY statement.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 01:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866445#M342182</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-27T01:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use a where clause in a proc summary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866452#M342183</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;I have be been doing this for three days and no success.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Originally the code was like this:&lt;/P&gt;
&lt;P&gt;proc summary ….;&lt;/P&gt;
&lt;P&gt;var…..;&lt;/P&gt;
&lt;P&gt;class….;&lt;/P&gt;
&lt;P&gt;where….;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;P&gt;proc summary….;&lt;/P&gt;
&lt;P&gt;where….;&lt;/P&gt;
&lt;P&gt;var….;&lt;/P&gt;
&lt;P&gt;clas…..;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;no success&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am going crazy!&lt;/P&gt;
&lt;P&gt;any tips?&amp;nbsp;&lt;BR /&gt;thanks,&lt;/P&gt;
&lt;P&gt;blue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 03:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866452#M342183</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2023-03-27T03:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use a where clause in a proc summary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866455#M342184</link>
      <description>&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;POST.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;THE.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;LOG.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 05:57:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866455#M342184</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-27T05:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use a where clause in a proc summary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866457#M342185</link>
      <description>&lt;P&gt;And do not start a new thread for the same issue. It is really disturbing that we have to tell you such things again and again; in fact, you're not&amp;nbsp;&lt;EM&gt;acting&amp;nbsp;&lt;/EM&gt;respectfully towards us.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 06:02:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866457#M342185</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-27T06:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use a where clause in a proc summary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866461#M342187</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have not started the new thread for same issue. I can’t print log because of phi and if I do so, that would be considered crime and it has jail time.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;thanks for understanding!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I placed it in a dataset from sashelp &amp;nbsp;that every one can make it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;blue&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 06:31:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866461#M342187</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2023-03-27T06:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866462#M342188</link>
      <description>Please go to very first post. You will see that I placed the log.&lt;BR /&gt;Thanks&lt;BR /&gt;Blue</description>
      <pubDate>Mon, 27 Mar 2023 06:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866462#M342188</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2023-03-27T06:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use a where clause in a proc summary?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866463#M342189</link>
      <description>Please kindly go the first post and you will see the log!</description>
      <pubDate>Mon, 27 Mar 2023 06:34:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866463#M342189</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2023-03-27T06:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866464#M342190</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Please go to very first post. You will see that I placed the log.&lt;BR /&gt;Thanks&lt;BR /&gt;Blue&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 06:36:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866464#M342190</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-27T06:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary syntax</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866465#M342191</link>
      <description>I have copied the code and place it in a text box. His is what I see.</description>
      <pubDate>Mon, 27 Mar 2023 06:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-syntax/m-p/866465#M342191</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2023-03-27T06:36:43Z</dc:date>
    </item>
  </channel>
</rss>

