Sunday, December 15, 2013

Read SAS Transport file in .cpt or .dat format

READ .cpt file

* assign filename "in" to CPORT file "winners.cpt";
filename in "winners.cpt";

libname out '/work/';

* read from "winners.cpt" and save in library "out";
proc cimport file=in library=out;

* use proc contents, proc print, and proc means to verify ;
*   that was created properly;
* change winners to the name of your data member;

proc contents;

proc print;

proc means;

READ .dat file

* Using PROC CPORT, you can create a transport file in .dat extension.  You can use the code below and modify to where you store the .dat file;  
libname outlib 'C:\TEMP';
filename infile 'TAL050003XF.dat';
proc cimport library=outlib file=infile;

No comments:

Post a Comment