Help using Base SAS procedures

Can I get a listing of the contents of a CPORT file?

Super Contributor
Posts: 398

Can I get a listing of the contents of a CPORT file?

If it's in the doc apologies I couldn't find it.


Below is some test code:


* filename out "C:\Temp";  * change as desired ;

proc cport lib=sashelp file="%sysfunc(pathname(out))/testing.cpt";
   select class cars fish shoes stocks;

libname xpt xport "%sysfunc(pathname(out))/testing.xpt";
proc copy in=sashelp out=xpt;
   select class cars fish shoes stocks;

Well that rules out using the xport engine.
In fairness, the 9.4 doc does say:

The XPORT engine supports a feature set that is compatible with SAS 6. 
The XPORT engine cannot support SAS 9 features, such as long variable names. 
Warning or error messages report limitations that are encountered during the transport operation. 
For details about typical error messages and recovery actions, 
see File library.member.DATA has too long a member name for the XPORT engine.

Curiousity/rhetorical questions:  

Are there ANY installations still running SAS V6?
Does SAS even officially support V6?
If the answer is NO, should SAS clean up "bloat" in their software?
For example, isn't the installation of the xport engine just a waste of disk space in SAS 9.x?

proc cimport lib=work file="%sysfunc(pathname(out))/testing.cpt";
   * how do i get a listing of the contents without actually importing??? ;
   * like i can do with tar, zip, 7-zip, rar, etc. ??? ;
Posts: 8,164

Re: Can I get a listing of the contents of a CPORT file?

Posted in reply to ScottBass

@ScottBass: The macro provided in this paper ( ) may be what you're looking for.


As for you comments about whether they are still needed, yes, unless the US govt has changed its requirements and, secondly, definitely needed for those of us who have to access archived versions of historical files.


Art, CEO,


p.s. I'm sure a number of mainframe folks are still using SAS6


Super Contributor
Posts: 398

Re: Can I get a listing of the contents of a CPORT file?

Thanks @art297.  It's good to know there's a hack available for functionality typically provided by similar software archiving/compression packages.


Thanks too for clarifying that V6 is still alive and well, and in production environments.


Ask a Question
Discussion stats
  • 2 replies
  • 1 like
  • 2 in conversation