<?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: xport transport file not extracting empty datasets (0 observations) properly in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765000#M242292</link>
    <description>&lt;P&gt;Tested this with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets lib=work kill nolist;
quit;

data d1;
x = 0;
stop;
run;

data d2;
x = 0;
stop;
run;

data d3;
x = 0;
stop;
run;

%loc2xpt(libref=work,
filespec='~/test.xpt',
FORMAT=V8);

proc datasets lib=work kill nolist;
quit;

%xpt2loc(libref=work,
filespec='~/test.xpt');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;on ODA, and the import created wrong results, D1 has 160 and D2 80 observations with bogus values; only D3 imported correctly with zero observations. I repeated the action and omitted the FORMAT= parameter, same result.&lt;/P&gt;
&lt;P&gt;In my experience, simple PROC CPORT / PROC CIMPORT works so well, there's no need for anything else:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets lib=work kill nolist;
quit;

data d1;
x = 0;
stop;
run;

data d2;
x = 0;
stop;
run;

data d3;
x = 0;
stop;
run;

proc cport lib=work file='~/test.xpt' memtype=data;
run;

proc datasets lib=work kill nolist;
quit;

proc cimport file='~/test.xpt' lib=work;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;works like a charm, and does not flood the log with lots of NOTEs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Aug 2021 07:51:46 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-08-31T07:51:46Z</dc:date>
    <item>
      <title>xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/764810#M242258</link>
      <description>&lt;P&gt;i) In Linux box using SAS V9.4, I created 3 datasets which has one variable but no observations. Essentially, all datasets are empty.&lt;BR /&gt;ii) I used loc2xpt macro to create v8 xport file using above 3 sets.&lt;BR /&gt;iii) Then I moved this file to target computer (windows box) and used xpt2loc macro to extract above datasets.&lt;BR /&gt;iv) Now when I try to open these extracted datasets in SAS, xport file content is getting displayed as observation in first and second datasets. For 3rd dataset, obs are shown as 0 (which is expected).&lt;/P&gt;&lt;P&gt;Below is the code I used to create and extract transport file contents respectively.&lt;/P&gt;&lt;P&gt;libname source '/home/datasets';&lt;BR /&gt;%loc2xpt(libref=source,&lt;BR /&gt;filespec='/home/transportfiles/test.xpt',&lt;BR /&gt;FORMAT=V8)&lt;BR /&gt;&lt;BR /&gt;libname source 'C:\Users\xxx\Downloads\datasets';&lt;BR /&gt;%xpt2loc(libref=source,&lt;BR /&gt;filespec='C:\Users\xxx\Downloads\test.xpt');&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Can someone help me why first and second datasets obs are not empty. Is there a workaround for this? Thanks.&lt;/P&gt;&lt;P&gt;I attached zip file which contains the original transport file and snapshot of dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I opened these datasets manually at source before creating xport file and confirmed that all datasets observations are 0.&lt;/P&gt;&lt;P&gt;Additional info: Encoding: UTF-8, Source: Linux, Target: Windows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 11:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/764810#M242258</guid>
      <dc:creator>himamsa</dc:creator>
      <dc:date>2021-08-30T11:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/764913#M242275</link>
      <description>&lt;P&gt;I recommend using PROC CPORT / PROC CIMPORT instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create some empty data sets for testing */
data work.one
     work.two
     work.three;
   stop;
   length text $1 number 8;
run;

/* Prove tables exists with no rows */
proc sql;
select MEMNAME, NVAR, NLOBS
   from dictionary.tables
   where memname in ("ONE","TWO","THREE");
quit;

/* Export the empty datasets */
filename xport "c:\temp\my_transport_file.xpt";
proc cport library=work file=xport memtype=data;
run;
filename xport clear;

