DATA Step, Macro, Functions and more

CPT files to XPT files

Reply
Occasional Contributor
Posts: 7

CPT files to XPT files

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

Super User
Super User
Posts: 6,502

Re: CPT files to XPT files

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

Occasional Contributor
Posts: 7

Re: CPT files to XPT files

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

Super User
Posts: 3,115

Re: CPT files to XPT files

[ Edited ]

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.

 

Super User
Super User
Posts: 6,502

Re: CPT files to XPT files

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;

 

 

Ask a Question
Discussion stats
  • 4 replies
  • 515 views
  • 2 likes
  • 3 in conversation