<?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: missing 999 proc means in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/759061#M80863</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/386910"&gt;@Malk020&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have tried your code, but does not work. The values (Numbers )in the table still the same do not convert to missing value.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In cases like these, we need to see the EXACT code you are using, and also a portion of your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DO NOT ATTACH FILES. Include the code you are using in the code box (click on the little running man icon) and include a portion of your data as SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;instructions&lt;/A&gt;).&lt;/P&gt;</description>
    <pubDate>Tue, 03 Aug 2021 15:50:20 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-08-03T15:50:20Z</dc:date>
    <item>
      <title>missing 999 proc means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/491847#M72195</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to do proc means on some variables on a dataset. I do have missing observations for each variable and it's set as 999. How do I exclude those missing observations from analysis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc means data=new;&lt;BR /&gt;var age educ sadyrs&amp;nbsp;pslgthyrs;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only know how to do it for each variable separately (see below):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc means data=&lt;/SPAN&gt;&lt;SPAN&gt;new (where=(age ne 999))&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var age&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Sep 2018 20:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/491847#M72195</guid>
      <dc:creator>starz4ever2007</dc:creator>
      <dc:date>2018-09-01T20:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: missing 999 proc means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/491852#M72196</link>
      <description>&lt;P&gt;You cannot easily. You could try and combine the where clause but then all records with any variable with 999 would be excluded.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally you can recode the 999 to a SAS missing value. If you have multiple issues for missing you can use multiple missing codes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an example that would create a view and then you would run PROC MEANS on it. It only runs when you call proc means and doesn't create a data set that lingers around.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp_recode/ view= temp_recode ;
set have;

array recode(*) var1-var200;

do i=1 to dim(recode);

if recode(i) = 999 then recode(i) = .N; *not applicable;
else if recode(i) = 888 then recode(i)=.K; *did not know;
else if recode(i) = 777 then recode(i) = .M; *missing;

end;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/96249"&gt;@starz4ever2007&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to do proc means on some variables on a dataset. I do have missing observations for each variable and it's set as 999. How do I exclude those missing observations from analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc means data=new;&lt;BR /&gt;var age educ sadyrs&amp;nbsp;pslgthyrs;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only know how to do it for each variable separately (see below):&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc means data=&lt;/SPAN&gt;&lt;SPAN&gt;new (where=(age ne 999))&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var age&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Sep 2018 22:06:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/491852#M72196</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-01T22:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: missing 999 proc means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/759059#M80862</link>
      <description>&lt;P&gt;I have tried your code, but does not work. The values (Numbers )in the table still the same do not convert to missing value.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 15:45:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/759059#M80862</guid>
      <dc:creator>Malk020</dc:creator>
      <dc:date>2021-08-03T15:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: missing 999 proc means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/759061#M80863</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/386910"&gt;@Malk020&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have tried your code, but does not work. The values (Numbers )in the table still the same do not convert to missing value.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In cases like these, we need to see the EXACT code you are using, and also a portion of your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DO NOT ATTACH FILES. Include the code you are using in the code box (click on the little running man icon) and include a portion of your data as SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;instructions&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 15:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/759061#M80863</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-03T15:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: missing 999 proc means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/759071#M80864</link>
      <description>&lt;P&gt;I think i do not understand you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please kindly see the code. The code is run perfectly as i want&amp;nbsp; and makes two tables. The problem is in the second&amp;nbsp; Proc Tabulate(Numerical variables) when I run the code I got some values over 1000 and I just want to set up them as a missing value!!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-wrap self"&gt;&lt;P class="body"&gt;proc contents data =&amp;nbsp; .. ;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;* Categorical Variables;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;PROC FREQ DATA = …;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;TABLES ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; RUN; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; *Numerical Variables;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;proc means data =…;&amp;nbsp;&lt;BR /&gt;var ;&amp;nbsp;&lt;/P&gt;&lt;P class="body"&gt;RUN;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*** Crate a format *****;&lt;BR /&gt;&lt;BR /&gt;proc format;;&lt;BR /&gt;value&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;1=''&lt;BR /&gt;&lt;BR /&gt;2='';&lt;BR /&gt;value&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;1 = 'M'&lt;BR /&gt;&lt;BR /&gt;2= 'F';&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;*** Crate a table save it as CSV format *****;&lt;BR /&gt;&lt;BR /&gt;OPTIONS MISSING = '';&lt;BR /&gt;&lt;BR /&gt;ODS CSV FILE = '.csv';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PROC TABULATE DATA =..&lt;BR /&gt;&lt;BR /&gt;CLASS / Missing;&lt;BR /&gt;&lt;BR /&gt;CLASSLEV&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;TABLE&lt;BR /&gt;&lt;BR /&gt;ALL (..)*&lt;BR /&gt;&lt;BR /&gt;(N= COLPCTN=*f=5.1)&lt;BR /&gt;&lt;BR /&gt;, (… ='' ALL='Total')&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;misstext='0';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; format ..;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; RUN;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PROC TABULATE DATA…. = ;&lt;BR /&gt;&lt;BR /&gt;CLASS …..;&lt;BR /&gt;&lt;BR /&gt;VAR…. ;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;TABLE&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;(…. )*(MEAN=&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; STD=), (.. ='' ALL='Total')&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;misstext='0';&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; format.;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;CLOSE&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Aug 2021 16:30:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/759071#M80864</guid>
      <dc:creator>Malk020</dc:creator>
      <dc:date>2021-08-03T16:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: missing 999 proc means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/759081#M80865</link>
      <description>&lt;P&gt;You said you tried the code above where 999 is converted to .N&lt;/P&gt;
&lt;P&gt;but you don't show anything of the sort in your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's the code we need to see.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 16:52:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/759081#M80865</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-03T16:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: missing 999 proc means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/759456#M80873</link>
      <description>And when you post code please use a code box and format it.  As posted, your code isn't legible.</description>
      <pubDate>Wed, 04 Aug 2021 19:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-999-proc-means/m-p/759456#M80873</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-04T19:18:41Z</dc:date>
    </item>
  </channel>
</rss>