/* Clear out all datasets in the WORK library */
proc datasets library=work kill nolist nodetails;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;From the Results tab:&lt;/P&gt;
&lt;TABLE&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TD&gt;Member Name&lt;/TD&gt;
&lt;TD&gt;Number of Variables&lt;/TD&gt;
&lt;TD&gt;Number of Observations&lt;/TD&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;ONE&lt;/TD&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;THREE&lt;/TD&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;TWO&lt;/TD&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, re-import the data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Import the empty data sets */
filename import "c:\temp\my_transport_file.xpt";
proc cimport library=work file=import;
run;

/* Prove tables exists with no rows */
proc sql;
select MEMNAME, NVAR, NLOBS
   from dictionary.tables
   where memname in ("ONE","TWO","THREE");
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;From the Results tab:&lt;/P&gt;
&lt;TABLE&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TD&gt;Member Name&lt;/TD&gt;
&lt;TD&gt;Number of Variables&lt;/TD&gt;
&lt;TD&gt;Number of Observations&lt;/TD&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;ONE&lt;/TD&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;THREE&lt;/TD&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;TWO&lt;/TD&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should wor better for you.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 17:58:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/764913#M242275</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2021-08-30T17:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/764915#M242276</link>
      <description>&lt;P&gt;Hi, Thanks for the response. I have already tried for cport format and verified that it is working fine. But I am looking to achieve the same for xport format in V8.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 18:06:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/764915#M242276</guid>
      <dc:creator>himamsa</dc:creator>
      <dc:date>2021-08-30T18:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765000#M242292</link>
      <description>&lt;P&gt;Tested this with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets lib=work kill nolist;
quit;

data d1;
x = 0;
stop;
run;

data d2;
x = 0;
stop;
run;

data d3;
x = 0;
stop;
run;

%loc2xpt(libref=work,
filespec='~/test.xpt',
FORMAT=V8);

proc datasets lib=work kill nolist;
quit;

%xpt2loc(libref=work,
filespec='~/test.xpt');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;on ODA, and the import created wrong results, D1 has 160 and D2 80 observations with bogus values; only D3 imported correctly with zero observations. I repeated the action and omitted the FORMAT= parameter, same result.&lt;/P&gt;
&lt;P&gt;In my experience, simple PROC CPORT / PROC CIMPORT works so well, there's no need for anything else:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets lib=work kill nolist;
quit;

data d1;
x = 0;
stop;
run;

data d2;
x = 0;
stop;
run;

data d3;
x = 0;
stop;
run;

proc cport lib=work file='~/test.xpt' memtype=data;
run;

proc datasets lib=work kill nolist;
quit;

proc cimport file='~/test.xpt' lib=work;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;works like a charm, and does not flood the log with lots of NOTEs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 07:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765000#M242292</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-31T07:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765020#M242294</link>
      <description>&lt;P&gt;Similarly, if you want to use the XPORT engine to go to an earlier SAS release, doing it yourself is straight forward:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xpt xport "~/test.xpt";

proc copy in=work out=xpt memtype=data;
select d:;
run;

libname xpt clear;

libname xpt xport "~/test.xpt";

proc datasets lib=work kill nolist;
quit;

proc copy in=xpt out=work;
run;

libname xpt clear;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Aug 2021 10:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765020#M242294</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-31T10:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765025#M242295</link>
      <description>&lt;P&gt;What happens if you create a fileref that points to the XPORT file instead of trying to pass the macro a physical filename?&lt;/P&gt;
&lt;P&gt;That worked for me.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname source 'C:\Users\xxx\Downloads\datasets';
filename xpt 'C:\Users\xxx\Downloads\test.xpt';
%xpt2loc(libref=source,filespec=xpt);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 11:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765025#M242295</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-31T11:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765041#M242297</link>
      <description>The file generated by PROC CPORT is not a real  XPT file . FDA would not accept it .</description>
      <pubDate>Tue, 31 Aug 2021 12:52:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765041#M242297</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-08-31T12:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765055#M242302</link>
      <description>Hi Tom, this also didnt work for me. Maybe you generated for v5 format. v5 format works fine but not v8.&lt;BR /&gt;I am looking to create v8 xport file as my requirement is I have few non empty datasets whose variable length is greater than 32. Thanks.</description>
      <pubDate>Tue, 31 Aug 2021 13:39:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765055#M242302</guid>
      <dc:creator>himamsa</dc:creator>
      <dc:date>2021-08-31T13:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765058#M242305</link>
      <description>&lt;P&gt;I am lost in what you are trying to test.&lt;/P&gt;
