<?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: Freq table output not running correctly in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686159#M208163</link>
    <description>Which category do you want 130 included in?&lt;BR /&gt;&lt;BR /&gt;Try modifying your PROC FORMAT to the following and check how that works:&lt;BR /&gt;&lt;BR /&gt;proc format;&lt;BR /&gt;	value hypertensionD LOW - 80 = 'No Hypertension'&lt;BR /&gt;						80 - HIGH = 'Hypertension';&lt;BR /&gt;	value hypertensionS LOW - 130 = 'No Hypertension'&lt;BR /&gt;						130 - HIGH = 'Hypertension';&lt;BR /&gt;run;</description>
    <pubDate>Wed, 23 Sep 2020 17:53:15 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-09-23T17:53:15Z</dc:date>
    <item>
      <title>Freq table output not running correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686152#M208160</link>
      <description>&lt;P&gt;I want to run a frequency table that counts the number of observations with or without hypertension and displays them. My frequency table keeps coming out wrong and I am not sure how to fix it. Here is the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data bpx_j;
	set libref.bpx_j;
	AvgSystolic = MEAN(bpxsy1,bpxsy2,bpxsy3,bpxsy4);
	AvgDiastolic = MEAN(bpxdi1,bpxdi2,bpxdi3,bpxdi4);
	CountSystolic = N(bpxsy1,bpxsy2,bpxsy3,bpxsy4);
	CountDiastolic = N(bpxdi1,bpxdi2,bpxdi3,bpxdi4);
run;
proc freq data = work.bpx_j;
	tables CountSystolic CountDiastolic;
run;
proc means data = work.bpx_j;
	var AvgSystolic AvgDiastolic;
run;
proc print data = work.bpx_j;
run;
/*Part 2*/
proc format;
	value hypertensionD LOW -&amp;lt; 80 = 'No Hypertension'
						80 &amp;lt;- HIGH = 'Hypertension';
run;
proc format;
	value hypertensionS LOW -&amp;lt; 130 = 'No Hypertension'
						130 &amp;lt;- HIGH = 'Hypertension';
run;
proc freq data = work.bpx_j;
	tables AvgSystolic AvgDiastolic;
	Format AvgSystolic hypertensionS. AvgDiastolic hypertensionD.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is what the output looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ashb_0-1600882509814.png" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49717iCF52B201CD41F2F8/image-size/small?v=v2&amp;amp;px=200" role="button" title="ashb_0-1600882509814.png" alt="ashb_0-1600882509814.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ashb_1-1600882726739.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49718iB475E2F67B5570C8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ashb_1-1600882726739.png" alt="ashb_1-1600882726739.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 17:39:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686152#M208160</guid>
      <dc:creator>ashb</dc:creator>
      <dc:date>2020-09-23T17:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Freq table output not running correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686159#M208163</link>
      <description>Which category do you want 130 included in?&lt;BR /&gt;&lt;BR /&gt;Try modifying your PROC FORMAT to the following and check how that works:&lt;BR /&gt;&lt;BR /&gt;proc format;&lt;BR /&gt;	value hypertensionD LOW - 80 = 'No Hypertension'&lt;BR /&gt;						80 - HIGH = 'Hypertension';&lt;BR /&gt;	value hypertensionS LOW - 130 = 'No Hypertension'&lt;BR /&gt;						130 - HIGH = 'Hypertension';&lt;BR /&gt;run;</description>
      <pubDate>Wed, 23 Sep 2020 17:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686159#M208163</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-09-23T17:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Freq table output not running correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686160#M208164</link>
      <description>&lt;P&gt;Describe what is "wrong", exactly with the output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have an issue with your formats. Both of these have a value repeated in the ranges -&amp;lt; means "less than or equal",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;- means "greater than or equal" , so "equal" is in both of these and yield unexpected results. Remove one of the - in each definition.&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;proc format;
	value hypertensionD LOW -&amp;lt; 80 = 'No Hypertension'
						80 &amp;lt;- HIGH = 'Hypertension';
run;
proc format;
	value hypertensionS LOW -&amp;lt; 130 = 'No Hypertension'
						130 &amp;lt;- HIGH = 'Hypertension';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;. &lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 17:53:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686160#M208164</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-23T17:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Freq table output not running correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686162#M208165</link>
      <description>And show the log...that output is definitely weird.</description>
      <pubDate>Wed, 23 Sep 2020 17:55:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686162#M208165</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-09-23T17:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Freq table output not running correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686166#M208167</link>
      <description>&lt;P&gt;Here is the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 8704 observations read from the data set LIBREF.BPX_J.&lt;BR /&gt;NOTE: The data set WORK.BPX_J has 8704 observations and 26 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.11 seconds&lt;BR /&gt;cpu time 0.07 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;110 proc freq data = work.bpx_j;&lt;BR /&gt;111 tables CountSystolic CountDiastolic;&lt;BR /&gt;112 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 8704 observations read from the data set WORK.BPX_J.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.06 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;113 proc means data = work.bpx_j;&lt;BR /&gt;114 var AvgSystolic AvgDiastolic;&lt;BR /&gt;115 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 8704 observations read from the data set WORK.BPX_J.&lt;BR /&gt;NOTE: PROCEDURE MEANS used (Total process time):&lt;BR /&gt;real time 0.06 seconds&lt;BR /&gt;cpu time 0.04 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;116 proc print data = work.bpx_j;&lt;BR /&gt;117 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 8704 observations read from the data set WORK.BPX_J.&lt;BR /&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;BR /&gt;real time 13.07 seconds&lt;BR /&gt;cpu time 13.18 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;118 /*Part 2*/&lt;BR /&gt;119 proc format;&lt;BR /&gt;120 value hypertensionD LOW -&amp;lt; 80 = 'No Hypertension'&lt;BR /&gt;121 80 &amp;lt;- HIGH = 'Hypertension';&lt;BR /&gt;NOTE: Format HYPERTENSIOND is already on the library WORK.FORMATS.&lt;BR /&gt;NOTE: Format HYPERTENSIOND has been output.&lt;BR /&gt;122 run;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE FORMAT used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;123 proc format;&lt;BR /&gt;124 value hypertensionS LOW -&amp;lt; 130 = 'No Hypertension'&lt;BR /&gt;125 130 &amp;lt;- HIGH = 'Hypertension';&lt;BR /&gt;NOTE: Format HYPERTENSIONS is already on the library WORK.FORMATS.&lt;BR /&gt;NOTE: Format HYPERTENSIONS has been output.&lt;BR /&gt;126 run;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE FORMAT used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;127 proc freq data = work.bpx_j;&lt;BR /&gt;128 tables AvgSystolic AvgDiastolic;&lt;BR /&gt;129 Format AvgSystolic hypertensionS. AvgDiastolic hypertensionD.;&lt;BR /&gt;130 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 8704 observations read from the data set WORK.BPX_J.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.08 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 18:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686166#M208167</guid>
      <dc:creator>ashb</dc:creator>
      <dc:date>2020-09-23T18:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Freq table output not running correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686169#M208169</link>
      <description>&lt;P&gt;Thanks everyone! It finally worked after changing some things around.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 18:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Freq-table-output-not-running-correctly/m-p/686169#M208169</guid>
      <dc:creator>ashb</dc:creator>
      <dc:date>2020-09-23T18:21:54Z</dc:date>
    </item>
  </channel>
</rss>

