<?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: Invalid SAS transport file, problem on second record in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-SAS-transport-file-problem-on-second-record/m-p/161977#M42121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have exacly the same problem. If anyone has an answer, it would be very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jan 2015 10:52:21 GMT</pubDate>
    <dc:creator>AnalytX</dc:creator>
    <dc:date>2015-01-07T10:52:21Z</dc:date>
    <item>
      <title>Invalid SAS transport file, problem on second record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-SAS-transport-file-problem-on-second-record/m-p/161976#M42120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am generating single dataset transport files using the PROC CPORT method.&amp;nbsp; I have no error/warning messages in the conversion to transport files, and have no issues re-importing the datasets using PROC CIMPORT.&amp;nbsp; However, if I try to open the .xpt file using Universal Viewer then I get an error ("The file xxxxx could not be loaded, Invalid SAS transport file, problem on second record").&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Can anyone please shed light on the cause of such an error.&amp;nbsp; I've even tried a really simple test dataset (one variable, one entry), and still get the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the code I'm using to generate the transport files:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; background: white;"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black;"&gt; export (data=);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: black;"&gt;filename &amp;amp;data "path......&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple;"&gt;\&amp;amp;data..xpt"&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 10pt; background: white; font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: black;"&gt;proc cport data=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal;"&gt;ITP.&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black;"&gt;&amp;amp;data file=&amp;amp;data; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; background: white;"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black;"&gt; export;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;%&lt;STRONG&gt;&lt;EM&gt;export &lt;/EM&gt;&lt;/STRONG&gt;(data=ADR)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;%&lt;STRONG&gt;&lt;EM&gt;export &lt;/EM&gt;&lt;/STRONG&gt;(data=COMPL)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; line-height: 115%; font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;%&lt;STRONG&gt;&lt;EM&gt;export &lt;/EM&gt;&lt;/STRONG&gt;(data=CONMEDS)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; line-height: 115%; font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;....................................&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Elisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 14:06:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-SAS-transport-file-problem-on-second-record/m-p/161976#M42120</guid>
      <dc:creator>Elisa</dc:creator>
      <dc:date>2014-05-16T14:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid SAS transport file, problem on second record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-SAS-transport-file-problem-on-second-record/m-p/161977#M42121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have exacly the same problem. If anyone has an answer, it would be very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2015 10:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-SAS-transport-file-problem-on-second-record/m-p/161977#M42121</guid>
      <dc:creator>AnalytX</dc:creator>
      <dc:date>2015-01-07T10:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid SAS transport file, problem on second record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-SAS-transport-file-problem-on-second-record/m-p/161978#M42122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did end up finding the solution.&amp;nbsp;&amp;nbsp; Datasets created by PROC CPORT have to be read into SAS by using PROC CIMPORT.&amp;nbsp; You can name the&amp;nbsp; *.xpt, but it is not actually a v5 xpt format file.&amp;nbsp; SAS viewer can't open datasets created by PROC CPORT.&amp;nbsp; To create v5 xpt files you need to use XPORT engine.&amp;nbsp; An Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;%macro v5export (data=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname &amp;amp;DATA xport "C:\&amp;amp;DATA..xpt";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;proc copy in=ITP out=&amp;amp;DATA memtype=data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select &amp;amp;DATA;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend v5export;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;%v5export (data=ADR)&lt;/P&gt;&lt;P&gt;%v5export (data=COMPL)&lt;/P&gt;&lt;P&gt;%v5export (data=CONMEDS)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 01:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-SAS-transport-file-problem-on-second-record/m-p/161978#M42122</guid>
      <dc:creator>Elisa</dc:creator>
      <dc:date>2015-01-08T01:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid SAS transport file, problem on second record</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-SAS-transport-file-problem-on-second-record/m-p/161979#M42123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Elisa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your answer which is of a great help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 08:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-SAS-transport-file-problem-on-second-record/m-p/161979#M42123</guid>
      <dc:creator>AnalytX</dc:creator>
      <dc:date>2015-01-08T08:49:21Z</dc:date>
    </item>
  </channel>
</rss>

