<?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 import multiple sas datasets into sas conditionally in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453785#M114699</link>
    <description>Thank you so much for your response. It worked out &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Thu, 12 Apr 2018 22:54:57 GMT</pubDate>
    <dc:creator>ssv</dc:creator>
    <dc:date>2018-04-12T22:54:57Z</dc:date>
    <item>
      <title>How to import multiple sas datasets into sas conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453061#M114419</link>
      <description>&lt;P&gt;&lt;FONT face="times new roman,times"&gt;Hi there!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;I have to import few datasets(sas7bdat) from external source into SAS. so I have used libname statement to address those datasets location. Is there any way to copy each of these datasets in to new datasets conditionally?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&lt;U&gt;&lt;FONT color="#800000"&gt;FOR EXAMPLE&lt;/FONT&gt;&lt;/U&gt;: I have 5 sas datasets (a, b, c, d, e with extension .sas7bdat) in&amp;nbsp;C:\Users\Desktop\XYZ folder. i have used this LIBNAME Statement to import them into sas.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;LIBNAME&lt;/FONT&gt; &lt;FONT color="#800000"&gt;IMPORTED&lt;/FONT&gt; &lt;FONT size="3" color="#FF00FF"&gt;"&lt;/FONT&gt;&lt;FONT color="#000000"&gt;C:\Users\Desktop\XYZ&lt;/FONT&gt;&lt;FONT size="3" color="#FF00FF"&gt;"&lt;/FONT&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;I want to copy these datasets(A, B, C, D, E) into 5&amp;nbsp;NEW datasets(P, Q, R, S, T) conditionally, which means I want to copy dataset &lt;FONT color="#0000FF"&gt;A&lt;/FONT&gt; into &lt;FONT color="#800000"&gt;P&lt;/FONT&gt;, &lt;FONT color="#0000FF"&gt;B&lt;/FONT&gt; into &lt;FONT color="#800000"&gt;Q&lt;/FONT&gt;, &lt;FONT color="#0000FF"&gt;C&lt;/FONT&gt; into &lt;FONT color="#800000"&gt;R&lt;/FONT&gt;, &lt;FONT color="#0000FF"&gt;D&lt;/FONT&gt; into &lt;FONT color="#800000"&gt;S&lt;/FONT&gt;, &lt;FONT color="#0000FF"&gt;E&lt;/FONT&gt; into &lt;FONT color="#800000"&gt;T&lt;/FONT&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;I am doing this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;Data&lt;/FONT&gt; &lt;FONT color="#000000"&gt;P;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;&lt;FONT color="#800000"&gt;set&lt;/FONT&gt; &lt;FONT color="#000000"&gt;A;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" color="#0000FF"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;data&lt;/FONT&gt; &lt;FONT color="#000000"&gt;Q;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp; &lt;FONT color="#800000"&gt;set&lt;/FONT&gt;&amp;nbsp; &lt;FONT color="#000000"&gt;B;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" color="#0000FF"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;But is there any possibility of reducing the code? instead of using the set statement and repeating the code again and again is there any other way?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;Your response is Highly Appreciated.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;Thank you.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 04:26:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453061#M114419</guid>
      <dc:creator>ssv</dc:creator>
      <dc:date>2018-04-11T04:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple sas datasets into sas conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453066#M114422</link>
      <description>&lt;P&gt;If you keep the same name, you can use proc copy (and a select statement if needed).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 04:54:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453066#M114422</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-04-11T04:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple sas datasets into sas conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453069#M114423</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/169529"&gt;@ssv&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Copy the files into a new folder. Keeping source and target clearly separated is "cleaner" and it also allows you to use Proc Datasets.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options dlcreatedir;

libname source 'c:\temp\source';
data source.a;
  set sashelp.class;
run;

data source.b;
  set sashelp.class;
run;

libname target 'c:\temp\target';
proc datasets lib=target nolist;
  delete p q;
  run;
  copy in=source out=target;
    select a b;
  run;
  change a=p b=q;
  run;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Apr 2018 05:23:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453069#M114423</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-04-11T05:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple sas datasets into sas conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453306#M114535</link>
      <description>PROC DATASETS/COPY moves the data over in chunks, a data step copies the data line by line. This means PROC COPY is significantly faster as well.</description>
      <pubDate>Wed, 11 Apr 2018 17:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453306#M114535</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-11T17:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple sas datasets into sas conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453785#M114699</link>
      <description>Thank you so much for your response. It worked out &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 12 Apr 2018 22:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453785#M114699</guid>
      <dc:creator>ssv</dc:creator>
      <dc:date>2018-04-12T22:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple sas datasets into sas conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453788#M114701</link>
      <description>&lt;P&gt;Thank you so much for your response. It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 22:55:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453788#M114701</guid>
      <dc:creator>ssv</dc:creator>
      <dc:date>2018-04-12T22:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple sas datasets into sas conditionally</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453789#M114702</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you so much for your response. It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 22:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-sas-datasets-into-sas-conditionally/m-p/453789#M114702</guid>
      <dc:creator>ssv</dc:creator>
      <dc:date>2018-04-12T22:56:20Z</dc:date>
    </item>
  </channel>
</rss>

