<?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 Freq: two variable without missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473280#M121429</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Could it be as simple as:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;&lt;SPAN class="token statement"&gt;ods&lt;/SPAN&gt; output CrossTabFreqs&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;one1&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;freq&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;one (where=(visit1 ne . or endofstudy ne .))&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;table&lt;/SPAN&gt; Visit1&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;EndOfStudy&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hmm. Applied to the presented example data, this throws an ERROR:&lt;/P&gt;
&lt;PRE&gt;25         proc freq data=one(where=(visit1 ne . or endofstudy ne .));
ERROR: WHERE clause operator requires compatible variables.
26          table Visit1*EndOfStudy;
ERROR: No data set open to look up variables.
ERROR: No data set open to look up variables.
27         run;
&lt;/PRE&gt;
&lt;P&gt;And even when the type is corrected:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output CrossTabFreqs=one1; 
proc freq data=one(where=(visit1 ne "" or endofstudy ne ""));
 table Visit1*EndOfStudy;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the output dataset from the ods output contains the unwanted rows:&lt;/P&gt;
&lt;PRE&gt;Table Visit1 * EndOfStudy	ABN	ABN	11	1	4	14.29	57.14	20.00	.
Table Visit1 * EndOfStudy	ABN	MIS	11	1	0	0.00	0.00	0.00	.
Table Visit1 * EndOfStudy	ABN	NOR	11	1	3	10.71	42.86	42.86	.
Table Visit1 * EndOfStudy	ABN		10	1	7	25.00	.	.	.
Table Visit1 * EndOfStudy	MIS	ABN	11	1	5	17.86	83.33	25.00	.
Table Visit1 * EndOfStudy	MIS	MIS	11	1	0	0.00	0.00	0.00	.
Table Visit1 * EndOfStudy	MIS	NOR	11	1	1	3.57	16.67	14.29	.
Table Visit1 * EndOfStudy	MIS		10	1	6	21.43	.	.	.
Table Visit1 * EndOfStudy	NOR	ABN	11	1	11	39.29	73.33	55.00	.
Table Visit1 * EndOfStudy	NOR	MIS	11	1	1	3.57	6.67	100.00	.
Table Visit1 * EndOfStudy	NOR	NOR	11	1	3	10.71	20.00	42.86	.
Table Visit1 * EndOfStudy	NOR		10	1	15	53.57	.	.	.
Table Visit1 * EndOfStudy		ABN	01	1	20	71.43	.	.	.
Table Visit1 * EndOfStudy		MIS	01	1	1	3.57	.	.	.
Table Visit1 * EndOfStudy		NOR	01	1	7	25.00	.	.	.
Table Visit1 * EndOfStudy			00	1	28	100.00	.	.	0&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Jun 2018 09:05:56 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-06-26T09:05:56Z</dc:date>
    <item>
      <title>Proc Freq: two variable without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473264#M121422</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help not to take into account 'missing' when perform 'proc freq' for two variables. For instance for the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
      input Patient : $1 Visit1 : $3. EndOfStudy : $3. ;
      datalines;
   1 NORM ABN
   2 ABN ABN
   3 MISS NORM
   4 NORM NORM
   6 NORM ABN
   7 NORM MISS
   8 ABN ABN
   9 NORM ABN
   10 MISS ABN
   11 NORM ABN
   12 MISS ABN
   13 NORM NORM
   14 ABN ABN
   15 NORM ABN
   16 NORM NORM
   17 NORM ABN
   18 MISS ABN
   19 ABN ABN
   20 NORM ABN
   21 NORM ABN
   22 ABN NORM
   23 MISS ABN
   24 NORM ABN
   25 ABN NORM
   26 NORM ABN
   27 MISS ABN
   28 ABN NORM
   29 NORM ABN
   ;
   run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thus I have the following dataset:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.jpg" style="width: 195px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21385iF786ADA5E4F84E6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.jpg" alt="2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then proc freq itself:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output CrossTabFreqs=one1; 
proc freq data=one;
 table Visit1*EndOfStudy;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the result where I don't need lines with missing values:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21386i2A2ADE95374B541D/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.jpg" alt="1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question is: what is the option of 'proc freq' not to take into account combinations with 'missing' values?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 08:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473264#M121422</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2018-06-26T08:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq: two variable without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473271#M121425</link>
      <description>&lt;P&gt;Could it be as simple as:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;ods&lt;/SPAN&gt; output CrossTabFreqs&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;one1&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 
