Hello,
I have two files :
SAA1FM.CPORT
SAH1FM.XPORT
I have use the following code to read the above mentioned file due to the propose procedure
but I get this error: CIMPORT is not able to read XPORT engine data sets.
filename entree '/.../SAH1FM.XPORT';
libname sortie '/f.../data_test/';
proc cimport library=sortie infile=entree;
run;
So I believe that I should use the xport engine, but I have never use it, and the few examples I have found, the filename end by xpt while mine end by .xport.
Does someone know how to convert those in Sas dataset?
Regards,
Use LIBNAME XPORT for the .xport file. It should enable you to extract datasets with PROC COPY, or any other means for reading SAS datasets from a library.
You are lucky. Whoever created the files used extensions that make it clear what type of export files they are instead of just using XPT as the extension and forcing you to guess how to read them. Your code has mixed the two methods needed for the two different file types into one unworkable program.
For the XPORT files use the XPORT engine (or if they are using newer XPORT format instead of the original version 5 transport files then use the the %XPT2LOC macro).
libname entree xport '/.../SAH1FM.XPORT';
libname sortie '/f.../data_test/';
proc copy inlib=entree outlib=sortie;
run;
And for the CPORT files use PROC CIMPORT.
libname sortie '/f.../data_test/';
proc cimport infile='/.../SAA1FM.CPORT' lib=sortie;
run;
Use LIBNAME XPORT for the .xport file. It should enable you to extract datasets with PROC COPY, or any other means for reading SAS datasets from a library.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.