<?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 How do I fix Error 20-200 and 20-322 for renaming variables in a data step? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-Error-20-200-and-20-322-for-renaming-variables-in-a/m-p/847112#M36934</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello, I've been trying to rename all the variables that start with a state, and end with something like&amp;nbsp; !!Housholds!!Estimate and I keep getting the Error 20-200 saying:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Alphabetic prefixes for enumerated variables (Alabama-Estimate) are different.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Old and new variable name specifications for RENAME must be of the same type.&amp;nbsp;Statement is ignored. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;And Error 22-322 says: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Syntax error, expecting one of the following: -, :, =.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The symbol is not recognized and will be ignored. &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to change all the variables to a shorted postal abbreviation of the corresponding state. For example I want the variable&amp;nbsp;Alabama!!Housholds!!Estimate to be just AL. &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, none of my data copied from the first data set to the second dataset, but I created that second dataset. The second dataset just has all of the original variables, but with no observations.&amp;nbsp; Can I get help getting all my data to be copied over to the new dataset?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas question 1.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77874i309FB5DFB4E90AEC/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas question 1.png" alt="sas question 1.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas question 2.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77875i0FEB1D4CEDAE2096/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas question 2.png" alt="sas question 2.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This one is the output of the first dataset RegPro.IncoSt &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas question 3.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77876iFE87B98B3E62CDB1/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas question 3.png" alt="sas question 3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This one is the output of the second dataset RegPro.IncoSt1 &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas question 4.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77877i2E4E047D396460AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas question 4.png" alt="sas question 4.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2022 18:11:00 GMT</pubDate>
    <dc:creator>Jiordani</dc:creator>
    <dc:date>2022-11-30T18:11:00Z</dc:date>
    <item>
      <title>How do I fix Error 20-200 and 20-322 for renaming variables in a data step?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-Error-20-200-and-20-322-for-renaming-variables-in-a/m-p/847112#M36934</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, I've been trying to rename all the variables that start with a state, and end with something like&amp;nbsp; !!Housholds!!Estimate and I keep getting the Error 20-200 saying:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Alphabetic prefixes for enumerated variables (Alabama-Estimate) are different.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Old and new variable name specifications for RENAME must be of the same type.&amp;nbsp;Statement is ignored. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;And Error 22-322 says: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Syntax error, expecting one of the following: -, :, =.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The symbol is not recognized and will be ignored. &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to change all the variables to a shorted postal abbreviation of the corresponding state. For example I want the variable&amp;nbsp;Alabama!!Housholds!!Estimate to be just AL. &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, none of my data copied from the first data set to the second dataset, but I created that second dataset. The second dataset just has all of the original variables, but with no observations.&amp;nbsp; Can I get help getting all my data to be copied over to the new dataset?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas question 1.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77874i309FB5DFB4E90AEC/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas question 1.png" alt="sas question 1.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas question 2.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77875i0FEB1D4CEDAE2096/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas question 2.png" alt="sas question 2.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This one is the output of the first dataset RegPro.IncoSt &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas question 3.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77876iFE87B98B3E62CDB1/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas question 3.png" alt="sas question 3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This one is the output of the second dataset RegPro.IncoSt1 &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas question 4.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77877i2E4E047D396460AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas question 4.png" alt="sas question 4.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 18:11:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-Error-20-200-and-20-322-for-renaming-variables-in-a/m-p/847112#M36934</guid>
      <dc:creator>Jiordani</dc:creator>
      <dc:date>2022-11-30T18:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fix Error 20-200 and 20-322 for renaming variables in a data step?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-Error-20-200-and-20-322-for-renaming-variables-in-a/m-p/847113#M36935</link>
      <description>&lt;P&gt;Variable name with any characters other than letters, digit or underscore must be represented differently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, you need&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Maybe this has been turned on already, I don't know, it can't hurt to issue that command anyway.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, for example, you need to enclose such variable names with the unusual characters with quotes and append the letter n on the end, such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'Alabama!!Households!!Estimate'n&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of course, if you spell the name wrong (which you have done), then it still won't work. Proper spelling is required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might want to request that the person/department providing this data not give the variables such horrible (in my opinion) names.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 18:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-do-I-fix-Error-20-200-and-20-322-for-renaming-variables-in-a/m-p/847113#M36935</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-30T18:21:27Z</dc:date>
    </item>
  </channel>
</rss>

