<?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 to conditionally rename a SAS dataset? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306063#M65390</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please let me know how I can conditionally rename a dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;eg: I have dataset TEST in&amp;nbsp;a library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if the run month=01 then I need to rename TEST to TEST_01.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2016 19:51:19 GMT</pubDate>
    <dc:creator>renjithr</dc:creator>
    <dc:date>2016-10-20T19:51:19Z</dc:date>
    <item>
      <title>How to conditionally rename a SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306063#M65390</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please let me know how I can conditionally rename a dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;eg: I have dataset TEST in&amp;nbsp;a library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if the run month=01 then I need to rename TEST to TEST_01.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 19:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306063#M65390</guid>
      <dc:creator>renjithr</dc:creator>
      <dc:date>2016-10-20T19:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to conditionally rename a SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306070#M65395</link>
      <description>&lt;P&gt;What rule are you using to determine that the "run month = 01"?&lt;/P&gt;
&lt;P&gt;And since this is a date related question what do you want to do the following year when there is another "run month=01"?&lt;/P&gt;
&lt;P&gt;Are also asking "how do I determine if the data set TEST exists in the library I expect it to?"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 20:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306070#M65395</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-20T20:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to conditionally rename a SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306075#M65398</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I set the macro variable , for eg: mth according to the date when I run the program.&lt;/P&gt;
&lt;P&gt;So I plan to run the process only on the month of January all other months are not affected.&lt;/P&gt;
&lt;P&gt;Data set should be avaialbe in the library from the previous months run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 20:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306075#M65398</guid>
      <dc:creator>renjithr</dc:creator>
      <dc:date>2016-10-20T20:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to conditionally rename a SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306100#M65405</link>
      <description>&lt;P&gt;I'm not sure how much I undesstood your problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; month= &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(month("&amp;amp;sysdate"d));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TEST_&amp;amp;month;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; TEST;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 21:03:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306100#M65405</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2016-10-20T21:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to conditionally rename a SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306110#M65409</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The dataset I want to rename is in a permanent library and I want to rename that dataset only in January.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 22:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306110#M65409</guid>
      <dc:creator>renjithr</dc:creator>
      <dc:date>2016-10-20T22:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to conditionally rename a SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306154#M65428</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
 set sashelp.class;
run;

proc datasets library=work nodetails nolist;
 change test=test_%sysfunc(month(%sysfunc(today())));
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
 set sashelp.class;
run;

%let month=01;
proc datasets library=work nodetails nolist;
 change test=test_&amp;amp;month;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 02:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conditionally-rename-a-SAS-dataset/m-p/306154#M65428</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-21T02:26:45Z</dc:date>
    </item>
  </channel>
</rss>