&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;freq&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;one (where=(visit1 ne . or endofstudy ne .))&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="token statement"&gt;table&lt;/SPAN&gt; Visit1&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;EndOfStudy&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 08:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473271#M121425</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-26T08:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq: two variable without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473273#M121426</link>
      <description>&lt;P&gt;Add a where= dataset option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output CrossTabFreqs=one1 (where=(endofstudy ne ""));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jun 2018 08:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473273#M121426</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-26T08:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq: two variable without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473275#M121427</link>
      <description>Thank you!</description>
      <pubDate>Tue, 26 Jun 2018 08:50:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473275#M121427</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2018-06-26T08:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq: two variable without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473280#M121429</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Could it be as simple as:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;&lt;SPAN class="token statement"&gt;ods&lt;/SPAN&gt; output CrossTabFreqs&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;one1&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;freq&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;one (where=(visit1 ne . or endofstudy ne .))&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;table&lt;/SPAN&gt; Visit1&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;EndOfStudy&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hmm. Applied to the presented example data, this throws an ERROR:&lt;/P&gt;
&lt;PRE&gt;25         proc freq data=one(where=(visit1 ne . or endofstudy ne .));
ERROR: WHERE clause operator requires compatible variables.
26          table Visit1*EndOfStudy;
ERROR: No data set open to look up variables.
ERROR: No data set open to look up variables.
27         run;
&lt;/PRE&gt;
&lt;P&gt;And even when the type is corrected:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output CrossTabFreqs=one1; 
proc freq data=one(where=(visit1 ne "" or endofstudy ne ""));
 table Visit1*EndOfStudy;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the output dataset from the ods output contains the unwanted rows:&lt;/P&gt;
&lt;PRE&gt;Table Visit1 * EndOfStudy	ABN	ABN	11	1	4	14.29	57.14	20.00	.
Table Visit1 * EndOfStudy	ABN	MIS	11	1	0	0.00	0.00	0.00	.
Table Visit1 * EndOfStudy	ABN	NOR	11	1	3	10.71	42.86	42.86	.
Table Visit1 * EndOfStudy	ABN		10	1	7	25.00	.	.	.
Table Visit1 * EndOfStudy	MIS	ABN	11	1	5	17.86	83.33	25.00	.
Table Visit1 * EndOfStudy	MIS	MIS	11	1	0	0.00	0.00	0.00	.
Table Visit1 * EndOfStudy	MIS	NOR	11	1	1	3.57	16.67	14.29	.
Table Visit1 * EndOfStudy	MIS		10	1	6	21.43	.	.	.
Table Visit1 * EndOfStudy	NOR	ABN	11	1	11	39.29	73.33	55.00	.
Table Visit1 * EndOfStudy	NOR	MIS	11	1	1	3.57	6.67	100.00	.
Table Visit1 * EndOfStudy	NOR	NOR	11	1	3	10.71	20.00	42.86	.
Table Visit1 * EndOfStudy	NOR		10	1	15	53.57	.	.	.
Table Visit1 * EndOfStudy		ABN	01	1	20	71.43	.	.	.
Table Visit1 * EndOfStudy		MIS	01	1	1	3.57	.	.	.
Table Visit1 * EndOfStudy		NOR	01	1	7	25.00	.	.	.
Table Visit1 * EndOfStudy			00	1	28	100.00	.	.	0&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jun 2018 09:05:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473280#M121429</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-26T09:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq: two variable without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473282#M121431</link>
      <description>&lt;P&gt;Didn't really look at the data.&amp;nbsp; No time to check, but maybe:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;freq&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;one&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;visit1 &lt;SPAN class="token operator"&gt;ne&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;""&lt;/SPAN&gt; and endofstudy &lt;SPAN class="token operator"&gt;ne&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;""&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I do like you solution however, but it still going to do the check, just filtering out afterwards, so bit of a waste of calculation time.&amp;nbsp; But I doubt it matters in this instance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 09:18:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-two-variable-without-missing-values/m-p/473282#M121431</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-26T09:18:36Z</dc:date>
    </item>
  </channel>
</rss>

