BookmarkSubscribeRSS Feed
mani0211
Calcite | Level 5

Please tell me how to convert CPT files to XPT files???

4 REPLIES 4
Tom
Super User Tom
Super User

Sure. Define what you mean by CPT and what you mean by XPT.

mani0211
Calcite | Level 5

when i try to open the xpt file in sas viewer 9.130. gettign the error file not valid sas dataset or catalogue.

SASKiwi
PROC Star

The SAS Viewer can only read SAS transport files created with the XPORT engine. If the CPORT procedure was used then it isn't going to work. Either re-export the dataset using the XPORT engine, or use CIMPORT to import the dataset into a form that works with the viewer:

 

http://support.sas.com/kb/42/356.html

 

I don't think you can convert a CPORTed SAS file to an XPT one.

 

Tom
Super User Tom
Super User

SAS System Viewer 9.1 can read SAS datasets,but it is really old and might not be able to read SAS datasets made by current versions of SAS. I know we had trouble with it not reading datasets made using 64-bit Unix version of SAS.

 

Here is how to convert a file made with PROC CPORT back into SAS datasets (or catalogs).

libname out 'my directory name';
proc cimport file='myfilename' lib=out;
run;

or you can use it to view  V5 transport files that have only one member. Note that V5 Transport files are limited to 8 character member and variable names and 200 character character variables.  But if your data fits into those limitations then you could try having PROC CIMPORT write directly to the V5 transport file.

libname out xport  'my new file name';
proc cimport file='my old file name' lib=out;
run;

 

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 3561 views
  • 2 likes
  • 3 in conversation