<?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: How to add _2022 at the end of all the field names in a table in SAS? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-2022-at-the-end-of-all-the-field-names-in-a-table-in/m-p/851098#M336365</link>
    <description>&lt;P&gt;memnames are always upper case, at least for datasets in BASE SAS libraries.&lt;/P&gt;</description>
    <pubDate>Sun, 25 Dec 2022 23:04:29 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-12-25T23:04:29Z</dc:date>
    <item>
      <title>How to add _2022 at the end of all the field names in a table in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-2022-at-the-end-of-all-the-field-names-in-a-table-in/m-p/851096#M336363</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to modify all the field names in a table by adding _2022 at the end. Using rename for all the variables would take very long. I wrote my code as this:&lt;/P&gt;&lt;P&gt;My table name is Inforce_1906_new and it is in the WORK library,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc SQL noprint;
select cats(name,'=',name,'_2022')
into :list
separated by ' '
from dictionary.columns
where libname = 'WORK' and memname = 'Inforce_1906_New';
quit;

proc datasets library = Work nolist;
modify Inforce_1906_new;
rename &amp;amp;list;
contents data=Inforce_1906_new;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;However, when I ran the code, the SQL seemed to not doing anything. It has a note: "No rows were selected" in the log. And when I ran the second part to actually modify the name, it does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know what is happening here or does anyone has a better way of doing it?&lt;/P&gt;</description>
      <pubDate>Sun, 25 Dec 2022 22:47:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-2022-at-the-end-of-all-the-field-names-in-a-table-in/m-p/851096#M336363</guid>
      <dc:creator>JQian</dc:creator>
      <dc:date>2022-12-25T22:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to add _2022 at the end of all the field names in a table in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-2022-at-the-end-of-all-the-field-names-in-a-table-in/m-p/851098#M336365</link>
      <description>&lt;P&gt;memnames are always upper case, at least for datasets in BASE SAS libraries.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Dec 2022 23:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-2022-at-the-end-of-all-the-field-names-in-a-table-in/m-p/851098#M336365</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-12-25T23:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to add _2022 at the end of all the field names in a table in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-2022-at-the-end-of-all-the-field-names-in-a-table-in/m-p/851099#M336366</link>
      <description>thank you so much. After I change it to upper case, it works.</description>
      <pubDate>Sun, 25 Dec 2022 23:12:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-2022-at-the-end-of-all-the-field-names-in-a-table-in/m-p/851099#M336366</guid>
      <dc:creator>JQian</dc:creator>
      <dc:date>2022-12-25T23:12:22Z</dc:date>
    </item>
  </channel>
</rss>

