<?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: Cannot import XPT file into SAS? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Cannot-import-XPT-file-into-SAS/m-p/668462#M200383</link>
    <description>&lt;P&gt;Please show the code you used to "import" the file.&lt;/P&gt;
&lt;P&gt;The following code shows use of the XPORT library engine to connect to the file and then a data step to save the data from the transport file to a different library.&lt;/P&gt;
&lt;P&gt;Use your paths and files. You can check on the contents of the xport library just like you would any other library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-eDocBody"&gt;
&lt;DIV id="p1jh0bxvsp3eimn13i4fc7hmaaa9" class="xis-topic"&gt;
&lt;DIV id="p0f4e9xqpcmaomn1jsu1hlf7ktj9" class="xis-subTopic"&gt;
&lt;DIV id="p1vkwitt1ss0ktn1q4wffxcbayzx" class="xis-topicContent"&gt;
&lt;DIV id="n17n28iuyryjdmn1i8uq8es9wbkl" class="xis-codeBlock"&gt;
&lt;PRE class="xis-code"&gt;libname xportin xport
'&lt;SPAN class="xis-userSuppliedValue"&gt;transport-file&lt;/SPAN&gt;';
libname target '&lt;SPAN class="xis-userSuppliedValue"&gt;SAS-data-library&lt;/SPAN&gt;';
data target.grades;
   set xportin.grades;
run;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Fri, 10 Jul 2020 19:44:56 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-07-10T19:44:56Z</dc:date>
    <item>
      <title>Cannot import XPT file into SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-import-XPT-file-into-SAS/m-p/668444#M200372</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying to download this file (&lt;A href="https://www.cdc.gov/brfss/annual_data/2018/files/LLCP2018XPT.zip" target="_blank"&gt;2018 BRFSS Data (SAS Transport Format) .cls-1{fill:#ffca28;}.cls-2{opacity:0.2;}.cls-3{fill:#3e2723;} ZIP [ZIP – 101 MB]&lt;/A&gt;&amp;nbsp;) from this&lt;A href="https://www.cdc.gov/brfss/annual_data/annual_2018.html" target="_self"&gt; link&lt;/A&gt;. However, it downloads as a XPT document on my MacBook. I've tried importing it but it doesn't open. Given that I'm not familiar with programming, this adds to my headache.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would someone kindly show me how to write a script to open it or download it and convert to an excel file for me please? I'm really distressed because I have spent 7+ hours on it but it still wouldn't open.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 19:00:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-import-XPT-file-into-SAS/m-p/668444#M200372</guid>
      <dc:creator>k32</dc:creator>
      <dc:date>2020-07-10T19:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot import XPT file into SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-import-XPT-file-into-SAS/m-p/668461#M200382</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname sasfile '/folders/myfolders/';

libname xptfile xport '/folders/myfolders/NameofFile.xpt' access=readonly;

proc copy inlib=xptfile outlib=sasfile;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/337290"&gt;@k32&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've been trying to download this file (&lt;A href="https://www.cdc.gov/brfss/annual_data/2018/files/LLCP2018XPT.zip" target="_blank" rel="noopener"&gt;2018 BRFSS Data (SAS Transport Format) .cls-1{fill:#ffca28;}.cls-2{opacity:0.2;}.cls-3{fill:#3e2723;} ZIP [ZIP – 101 MB]&lt;/A&gt;&amp;nbsp;) from this&lt;A href="https://www.cdc.gov/brfss/annual_data/annual_2018.html" target="_self"&gt; link&lt;/A&gt;. However, it downloads as a XPT document on my MacBook. I've tried importing it but it doesn't open. Given that I'm not familiar with programming, this adds to my headache.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would someone kindly show me how to write a script to open it or download it and convert to an excel file for me please? I'm really distressed because I have spent 7+ hours on it but it still wouldn't open.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Search terms: "import xpt file sas"&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/td-p/97872" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Convert-XPT-to-SAS-Datasets/td-p/97872&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 19:41:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-import-XPT-file-into-SAS/m-p/668461#M200382</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-10T19:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot import XPT file into SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-import-XPT-file-into-SAS/m-p/668462#M200383</link>
      <description>&lt;P&gt;Please show the code you used to "import" the file.&lt;/P&gt;
&lt;P&gt;The following code shows use of the XPORT library engine to connect to the file and then a data step to save the data from the transport file to a different library.&lt;/P&gt;
&lt;P&gt;Use your paths and files. You can check on the contents of the xport library just like you would any other library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-eDocBody"&gt;
&lt;DIV id="p1jh0bxvsp3eimn13i4fc7hmaaa9" class="xis-topic"&gt;
&lt;DIV id="p0f4e9xqpcmaomn1jsu1hlf7ktj9" class="xis-subTopic"&gt;
&lt;DIV id="p1vkwitt1ss0ktn1q4wffxcbayzx" class="xis-topicContent"&gt;
&lt;DIV id="n17n28iuyryjdmn1i8uq8es9wbkl" class="xis-codeBlock"&gt;
&lt;PRE class="xis-code"&gt;libname xportin xport
'&lt;SPAN class="xis-userSuppliedValue"&gt;transport-file&lt;/SPAN&gt;';
libname target '&lt;SPAN class="xis-userSuppliedValue"&gt;SAS-data-library&lt;/SPAN&gt;';
data target.grades;
   set xportin.grades;
run;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 10 Jul 2020 19:44:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-import-XPT-file-into-SAS/m-p/668462#M200383</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-10T19:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot import XPT file into SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-import-XPT-file-into-SAS/m-p/668640#M200461</link>
      <description>&lt;P&gt;Why would you want to go from one hard to use format to another?&lt;/P&gt;
&lt;P&gt;That file is a ZIP file that contains a SAS version 5 transport file that contain a single SAS dataset.&lt;/P&gt;
&lt;P&gt;So to use it in SAS all you need to do is first download the ZIP and then unzip it and point a libref at it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xx xport 'c:\downloads\LLCP2018.XPT';
proc contents data=xx._all_; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output of PROC CONTENTS shows that there is just one member in the xport file and it is named LLCP2028.&lt;/P&gt;
&lt;P&gt;So to use the file directly just use code like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=xx.LLCP2018; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you really want to copy the datasets in the xport file into an Excel spreadsheet then make a second libref and use proc copy.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname out xlsx  'c:\downloads\LLCP2018.xlsx';
proc copy inlib=xx outlib=out;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Jul 2020 14:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-import-XPT-file-into-SAS/m-p/668640#M200461</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-12T14:34:40Z</dc:date>
    </item>
  </channel>
</rss>

