<?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: Convert .XPT to SAS Datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/502287#M134067</link>
    <description>&lt;P&gt;Wow, What a simple solution!&amp;nbsp;&lt;/P&gt;&lt;P&gt;NO headache noe&lt;/P&gt;</description>
    <pubDate>Sun, 07 Oct 2018 23:25:06 GMT</pubDate>
    <dc:creator>ajkalale</dc:creator>
    <dc:date>2018-10-07T23:25:06Z</dc:date>
    <item>
      <title>Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/97872#M20624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was given a folder full of .xpt files.&amp;nbsp; Is there code that can read in the XPT folder and convert them into SAS datasets (.sas7bdat)?&amp;nbsp; I have never dealt with XPT files before, so I don't have a clue where to start.&amp;nbsp; Here is a sample of the code that I have been attempting:&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; xptfile &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;xport&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'C:\XPT Datasets'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; sasfile &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'C:\SAS Datasets'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; sasfile.ca125cec;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; xptfile.ca125cec;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; sasfile.ca125cen;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; xptfile.ca125cen;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem with this is that the xptfile library contains nothing when read in.&amp;nbsp; The log says that the library was successfully created, but when I click on the library icon to open it, it gives me an error message: "ERROR, Invalid file, C:\XPT Datasets."&amp;nbsp; Therefore, when the data steps are executed, nothing goes in, and nothing goes out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 14:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/97872#M20624</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2013-02-05T14:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/97873#M20625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the files a V5 transport files then you can point to them with a LIBNAME statement using the XPORT engine, but you have to point to the individual .XPT files, not the folder that contains them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; sasfile &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: purple;"&gt;'C:\SAS Datasets'&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: blue;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: black;"&gt; xptfile &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: blue;"&gt;xport&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: purple;"&gt;'C:\XPT Datasets\ca125cec.xpt' access=readonly&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy;"&gt;proc copy &lt;/STRONG&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;inlib=xptfile outlib=sasfile; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-style: inherit; font-family: 'Courier New'; color: blue;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-style: inherit; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: blue;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: black;"&gt; xptfile &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: blue;"&gt;xport&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: purple;"&gt;'C:\XPT Datasets\ca125cen.xpt' access=readonly&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: navy;"&gt;proc copy &lt;/STRONG&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;inlib=xptfile outlib=sasfile; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: blue;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 14:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/97873#M20625</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-05T14:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/97874#M20626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have a suggestion for running that code through a macro or a loop if I have dozens of .xpt files?&amp;nbsp; I usually do something like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; count(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; memname) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;into&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; :numfiles &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; sashelp.vtable &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; libname=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'XPTFILE'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; numfiles=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(compress(&amp;amp;numfiles.));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; memname &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;into&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; :file1-:file&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;numfiles.&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; sashelp.vtable &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; libname=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'XPTFILE'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I would run your code through a loop. However, this does not work because the xport option in the libname statement does not allow xptfile to appear in the vtable.&amp;nbsp; I don't understand XPT, so I don't know where to find a list of the files in that library.&amp;nbsp; Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 15:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/97874#M20626</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2013-02-05T15:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/97875#M20627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Get the operating system to tell you the names.&amp;nbsp; If your system doesn't allow that then you can use the DOPEN, DREAD functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let path=&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;C:\XPT Datasets;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;filename xptfiles pipe "dir /b ""&amp;amp;path\%str(&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;*).xpt"" " ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-family: 'courier new', courier; background-color: #ffffff;"&gt;filename code temp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-family: 'courier new', courier; background-color: #ffffff;"&gt;data files;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; infile xptfiles truncover;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input filename $100. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; file code;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put 'filename xptfile "&amp;amp;path\' filename +(-1) '" access=readonly;';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; put 'proc copy inlib=xptfile outlib=sasfile; run;' ;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;libname sasfile '....';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%inc code / source2 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 17:09:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/97875#M20627</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-02-05T17:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/229238#M41464</link>
      <description>&lt;P&gt;Hi djbateman, see my solution...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* allocating output directories */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;libname sasfile 'J:\SDTM\c_DefineXML\Define-XML-2-0_RP20140424\sdtm\sas_output';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* create filename 'xptprgs' to capture all *.xpt files */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;filename xptprgs pipe "dir /b J:\SDTM\c_DefineXML\Define-XML-2-0_RP20140424\sdtm\xpt_input\*.xpt";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* create an extra variable 'xptprgs' to contain only the names of the xpt-files */&lt;BR /&gt;data work.xptprgs;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;length filepath $20;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;infile xptprgs length=reclen;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;input filepath $varying256. reclen ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;xptprgs=reverse(substr(trim(left(reverse(filepath))),5));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* create macro variable 'xptprgs' to capture all individual xpt file names */&lt;BR /&gt;proc sql;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;select&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xptprgs&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;into:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xptprgs separated by ' '&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;from&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;work.xptprgs&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;%put &amp;amp;xptprgs;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* loop through all individual files */&lt;BR /&gt;%macro xpt2sas;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;%do i=1 %to %sysfunc(countw(&amp;amp;xptprgs));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; libname xptfile xport "J:\SDTM\c_DefineXML\Define-XML-2-0_RP20140424\sdtm\xpt_input\%scan(&amp;amp;xptprgs, &amp;amp;i).xpt" &amp;nbsp; &amp;nbsp; &amp;nbsp;access=readonly;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; proc copy inlib=xptfile outlib=sasfile;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;run;&lt;BR /&gt;%mend xpt2sas;&lt;/P&gt;&lt;P&gt;%xpt2sas;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kr,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jacques&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2015 09:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/229238#M41464</guid>
      <dc:creator>JacquesCr</dc:creator>
      <dc:date>2015-10-09T09:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/229357#M41508</link>
      <description>Why not just wrap this in a macro loop&lt;BR /&gt;libname xptlib xport "&amp;amp;path2xpt_file" access=readonly;&lt;BR /&gt;* clear receiving library (work here) ;&lt;BR /&gt;Proc datasets mt= data nolist kill lib= work ; quit;&lt;BR /&gt;* copy all tables in xpt to work lib ;&lt;BR /&gt;Proc copy in= xptlib out=work ; run ;&lt;BR /&gt;* deal with the tables in WORK;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Oct 2015 19:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/229357#M41508</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2015-10-09T19:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/238964#M43927</link>
      <description>&lt;P&gt;I have the same issue copy and convert the XPTs. I am using the below code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname sasfile 'C:\SAS Datasets';&lt;BR /&gt;libname xptfile xport 'C:\XPT Datasets\ca125cec.xpt' access=readonly;&lt;BR /&gt;proc copy inlib=xptfile outlib=sasfile;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the below&amp;nbsp;note. I was able to create the Libray with XPTs, Why the file&amp;nbsp;is invalid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: &lt;STRONG&gt;Input library XPTFILE is sequential.&lt;/STRONG&gt;&lt;BR /&gt;ERROR: Invalid file, &lt;SPAN&gt;C:\XPT Datasets\ca125cec.xpt&lt;/SPAN&gt;.&lt;BR /&gt;NOTE: Statements not processed because of errors noted above.&lt;BR /&gt;NOTE: PROCEDURE COPY used (Total process time):&lt;BR /&gt;real time 2.56 seconds&lt;BR /&gt;cpu time 2.38 seconds&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I know how to avoid the above error and get the XPTs converted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 19:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/238964#M43927</guid>
      <dc:creator>Rajesh0136</dc:creator>
      <dc:date>2015-12-11T19:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/239993#M44233</link>
      <description>&lt;P&gt;&amp;nbsp;Hi Rajesh,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a look at your code and did not find anything strange except that i changed the single quotes to double quotes and then it worked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;libname xptfile xport "C:\XPT Datasets\ca125cec.xpt" access=readonly;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Else, I did not see anything peculiar.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jacques&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2015 13:36:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/239993#M44233</guid>
      <dc:creator>JacquesCr</dc:creator>
      <dc:date>2015-12-18T13:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/324465#M72048</link>
      <description>&lt;P&gt;did u get solution with macro?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 06:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/324465#M72048</guid>
      <dc:creator>paddyb</dc:creator>
      <dc:date>2017-01-13T06:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/393984#M94905</link>
      <description>&lt;P&gt;THANK YOU!!! This is PERFECT and exactly what I needed.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 18:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/393984#M94905</guid>
      <dc:creator>sdunn8898</dc:creator>
      <dc:date>2017-09-07T18:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/502287#M134067</link>
      <description>&lt;P&gt;Wow, What a simple solution!&amp;nbsp;&lt;/P&gt;&lt;P&gt;NO headache noe&lt;/P&gt;</description>
      <pubDate>Sun, 07 Oct 2018 23:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/502287#M134067</guid>
      <dc:creator>ajkalale</dc:creator>
      <dc:date>2018-10-07T23:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/625048#M184200</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm trying to read to .xpt data using the SAS studio (University Edition)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm not sure how should I write this code... Please kindly advise, thank you!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Note: My .xpt files locate at C:/SASUniversityEdition/myfolders/Bankdata&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;libname sasfile 'C:\folders\myfolders\Bankdata';&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;libname xptfile xport 'C:\XPT Datasets\CALL1103.xpt' access=readonly;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;proc copy inlib=xptfile outlib=sasfile;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;libname xptfile xport 'C:\XPT Datasets\CALL1103.xpt' access=readonly;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;proc copy inlib=xptfile outlib=sasfile;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance!&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2020 23:29:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/625048#M184200</guid>
      <dc:creator>ritajhuang</dc:creator>
      <dc:date>2020-02-15T23:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/795342#M255100</link>
      <description>This was so helpful! Solved my problem!</description>
      <pubDate>Wed, 09 Feb 2022 21:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/795342#M255100</guid>
      <dc:creator>Tommer</dc:creator>
      <dc:date>2022-02-09T21:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/825691#M326124</link>
      <description>&lt;P&gt;Hi! How do you set the data name after you complete this step?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 15:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/825691#M326124</guid>
      <dc:creator>j1914</dc:creator>
      <dc:date>2022-07-27T15:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert .XPT to SAS Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/902456#M356647</link>
      <description>&lt;P&gt;Simply Amazing! Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Dr. Abhijeet Safai&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 10:26:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/m-p/902456#M356647</guid>
      <dc:creator>DrAbhijeetSafai</dc:creator>
      <dc:date>2023-11-10T10:26:38Z</dc:date>
    </item>
  </channel>
</rss>

