<?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 Unable to recode above 9 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-recode-above-9/m-p/903176#M356905</link>
    <description>&lt;P&gt;Hello. I have done some simple basic recodes that look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Diana123_0-1700050148382.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89790i5BB7519B9D80EB95/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Diana123_0-1700050148382.png" alt="Diana123_0-1700050148382.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But after checking the initial variable REF_COMP_1ST crossed with the recoded variable, it seems that my codes only went until 9.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Diana123_1-1700050196241.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89791iD9182E2F1E0D530A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Diana123_1-1700050196241.png" alt="Diana123_1-1700050196241.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="Diana123_2-1700050212111.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89792i02893D76228AD0C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Diana123_2-1700050212111.png" alt="Diana123_2-1700050212111.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Why is this happening? The recodes went until 9 and then assigned 1 to all the other values.&lt;/P&gt;&lt;P&gt;Both of the variables are CHAR. I have tried switching the _REC variable to NUMERIC but I had the same outcome.&lt;/P&gt;&lt;P&gt;Thanks for helping! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2023 12:14:12 GMT</pubDate>
    <dc:creator>Diana123</dc:creator>
    <dc:date>2023-11-15T12:14:12Z</dc:date>
    <item>
      <title>Unable to recode above 9</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-recode-above-9/m-p/903176#M356905</link>
      <description>&lt;P&gt;Hello. I have done some simple basic recodes that look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Diana123_0-1700050148382.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89790i5BB7519B9D80EB95/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Diana123_0-1700050148382.png" alt="Diana123_0-1700050148382.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But after checking the initial variable REF_COMP_1ST crossed with the recoded variable, it seems that my codes only went until 9.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Diana123_1-1700050196241.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89791iD9182E2F1E0D530A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Diana123_1-1700050196241.png" alt="Diana123_1-1700050196241.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="Diana123_2-1700050212111.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89792i02893D76228AD0C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Diana123_2-1700050212111.png" alt="Diana123_2-1700050212111.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Why is this happening? The recodes went until 9 and then assigned 1 to all the other values.&lt;/P&gt;&lt;P&gt;Both of the variables are CHAR. I have tried switching the _REC variable to NUMERIC but I had the same outcome.&lt;/P&gt;&lt;P&gt;Thanks for helping! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 12:14:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-recode-above-9/m-p/903176#M356905</guid>
      <dc:creator>Diana123</dc:creator>
      <dc:date>2023-11-15T12:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to recode above 9</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-recode-above-9/m-p/903180#M356907</link>
      <description>&lt;P&gt;You need to assign a length of 2 (that's two characters) to the variable REF_COMP_1st_REC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length REF_COMP_1st_REC $ 2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Otherwise, SAS uses the length of the variable the first time it is assigned, which is one character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which brings up the question ... why do you need to do any such recoding? Why do this work in the first place? How is a value of '10' more useful than a value of 'AOSTA-EMILIA-SICILIA-PERU DECAF'?? What can you do with '10' that you can't do with&amp;nbsp;AOSTA-EMILIA-SICILIA-PERU DECAF'??&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 12:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-recode-above-9/m-p/903180#M356907</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-11-15T12:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to recode above 9</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-recode-above-9/m-p/903183#M356908</link>
      <description>&lt;P&gt;Thank you very much! You saved me.&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":hugging_face:"&gt;🤗&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Trust me, I wanted to leave the variable as it was, with the long labels and everything, but sometimes, these variables will be used in other programs, and having codes instead of labels will be easier.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 12:57:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-recode-above-9/m-p/903183#M356908</guid>
      <dc:creator>Diana123</dc:creator>
      <dc:date>2023-11-15T12:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to recode above 9</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-recode-above-9/m-p/903184#M356909</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/460053"&gt;@Diana123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you very much! You saved me.&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":hugging_face:"&gt;🤗&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Trust me, I wanted to leave the variable as it was, with the long labels and everything, but sometimes, these variables will be used in other programs, and having codes instead of labels will be easier.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why not make the recodes numbers instead of character strings? Numbers will be easier to type, and will sort properly.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 13:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-recode-above-9/m-p/903184#M356909</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-11-15T13:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to recode above 9</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unable-to-recode-above-9/m-p/903186#M356911</link>
      <description>&lt;P&gt;I totally agree with you, but I kinda "inherited" this whole script that is made a long time ago. I will try in the future to try to make it more efficient. Again, I really appreciate your help.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 13:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unable-to-recode-above-9/m-p/903186#M356911</guid>
      <dc:creator>Diana123</dc:creator>
      <dc:date>2023-11-15T13:14:43Z</dc:date>
    </item>
  </channel>
</rss>

