<?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 format and grouping continuous variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-format-and-grouping-continuous-variables/m-p/665371#M198942</link>
    <description>&lt;P&gt;The format just needs to specify the value ranges, it has nothing to do with any particular variable until you try to use it with that variable.&lt;/P&gt;
&lt;P&gt;Also you should include all of the ranges in one format definition.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value fmt_A 
       low - 10 = 'Less than 10' 
       10 - 20 = 'Between 10 and 20' 
       20 - high = 'More than 20'
  ;
run;

proc freq data=have;
  format var_a fmt_a.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 26 Jun 2020 14:31:59 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-06-26T14:31:59Z</dc:date>
    <item>
      <title>Proc format and grouping continuous variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-format-and-grouping-continuous-variables/m-p/665369#M198940</link>
      <description>&lt;P&gt;Dear All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I want to use proc format to group the continuous variables.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Here is the code&lt;/P&gt;&lt;P&gt;&amp;nbsp; Proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; value Var_A&amp;nbsp; 0 = Var_A le 10 'Less than 10' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Value VAR_A 10 = Var_A le 20 ''Between 10 and 20'&amp;nbsp; /* and so on */;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the mistake I am making?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Randy&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 14:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-format-and-grouping-continuous-variables/m-p/665369#M198940</guid>
      <dc:creator>RandyStan</dc:creator>
      <dc:date>2020-06-26T14:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format and grouping continuous variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-format-and-grouping-continuous-variables/m-p/665370#M198941</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; Proc format;
    value var_A  0-&amp;lt;10='&amp;lt;10'
        10-&amp;lt;20 = '10-20' 20-&amp;lt;30='20-30' ... ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jun 2020 14:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-format-and-grouping-continuous-variables/m-p/665370#M198941</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-26T14:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format and grouping continuous variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-format-and-grouping-continuous-variables/m-p/665371#M198942</link>
      <description>&lt;P&gt;The format just needs to specify the value ranges, it has nothing to do with any particular variable until you try to use it with that variable.&lt;/P&gt;
&lt;P&gt;Also you should include all of the ranges in one format definition.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value fmt_A 
       low - 10 = 'Less than 10' 
       10 - 20 = 'Between 10 and 20' 
       20 - high = 'More than 20'
  ;
run;

proc freq data=have;
  format var_a fmt_a.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jun 2020 14:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-format-and-grouping-continuous-variables/m-p/665371#M198942</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-06-26T14:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format and grouping continuous variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-format-and-grouping-continuous-variables/m-p/665388#M198955</link>
      <description>&lt;P&gt;Proc format ranges use the -&amp;nbsp; character to indicate a range is specified and use the &amp;lt; (and ONLY the &amp;lt; character) to indicate whether the value is included in the range or not&lt;/P&gt;
&lt;P&gt;1 - 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; values 1 through 10 are in the range&lt;/P&gt;
&lt;P&gt;1 &amp;lt;- 10&amp;nbsp;&amp;nbsp; values from 1 to 10 EXCLUDING 1 are in the range&lt;/P&gt;
&lt;P&gt;1 - &amp;lt;10&amp;nbsp; values from 1 to 10 excluding 10 are in the range&lt;/P&gt;
&lt;P&gt;1 &amp;lt;-&amp;lt; 10 values from 1 to 10 but excluding both 1 and 10 are in the range.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A couple of special values are also available Low for the smallest non-missing value, High for the largest non-missing value you system uses. These can be useful when you aren't sure of an exact value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;low -&amp;lt;0&amp;nbsp;&amp;nbsp; all values less than 0 excluding 0 (i.e. all negative numbers)&lt;/P&gt;
&lt;P&gt;50 &amp;lt;- high&amp;nbsp; all values greater than 50&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And another special value range is OTHER where anything not explicitly included in some range is dumped:&lt;/P&gt;
&lt;P&gt;1 - 10 ="range 1"&lt;/P&gt;
&lt;P&gt;15-25 = "range 2"&lt;/P&gt;
&lt;P&gt;30-43= "range 3"&lt;/P&gt;
&lt;P&gt;other = "everything else"&amp;nbsp; &amp;lt;= this would include missing unless you have specific assignment for missing&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;You can mix ranges and lists of values in the same format as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless you really understand character comparisons do not expect ranges to work with character variables in general. Ranges can be used in character formats but the results are often not as expected.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 15:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-format-and-grouping-continuous-variables/m-p/665388#M198955</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-26T15:26:00Z</dc:date>
    </item>
  </channel>
</rss>