&lt;P&gt;I was able to load that XPT file into the WORK library using the SAS supplied macro.&lt;/P&gt;
&lt;P&gt;There were three datasets.&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;NOTE: The data set WORK.FORM_04 has 1280 observations and 1 variables.
&lt;/STRONG&gt;NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds



NOTE: UNBUFFERED is the default with RECFM=N.
NOTE: The infile XPT is:
      Filename=C:\downloads\xpt_emptydataset\xpt_emptydataset\test.xpt,
      RECFM=N,LRECL=32767,File Size (bytes)=1920,
      Last Modified=30Aug2021:06:23:30,
      Create Time=31Aug2021:07:14:46

&lt;STRONG&gt;NOTE: The data set WORK.LB_01 has 640 observations and 1 variables.
&lt;/STRONG&gt;NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds



NOTE: UNBUFFERED is the default with RECFM=N.
NOTE: The infile XPT is:
      Filename=C:\downloads\xpt_emptydataset\xpt_emptydataset\test.xpt,
      RECFM=N,LRECL=32767,File Size (bytes)=1920,
      Last Modified=30Aug2021:06:23:30,
      Create Time=31Aug2021:07:14:46

&lt;STRONG&gt;NOTE: The data set WORK.LB_01_1 has 0 observations and 1 variables.
&lt;/STRONG&gt;NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;What is happening differently on your machine?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 14:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765058#M242305</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-31T14:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765113#M242329</link>
      <description>&lt;P&gt;Since, from the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/movefile/p1tp8gighlgeifn173i6kzw2w3bu.htm" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;, the datasets should be unchanged after export/import with these macros, and the test on ODA that I did clearly contradicts this, I suggest you bring this to the attention of SAS technical support, as this looks like a (IMHO serious) bug to me.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 17:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765113#M242329</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-31T17:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765117#M242332</link>
      <description>At source computer I have 3 empty datasets (1 variable and 0 observations). Then I created xport file in V8 format using loc2xpt.&lt;BR /&gt;And then at target computer, I extracted these 3 datasets from this xport file using xpt2loc.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Expected: Now when I view the extracted datasets, all of these should have been empty.&lt;BR /&gt;Actual: But FORM_04 and LB_01 are not turning out be empty as per logs below. These contains some observations which is wrong. So, I am trying to figure out the solution for this.&lt;BR /&gt;&lt;BR /&gt;NOTE: The data set WORK.FORM_04 has 1280 observations and 1 variables.&lt;BR /&gt;NOTE: The data set WORK.LB_01 has 640 observations and 1 variables.</description>
      <pubDate>Tue, 31 Aug 2021 17:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765117#M242332</guid>
      <dc:creator>himamsa</dc:creator>
      <dc:date>2021-08-31T17:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765118#M242333</link>
      <description>I am a novice in SAS so I am exploring options to see if there is a way to fix this before I contact SAS support.</description>
      <pubDate>Tue, 31 Aug 2021 17:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765118#M242333</guid>
      <dc:creator>himamsa</dc:creator>
      <dc:date>2021-08-31T17:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765120#M242334</link>
      <description>&lt;P&gt;So it looks like the macro has consumed the header and other records in the XPT file as if they were data lines for the first two files.&amp;nbsp; The last file is generated with Zero observations because there are no trailing records to confuse it.&lt;/P&gt;
&lt;PRE&gt;154   data _null_;
155     set form_04 (obs=20);
156     put nodata $1. @;
157   run;

