You should find this paper helpful: https://support.sas.com/resources/papers/proceedings/proceedings/sugi23/Begtutor/p56.pdf 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: filename xptfile "&xpt";
libname sasfile "&sasds.";
data _NULL_;
infile xptfile obs=1;
input line $ASCII80. ;
call symput('engine',line);
run;
%if %index(&engine,LIBV8) > 0 %then %do;
%xpt2loc(libref=sasfile, filespec=xptfile);
%end;
%else %if %index(&engine,XPORT) > 0 %then %do;
libname xptxport xport "&dsn" access=readonly;
proc copy inlib=xptxport outlib=sasfile;
run;
%end;
%else %do;
proc cimport infile=xptfile library=sasfile memtype=data;
run;
%end;
... View more