<?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 PROC DATASETS - CHANGE Statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-DATASETS-CHANGE-Statement/m-p/24322#M5500</link>
    <description>Hi. I have a very easy problem that i can't seem to google myself out of. I've searched the forums, but without luck.&lt;BR /&gt;
&lt;BR /&gt;
I want renames more sas dataset &lt;BR /&gt;
ex: current dataset names : x_2011, x_2010, x_2009, x_2008 ...&lt;BR /&gt;
     new_manes: p_2011, p_2010, p_2009, p_2008 ...&lt;BR /&gt;
&lt;BR /&gt;
I can use &lt;BR /&gt;
PROC DATASETS LIBRARY=xxx;&lt;BR /&gt;
CHANGE db_old=db_new;&lt;BR /&gt;
&lt;BR /&gt;
QUIT;RUN;&lt;BR /&gt;
&lt;BR /&gt;
but I won't repeat db's name.&lt;BR /&gt;
&lt;BR /&gt;
How can I do?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance ...</description>
    <pubDate>Tue, 08 Mar 2011 12:20:39 GMT</pubDate>
    <dc:creator>CMilena</dc:creator>
    <dc:date>2011-03-08T12:20:39Z</dc:date>
    <item>
      <title>PROC DATASETS - CHANGE Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-DATASETS-CHANGE-Statement/m-p/24322#M5500</link>
      <description>Hi. I have a very easy problem that i can't seem to google myself out of. I've searched the forums, but without luck.&lt;BR /&gt;
&lt;BR /&gt;
I want renames more sas dataset &lt;BR /&gt;
ex: current dataset names : x_2011, x_2010, x_2009, x_2008 ...&lt;BR /&gt;
     new_manes: p_2011, p_2010, p_2009, p_2008 ...&lt;BR /&gt;
&lt;BR /&gt;
I can use &lt;BR /&gt;
PROC DATASETS LIBRARY=xxx;&lt;BR /&gt;
CHANGE db_old=db_new;&lt;BR /&gt;
&lt;BR /&gt;
QUIT;RUN;&lt;BR /&gt;
&lt;BR /&gt;
but I won't repeat db's name.&lt;BR /&gt;
&lt;BR /&gt;
How can I do?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance ...</description>
      <pubDate>Tue, 08 Mar 2011 12:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-DATASETS-CHANGE-Statement/m-p/24322#M5500</guid>
      <dc:creator>CMilena</dc:creator>
      <dc:date>2011-03-08T12:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: PROC DATASETS - CHANGE Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-DATASETS-CHANGE-Statement/m-p/24323#M5501</link>
      <description>I believe the only way is to "gen the code".&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
188  data x_2011 x_2010 x_2009 x_2008;&lt;BR /&gt;
189     stop;&lt;BR /&gt;
190     run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The data set WORK.X_2011 has 0 observations and 0 variables.&lt;BR /&gt;
NOTE: The data set WORK.X_2010 has 0 observations and 0 variables.&lt;BR /&gt;
NOTE: The data set WORK.X_2009 has 0 observations and 0 variables.&lt;BR /&gt;
NOTE: The data set WORK.X_2008 has 0 observations and 0 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.01 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
191  proc sql noprint;&lt;BR /&gt;
192     select catx('=',memname,cats('s',substr(memname,2))) into :change separated by ' '&lt;BR /&gt;
193     from dictionary.members&lt;BR /&gt;
194        where libname eq 'WORK' and memname eqT 'X_';&lt;BR /&gt;
195     quit;&lt;BR /&gt;
NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           0.00 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
196     run;&lt;BR /&gt;
197  %put NOTE: CHANGE=&amp;amp;change;&lt;BR /&gt;
NOTE: CHANGE=X_2008=s_2008 X_2009=s_2009 X_2010=s_2010 X_2011=s_2011&lt;BR /&gt;
198  proc datasets;&lt;BR /&gt;
                   Directory&lt;BR /&gt;
&lt;BR /&gt;
Libref         WORK&lt;BR /&gt;
Engine         V9&lt;BR /&gt;
Physical Name  (system-specific file/path name)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
           Member&lt;BR /&gt;
#  Name    Type&lt;BR /&gt;
&lt;BR /&gt;
1  X_2008  DATA&lt;BR /&gt;
2  X_2009  DATA&lt;BR /&gt;
3  X_2010  DATA&lt;BR /&gt;
4  X_2011  DATA&lt;BR /&gt;
199     change &amp;amp;change;&lt;BR /&gt;
200     run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Changing the name WORK.X_2008 to WORK.S_2008 (memtype=DATA).&lt;BR /&gt;
NOTE: Changing the name WORK.X_2009 to WORK.S_2009 (memtype=DATA).&lt;BR /&gt;
NOTE: Changing the name WORK.X_2010 to WORK.S_2010 (memtype=DATA).&lt;BR /&gt;
NOTE: Changing the name WORK.X_2011 to WORK.S_2011 (memtype=DATA).&lt;BR /&gt;
201     quit;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: PROCEDURE DATASETS used (Total process time):&lt;BR /&gt;
      real time           0.03 seconds&lt;BR /&gt;
      cpu time            0.03 seconds&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 08 Mar 2011 12:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-DATASETS-CHANGE-Statement/m-p/24323#M5501</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-03-08T12:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: PROC DATASETS - CHANGE Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-DATASETS-CHANGE-Statement/m-p/24324#M5502</link>
      <description>I never can find this solution&lt;BR /&gt;
Thank you  very much!</description>
      <pubDate>Tue, 08 Mar 2011 14:07:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-DATASETS-CHANGE-Statement/m-p/24324#M5502</guid>
      <dc:creator>CMilena</dc:creator>
      <dc:date>2011-03-08T14:07:22Z</dc:date>
    </item>
  </channel>
</rss>