HEADER RECORD*******
NOTE: There were 20 observations read from the data set WORK.FORM_04.
&lt;/PRE&gt;
&lt;P&gt;Until you get a fix the work around is to write only one dataset per file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or just make sure your datasets conform to SAS Version 5 standards (8 character names, 200 maximum character string, 40 character labels) and use the real XPORT engine instead of the SAS macros.&amp;nbsp; Example code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.one
     work.two
     work.three;
   stop;
   length text $1 number 8;
run;

filename new temp ;
libname xpt xport "%sysfunc(pathname(new))";
proc copy inlib=work outlib=xpt;
  select one two three;
run;

proc copy inlib=xpt out=work;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PROC COPY correctly generates dataset with zero observations.&lt;/P&gt;
&lt;PRE&gt;256   proc copy inlib=xpt out=work;
257   run;

NOTE: Input library XPT is sequential.
NOTE: Copying XPT.ONE to WORK.ONE (memtype=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used.
NOTE: There were 0 observations read from the data set XPT.ONE.
NOTE: The data set WORK.ONE has 0 observations and 2 variables.
NOTE: Copying XPT.TWO to WORK.TWO (memtype=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used.
NOTE: There were 0 observations read from the data set XPT.TWO.
NOTE: The data set WORK.TWO has 0 observations and 2 variables.
NOTE: Copying XPT.THREE to WORK.THREE (memtype=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used.
NOTE: There were 0 observations read from the data set XPT.THREE.
NOTE: The data set WORK.THREE has 0 observations and 2 variables.
NOTE: PROCEDURE COPY used (Total process time):
      real time           0.01 seconds
      cpu time            0.03 seconds
&lt;/PRE&gt;
&lt;P&gt;But if you try to read that demonstrably valid XPORT file using the macro instead the same thing happens as with your example.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%xpt2loc(libref=work,filespec=xpt);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;NOTE: The data set WORK.ONE has 178 observations and 2 variables.
NOTE: The data set WORK.TWO has 89 observations and 2 variables.
NOTE: The data set WORK.THREE has 0 observations and 2 variables.
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 17:54:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765120#M242334</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-31T17:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765133#M242340</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/321579"&gt;@himamsa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I am a novice in SAS so I am exploring options to see if there is a way to fix this before I contact SAS support.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is a bug in a SAS-supplied macro. The proper people to deal with bugs in SAS software sit at SAS TS. Being a novice does not mean you can't stumble across a bug.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 18:07:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765133#M242340</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-31T18:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765308#M242398</link>
      <description>&lt;P&gt;Here is a method to split the XPT file into individual files.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  if eof then call symputx('nmembers',memnum);
  infile xpt lrecl=80 recfm=f end=eof;
  if _n_=1 then do;
    input line1 $char80. / line2 $char80. / line3 $char80. ;
    retain line1-line3;
  end;
  input ;
  if _infile_=:'HEADER RECORD*******MEM' then do;
    memnum+1;
    lineno=0;
    filename=cats(pathname('work'),'/temp',memnum,'.xpt');
  end;
  file out lrecl=80 recfm=f filevar=filename;
  if lineno=0 then put line1 $char80. / line2 $char80. / line3 $char80. ;
  lineno+1;
  put _infile_;
run;
%put &amp;amp;=nmembers;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Sep 2021 11:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765308#M242398</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-09-01T11:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765866#M242624</link>
      <description>&lt;P&gt;Thanks for the explanation!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 14:16:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/765866#M242624</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2021-09-03T14:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: xport transport file not extracting empty datasets (0 observations) properly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/767140#M243168</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/321579"&gt;@himamsa&lt;/a&gt;&amp;nbsp;I have reported this bug to Development.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp; Thanks for reporting it to SAS Technical Support.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 21:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/xport-transport-file-not-extracting-empty-datasets-0/m-p/767140#M243168</guid>
      <dc:creator>JodyC_SAS</dc:creator>
      <dc:date>2021-09-10T21:28:03Z</dc:date>
    </item>
  </channel>
</rss>

