<?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 XPT2LOC Macro VS Libname XPORT Proc copy in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/XPT2LOC-Macro-VS-Libname-XPORT-Proc-copy/m-p/690902#M210216</link>
    <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;We are updating our code to use xpt2loc macro to extract the V6 and V8 format xpt file.&lt;/P&gt;&lt;P&gt;Kindly help me with the below queries.&lt;/P&gt;&lt;P&gt;What is pros and cons of using xpt2loc macro?&lt;/P&gt;&lt;P&gt;Why libname xport is not supporting the V8 format xpt file which is created by loc2xpt macro?&lt;/P&gt;&lt;P&gt;What is the different in using xpt2loc macro and libname xport proc copy for extracting files?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sasikala.k&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2020 08:03:32 GMT</pubDate>
    <dc:creator>sasikala</dc:creator>
    <dc:date>2020-10-12T08:03:32Z</dc:date>
    <item>
      <title>XPT2LOC Macro VS Libname XPORT Proc copy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XPT2LOC-Macro-VS-Libname-XPORT-Proc-copy/m-p/690902#M210216</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;We are updating our code to use xpt2loc macro to extract the V6 and V8 format xpt file.&lt;/P&gt;&lt;P&gt;Kindly help me with the below queries.&lt;/P&gt;&lt;P&gt;What is pros and cons of using xpt2loc macro?&lt;/P&gt;&lt;P&gt;Why libname xport is not supporting the V8 format xpt file which is created by loc2xpt macro?&lt;/P&gt;&lt;P&gt;What is the different in using xpt2loc macro and libname xport proc copy for extracting files?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sasikala.k&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 08:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XPT2LOC-Macro-VS-Libname-XPORT-Proc-copy/m-p/690902#M210216</guid>
      <dc:creator>sasikala</dc:creator>
      <dc:date>2020-10-12T08:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: XPT2LOC Macro VS Libname XPORT Proc copy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XPT2LOC-Macro-VS-Libname-XPORT-Proc-copy/m-p/690989#M210261</link>
      <description>&lt;P&gt;You should find this paper helpful:&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi23/Begtutor/p56.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi23/Begtutor/p56.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can read the header line in transport files and use the correct macro, depending on the host environment where the xpt got created, something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename xptfile "&amp;amp;xpt";
libname sasfile "&amp;amp;sasds.";        
data _NULL_; 
    infile xptfile obs=1;
    input line $ASCII80. ;
    call symput('engine',line);
run;

%if %index(&amp;amp;engine,LIBV8) &amp;gt; 0 %then %do;
    %xpt2loc(libref=sasfile, filespec=xptfile);
%end;
%else %if %index(&amp;amp;engine,XPORT) &amp;gt; 0 %then %do;
    libname xptxport xport "&amp;amp;dsn" access=readonly;
    proc copy inlib=xptxport outlib=sasfile;
    run;                
%end;
%else %do;
    proc cimport infile=xptfile library=sasfile memtype=data;
    run;
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Oct 2020 14:35:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XPT2LOC-Macro-VS-Libname-XPORT-Proc-copy/m-p/690989#M210261</guid>
      <dc:creator>vellad</dc:creator>
      <dc:date>2020-10-12T14:35:06Z</dc:date>
    </item>
  </channel>
</rss>

