<?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 in need of help in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/20758#M4317</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you. Was just wondering what does the class statement do. And also I'm still having some trouble with the where statement. But an observation only has 1 value for CAU. thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keddra &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jun 2011 21:21:10 GMT</pubDate>
    <dc:creator>klovewalk</dc:creator>
    <dc:date>2011-06-24T21:21:10Z</dc:date>
    <item>
      <title>in need of help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/20756#M4315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was given the following instructions: Deaths from heart disease comprise the following causes : I00-I09, I11, I13, I20-I51. How many males and females died from heart disease and what was the mean and median age at death for both genders&lt;/P&gt;&lt;P&gt;So I tried the following but am getting errors. Can you assist? Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; color: navy; font-family: 'Courier New'; background-color: white;"&gt;PROC&lt;/STRONG&gt; &lt;STRONG style="font-size: 10pt; color: navy; font-family: 'Courier New'; background-color: white;"&gt;FREQ&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;DATA&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=epi2.heartdis;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; cau*gen;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; cau in (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I00'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I01'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I02'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I03'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I04'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I05'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I06'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I07'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I08'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I09'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;) and cau (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I11'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;and cau (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I13'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;)and (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I20'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;lt;cau&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'I51'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; color: navy; font-family: 'Courier New'; background-color: white;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 19:59:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/20756#M4315</guid>
      <dc:creator>klovewalk</dc:creator>
      <dc:date>2011-06-24T19:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: in need of help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/20757#M4316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; SASHELP.HEART has similar variables, called DEATHCAUSE, SEX and AGEATDEATH. To find out the mean and median ages for each gender and cause of death, I would use PROC MEANS, not PROC FREQ. Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc means data=sashelp.heart n mean median;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; class deathcause sex;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; var ageatdeath;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;You can use a WHERE statement with PROC MEANS and whether the syntax of your WHERE statement is correct, would depend on your data. For example, does an observation only have 1 value for CAU?? In your WHERE statement, would it be possible for an observation to have a CAU value of &lt;SPAN style="font-family: courier new,courier;"&gt;'I06' &lt;/SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt;AND &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;'I13'&lt;/SPAN&gt;??? I'm not sure that your use of the AND operator is what you want, I was envisioning a WHERE statment closer to:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;where &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;(cau in ('I00', 'I01', 'I02', 'I03','I04', 'I05', 'I06', 'I07', 'I08','I09','I11', 'I13'))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;or &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;(cau between 'I20' and 'I51');&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="font-family: arial,helvetica,sans-serif;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;But, you will have to test the WHERE statement on your data. I do believe that you will come closer to getting the mean and median age at death analysis if you use PROC MEANS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;cynthia&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 21:01:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/20757#M4316</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-06-24T21:01:30Z</dc:date>
    </item>
    <item>
      <title>in need of help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/20758#M4317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you. Was just wondering what does the class statement do. And also I'm still having some trouble with the where statement. But an observation only has 1 value for CAU. thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keddra &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 21:21:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/20758#M4317</guid>
      <dc:creator>klovewalk</dc:creator>
      <dc:date>2011-06-24T21:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: in need of help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/20759#M4318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Courier New&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;&amp;nbsp; The CLASS statement tells PROC MEANS to treat SEX and DEATHCAUSE as categories or groups and to break down the analysis based on those groups. You'll have to run the code to see the default output. (I haven't quite mastered posting output. I'll try to post a screen shot as an attachment).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;&amp;nbsp; If you wanted a further breakdown of the mean and median AGEATDEATH for only SEX or only DEATHCAUSE or those single tables in addition to the table for the combination of CLASS variables, then you could add a TYPES statement to your code, which would tell PROC MEANS what combination of CLASS variables you wanted to see. So if you wanted to see all the possible combinations of tables (you can actually use the TYPES or the WAYS statement to control interaction of the CLASS variables):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 18pt;"&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: &amp;amp;quot; Arial&amp;amp;quot;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Times New Roman;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 18pt;"&gt;&lt;SPAN style="font-family: Courier New; font-size: 18pt;"&gt;&lt;STRONG style="font-size: 10pt; font-family: courier new,courier;"&gt;&lt;SPAN style="color: #333333; font-size: 8pt; font-family: Courier New;"&gt;&amp;nbsp; types deathcause sex deathcause*sex;&lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;amp;quot;Courier New&amp;amp;quot;; color: #333333; font-size: 18pt;"&gt; &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: &amp;amp;quot;Courier New&amp;amp;quot;; color: #333333; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Times New Roman;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;Doc: &lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146737.htm"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146737.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;Your WHERE statement is limiting the rows or observations available to PROC MEANS to process. So if your observations can only have 1 value for the CAU variable, then you would want all your tests to use the OR operator. Coding this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot; COLOR; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 0.5in;"&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&lt;SPAN style="color: #333333;"&gt;where ageatdeath in (59, 67, 72); &lt;/SPAN&gt;&lt;SPAN style="color: #333333;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;is the same as coding:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 0.5in;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt;where ageatdeath = 59 or ageatdeath=67 or ageatdeath=72;&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;And, since you don't want to type all the codes in the series from &lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;amp;quot;Courier New&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;I20-I51&lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;, using BETWEEN will allow you to select from among those CAU values, too, as if you had coded them as:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 0.5in;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt;where cau ='I20' or cau='I21' or cau='I22' .... or cau='I51';&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;is the same as &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt;where cau in ('I20','I21', 'I22', .... 'I51');&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: &amp;amp;quot; Arial&amp;amp;quot;"&gt;and the same as &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; color: #333333; font-size: 10pt;"&gt;where cau between 'I20' and 'I51';&lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;the AND, when used with BETWEEN means that the series &lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;amp;quot;Courier New&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt;I20-I51&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt; will be treated logically as you want. All the rest of your major conditions should use an OR operator. So, if you wanted to have a complex condition (not listing all of the values), something like this:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;amp;quot;Arial&amp;amp;quot;,&amp;amp;quot;sans-serif&amp;amp;quot;; color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt;where (cau in ('I01','I03', 'I05', 'I13'))&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt;OR&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; color: #333333; font-size: 10pt;"&gt;(cau between 'I20' and 'I51');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: &amp;amp;quot; Arial&amp;amp;quot;"&gt;would tell the WHERE processor to see whether the obs value for CAU was found in the IN list OR see whether the obs value for CAU fell into the series defined by the BETWEEN condition. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: &amp;amp;quot; Arial&amp;amp;quot;"&gt;Since an obs can only have 1 value for CAU, you would &lt;STRONG style="font-family: &amp;amp;quot; text-decoration;"&gt;not &lt;/STRONG&gt;get correct results if you coded your complex condition as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; color: #333333; font-size: 10pt;"&gt;where (cau in ('I01','I03', 'I05', 'I13'))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; color: #333333; font-size: 10pt;"&gt;AND&amp;nbsp;&amp;nbsp; /* &lt;STRONG style="font-family: &amp;amp;quot;"&gt;not &lt;/STRONG&gt;correct logical operator */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier; color: #333333; font-size: 10pt;"&gt;(cau between 'I20' and 'I51');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: &amp;amp;quot; Arial&amp;amp;quot;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: &amp;amp;quot; Arial&amp;amp;quot;"&gt;I'd recommend getting the code working for the IN group of CAU values, then after you have the PROC MEANS the way you want for that group, modify your WHERE statement to include second condition, using the correct logical operator.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: &amp;amp;quot; Arial&amp;amp;quot;"&gt;cynthia&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="mcePaste" id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 0px; left: -10000px;"&gt;﻿&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;added attachment of LISTING output from PROC MEANS&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11006iBC2C04A4599B9B28/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="output_means.jpg" title="output_means.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 22:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/20759#M4318</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-06-24T22:59:47Z</dc:date>
    </item>
    <item>
      <title>Analyze DeathCause and AgeAtDeath grouped by Status</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/855686#M82433</link>
      <description>&lt;P&gt;I'm analyzing the&amp;nbsp;&lt;STRONG&gt;DeathCause&lt;/STRONG&gt; and &lt;STRONG&gt;AgeAtDeath&lt;/STRONG&gt; grouped by &lt;STRONG&gt;Status and the question is :&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Are &lt;STRONG&gt;DeathCause&lt;/STRONG&gt; and &lt;STRONG&gt;AgeAtDeath&lt;/STRONG&gt; ever non-missing when &lt;STRONG&gt;Status=Alive&lt;/STRONG&gt;?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;This is my response, am I looking at this correct?&amp;nbsp; I keep getting confused the "non-missing" verbiage&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DeathCause and AgeAtDeath are not relative to Status=Alive since the person is Alive so there would be no information to add to the Deathcause and AgeAtDeath categories.&amp;nbsp; DeathCause and AgeAtDeath would be non-missing at Status=Alive&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 04:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/855686#M82433</guid>
      <dc:creator>vsandoval6</dc:creator>
      <dc:date>2023-01-26T04:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Analyze DeathCause and AgeAtDeath grouped by Status</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/855690#M82434</link>
      <description>&lt;P&gt;Post your complete(*) question in a new thread of your own.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*) Include your code, and the entire log of the failing step. Unless you use one of the SASHELP datasets, post example data in a data step with datalines.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 07:02:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/in-need-of-help/m-p/855690#M82434</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-01-26T07:02:35Z</dc:date>
    </item>
  </channel>
</rss>

