Posts

Showing posts with the label Proc Copy

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

HOW TO CREATE A TRANSPORT FILE

Image
CREATING A TRANSPORT FILE:

In SAS, how do I create a transport data set file?

In SAS, how do I create a transport data set file? Source/direct link: http://kb.iu.edu/data/aevb.html A SAS transport data set file is a machine-independent file that allows you to move a SAS data set from one operating system to another. A SAS transport data set file can also be read directly by several statistical software packages (e.g., SPSS, BMDP). Following is an example of SAS code to copy the SAS data set file job1.sas7bdat to a SAS transport data set file portable.xpt in the outdata directory: LIBNAME misc ' ~/work' ; LIBNAME sasxpt XPORT ' ~/outdata/portable.xpt' ; PROC COPY IN=misc OUT=sasxpt ; SELECT job1; RUN ; In the example above: The first LIBNAME statement aliases the library reference (libref) misc to the work directory. The second LIBNAM E statement aliases the libref sasxpt with the physical name of a SAS transport format file (in this case, portable.xpt in the outdata directory). The COPY procedure copies one or more SAS data sets in the IN = l...