<?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: Negative values in proc format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Negative-values-in-proc-format/m-p/188662#M265905</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this using ranges excluding one of the values of the range:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; value V1format&lt;/P&gt;&lt;P&gt;&amp;nbsp; low-&amp;lt;-0.875 = 'A'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.875-&amp;lt;-0.625 = 'B'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.625-&amp;lt;-0.375 = 'C'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.375-&amp;lt;-0.125 = 'D'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.125-0 = 'E'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0&amp;lt;-0.125 = 'F'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.125&amp;lt;-0.375 = 'G'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.375&amp;lt;-0.625 = 'H'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.625&amp;lt;-0.875 = 'I'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.875&amp;lt;-high = 'J';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can test your format with this small program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do number=-880 to 880 by 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x=number/1000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=put(x,V1format.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Oct 2014 13:08:15 GMT</pubDate>
    <dc:creator>CTorres</dc:creator>
    <dc:date>2014-10-17T13:08:15Z</dc:date>
    <item>
      <title>Negative values in proc format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-values-in-proc-format/m-p/188660#M265903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to create a format which includes negative values. I have tried with and without parenthesis, but I get a syntax error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; value V1format&lt;/P&gt;&lt;P&gt;&amp;nbsp; low - (-0.874999999) = 'A'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.875 - (-0.624999999) = 'B'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.625 - (-0.374999999) = 'C'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.375 - (-0.124999999) = 'D'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.124999999 - 0 = 'E'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0-0.1249999999 = 'F'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.125 - 0.3749999999 = 'G'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.375 - 0.6249999999 = 'H'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.625 - 0.8749999999 = 'I'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.875 - high = 'J';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be highly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 12:24:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-values-in-proc-format/m-p/188660#M265903</guid>
      <dc:creator>mark_ph</dc:creator>
      <dc:date>2014-10-17T12:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Negative values in proc format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-values-in-proc-format/m-p/188661#M265904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First:&lt;/P&gt;&lt;P&gt;Your problem is in your logic.&lt;/P&gt;&lt;P&gt;As you know -1 &amp;gt; - 2&lt;/P&gt;&lt;P&gt;so is -.124999999999999 &amp;gt; -.125&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that is mean that&amp;nbsp; when you say&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; low - (-0.1) = 'A'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; -0.2 - (0) = 'B'&lt;/P&gt;&lt;P&gt;you will get overlap, so you can not say&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; low - -124999999999999 = 'A'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; -0.125 - (-0.624999999) = 'B'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Second:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;you do not need () in format&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Finally:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;try this, it should work&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; value V1format&lt;/P&gt;&lt;P&gt;&amp;nbsp; low - -0.875 = 'A'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.874999999 - -0.625 = 'B'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.624999999 - -0.375 = 'C'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.374999999 - -0.125 = 'D'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.124999999 - 0 = 'E'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0-0.1249999999 = 'F'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.125 - 0.3749999999 = 'G'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.375 - 0.6249999999 = 'H'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.625 - 0.8749999999 = 'I'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.875 - high = 'J';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 13:06:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-values-in-proc-format/m-p/188661#M265904</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2014-10-17T13:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Negative values in proc format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-values-in-proc-format/m-p/188662#M265905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this using ranges excluding one of the values of the range:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; value V1format&lt;/P&gt;&lt;P&gt;&amp;nbsp; low-&amp;lt;-0.875 = 'A'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.875-&amp;lt;-0.625 = 'B'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.625-&amp;lt;-0.375 = 'C'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.375-&amp;lt;-0.125 = 'D'&lt;/P&gt;&lt;P&gt;&amp;nbsp; -0.125-0 = 'E'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0&amp;lt;-0.125 = 'F'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.125&amp;lt;-0.375 = 'G'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.375&amp;lt;-0.625 = 'H'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.625&amp;lt;-0.875 = 'I'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.875&amp;lt;-high = 'J';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can test your format with this small program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do number=-880 to 880 by 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x=number/1000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=put(x,V1format.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 13:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-values-in-proc-format/m-p/188662#M265905</guid>
      <dc:creator>CTorres</dc:creator>
      <dc:date>2014-10-17T13:08:15Z</dc:date>
    </item>
  </channel>
</rss>

