BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

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,

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
2 REPLIES 2
Tom
Super User Tom
Super User

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;

 

 

Kurt_Bremser
Super User

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 3284 views
  • 2 likes
  • 3 in conversation