<?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: value labels for negative observations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756663#M238939</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;. lots of good points!&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jul 2021 15:15:46 GMT</pubDate>
    <dc:creator>Emma_at_SAS</dc:creator>
    <dc:date>2021-07-26T15:15:46Z</dc:date>
    <item>
      <title>An error in PROC FORMAT (value labels)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756640#M238925</link>
      <description>&lt;P&gt;I have some variables with negative values that are assigned for the missing observations. When I assign the value labels in&amp;nbsp;proc format; the first time SAS reaches a negative value faces an error. My list of variables is long with several similar negative observations (-9). Please see my code and error below. Thank you for your suggestions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	value income
	  1 = "less than 20000"
	  2 = "20000-40000"
	  3 = "40000-60000"
	  4 = "60000-80000"
	  5 = "&amp;gt;80000"
	  -9 = "Don’’t know";
format income income.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;1556 +   9 = "Don’’t know"
         -
         180
ERROR 180-322: Statement is not valid or it is used out of proper order.
&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Jul 2021 17:25:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756640#M238925</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-07-26T17:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: value labels for negative observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756643#M238927</link>
      <description>&lt;P&gt;Most likely the error is before line 1556 and it is just at line 1556 that SAS notices something has gone wrong.&lt;/P&gt;
&lt;P&gt;Did you my mistake include a semi-colon before that last line?&lt;/P&gt;
&lt;P&gt;Did you use something other than a hyphen character for the minus sign?&amp;nbsp; Try retyping that line, especially if you have copied the lines from a word processing program (or email).&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 14:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756643#M238927</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-26T14:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: value labels for negative observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756645#M238928</link>
      <description>&lt;P&gt;Please provide reproducible data and programs, not excerpts.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 14:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756645#M238928</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-07-26T14:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: value labels for negative observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756646#M238929</link>
      <description>&lt;P&gt;Please show us the ENTIRE log for your PROC FORMAT, and not selected pieces.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 14:44:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756646#M238929</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-26T14:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: value labels for negative observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756651#M238932</link>
      <description>Thank you Tom! Yes, I had an extra semi-colon before that last line but I could not see that until you told me. Thanks</description>
      <pubDate>Mon, 26 Jul 2021 14:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756651#M238932</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-07-26T14:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: value labels for negative observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756652#M238933</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226565"&gt;@japelin&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;for your thoughts and suggestions&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 14:54:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756652#M238933</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-07-26T14:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: value labels for negative observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756654#M238935</link>
      <description>&lt;P&gt;One Problem: Wrong character for single quotes:&lt;/P&gt;
&lt;PRE&gt;-9 = "Don&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;’’&lt;/STRONG&gt;&lt;/FONT&gt;t know";&lt;/PRE&gt;
&lt;P&gt;Compare with:&lt;/P&gt;
&lt;PRE&gt;-9 = "Don&lt;STRONG&gt;&lt;FONT size="5"&gt;''&lt;/FONT&gt;&lt;/STRONG&gt;t know";&lt;/PRE&gt;
&lt;P&gt;The "curly" quotes are not treated as programming quotes properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The statement&lt;/P&gt;
&lt;PRE&gt;format income income.;&lt;/PRE&gt;
&lt;P&gt;does not belong in Proc Format. Proc format would not have a variable named income to attach a format to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would use that format statement in a proc using a data set such as Proc Print, or in data step code to permanently associated the format income with the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As mentioned by others: Show the log for the entire procedure or data step that shows that error. Copy the entire text from the Log and paste into a text box opened on the forum with the &amp;lt;/&amp;gt; icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW,&amp;nbsp; if you need a single quote to appear inside a value surrounded by double quotes you do not need to double them such as&lt;/P&gt;
&lt;PRE&gt;	  -9 = "Don't know";&lt;/PRE&gt;
&lt;P&gt;You would need the two single quotes in don't if you were only using single quotes all the time&lt;/P&gt;
&lt;PRE&gt;	  -9 = 'Don''t know';&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Jul 2021 14:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756654#M238935</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-26T14:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: value labels for negative observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756663#M238939</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;. lots of good points!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 15:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-in-PROC-FORMAT-value-labels/m-p/756663#M238939</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-07-26T15:15:46Z</dc:date>
    </item>
  </channel>
</rss>

