<?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: Help need for converting multiple xpt files in folder to sas datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-need-for-converting-multiple-xpt-files-in-folder-to-sas/m-p/690739#M210148</link>
    <description>&lt;P&gt;Hmmm.&amp;nbsp; Shouldn't the first &lt;STRONG&gt;Lib&lt;/STRONG&gt;name be a &lt;STRONG&gt;File&lt;/STRONG&gt;name?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code shouldn't need much in the way of a change if it's already working.&amp;nbsp; You should just be able to change:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Add the TRUNCOVER option to your INFILE.&lt;/LI&gt;
&lt;LI&gt;Add a variable name and informat to your INPUT statement&lt;/LI&gt;
&lt;LI&gt;Modify your CALL EXECUTE statement as shown below.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILEname tmp pipe "dir /b ""abc/ddd/%str(*).xpt""";
libname ms "abc/ddd";

data _null_;
  infile   tmp    TRUNCOVER;
  input    Dir_Listing    $256.;
  call execute(cats('libname xptfile xport "abc/ddd/', Dir_Listing, '";'));
  call execute('proc copy inlib=xptfile outlib=ms; run;');
  call execute('filename xptfile clear;');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Oct 2020 00:28:08 GMT</pubDate>
    <dc:creator>jimbarbour</dc:creator>
    <dc:date>2020-10-11T00:28:08Z</dc:date>
    <item>
      <title>Help need for converting multiple xpt files in folder to sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-need-for-converting-multiple-xpt-files-in-folder-to-sas/m-p/690738#M210147</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the below pgm to convert xpt files in a folder to sas datasets. The pgm is working fine. But i can only do one data set at a time. Please suggest me how to modify my pgm to convert all datasets.&amp;nbsp; In the below pgm i am converting &lt;FONT color="#FF0000"&gt;ae&lt;/FONT&gt; xpt file. What information i need to add in place of &lt;FONT color="#FF0000"&gt;ae&lt;FONT color="#000000"&gt; to work on all data sets.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname tmp pipe "dir /b ""abc/ddd/%str(*).xpt""";
libname ms "abc/ddd";

data _null_;
  infile tmp;
  input;
  call execute(cats('libname xptfile xport "abc/ddd/','ae','.xpt";'));
  call execute('proc copy inlib=xptfile outlib=ms; run;');
  call execute('filename xptfile clear;');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Oct 2020 22:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-need-for-converting-multiple-xpt-files-in-folder-to-sas/m-p/690738#M210147</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2020-10-10T22:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help need for converting multiple xpt files in folder to sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-need-for-converting-multiple-xpt-files-in-folder-to-sas/m-p/690739#M210148</link>
      <description>&lt;P&gt;Hmmm.&amp;nbsp; Shouldn't the first &lt;STRONG&gt;Lib&lt;/STRONG&gt;name be a &lt;STRONG&gt;File&lt;/STRONG&gt;name?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code shouldn't need much in the way of a change if it's already working.&amp;nbsp; You should just be able to change:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Add the TRUNCOVER option to your INFILE.&lt;/LI&gt;
&lt;LI&gt;Add a variable name and informat to your INPUT statement&lt;/LI&gt;
&lt;LI&gt;Modify your CALL EXECUTE statement as shown below.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILEname tmp pipe "dir /b ""abc/ddd/%str(*).xpt""";
libname ms "abc/ddd";

data _null_;
  infile   tmp    TRUNCOVER;
  input    Dir_Listing    $256.;
  call execute(cats('libname xptfile xport "abc/ddd/', Dir_Listing, '";'));
  call execute('proc copy inlib=xptfile outlib=ms; run;');
  call execute('filename xptfile clear;');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Oct 2020 00:28:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-need-for-converting-multiple-xpt-files-in-folder-to-sas/m-p/690739#M210148</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-11T00:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help need for converting multiple xpt files in folder to sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-need-for-converting-multiple-xpt-files-in-folder-to-sas/m-p/690781#M210173</link>
      <description>&lt;P&gt;Also, I don't think you need %str(*)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILEname tmp pipe "dir /b ""abc/ddd/*.xpt""";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or even simpler&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILEname tmp pipe "dir /b abc/ddd/*.xpt";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Oct 2020 11:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-need-for-converting-multiple-xpt-files-in-folder-to-sas/m-p/690781#M210173</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-11T11:45:42Z</dc:date>
    </item>
  </channel>
</rss>

