Posts

Showing posts with the label .XPT to SAS

Transporting SAS Files using Proc Copy and or Proc Cport/Proc Cimport

When moving SAS datasets /catalogs from one type of computer to another, there are several things to be considered, such as the operating systems of the two computers, the versions of SAS and the type of communication link between the computers. The easiest way to move SAS datasets from one system to another system is to: Create a transport file using any SAS version. Move the transport file to the new system. Import the transport file on the new system. Transport datasets are 80-byte length binary files made from SAS datasets. PROC COPY or PROC CPORT can create Transport datasets but they both create different types of transport files. Transport files can be created and read using either PROC COPY or PROC CPORT & PROC CIMPORT, but you cannot mix and match. Transport files created with PROC COPY must be read with PROC COPY; those created by PROC CPORT must be read with PROC CIMPORT. PROC COPY uses an engine (i.e. XPORT) to create a SAS transport file. PROC COPY is used to tra...

SAS Macros that Convert a Directory of Transport Files

There is a set of SAS macros, converts a directory of transport files to a directory of SAS data sets and format catalogs (and vice versa). To see how to invoke the macros, look at the test following the last macro. The macros make the assumption that transport files created from data sets have the extension .xpt, and transport files created from format catalogs have the extension .xpf. %expfmts : This macro will convert an existing format catalog into a data set in transport format. % expdset : This macro will convert an existing SAS data set into a transport file. %impfmts : This macro will convert a transport CNTLOUT data set into a native format catalog. %impdset : This macro will convert a transport data set into a native SAS data set. %getnames : This macro will create a SAS data set consisting of a variable called FILENAME. There will be one observation for each file in the specified directory with the specified extension. Direct link: http://www.sas.co...