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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 3022 views
  • 2 likes
  • 3 in conversation