Using the EXTENDSN Option with Proc CIMPORT
SAS Transport files are used when there is a need to move or copy SAS files between different platforms. For example, SAS data sets and catalogs used in a Windows environment, may be required in a Unix environment.
Creating the transport file can be done using Proc CPORT, as shown in the following example:
libname srclib 'e:study123saslib' ; filename cport1 'e:transportpharma1.cpt'; proc cport library=srclib file=cport1; run;
Extracting the data sets from the transport file can be done using Proc CIMPORT:
libname targlib 'usr52/saslib'; filename cport1 'usr52/saslib/pharma1.cpt'; proc cimport file=cport1 library=targlib; run;
However, a technical point that is often overlooked when using transport files, is the change of length that occurs with numeric variables whose length is less than eight bytes. By default SAS adds one byte to all such variables, so that numeric precision is not lost when data is moved from an operating system that can handle a numeric length of two, to one where the minimum length is three.
In some instances, the increase in length can cause problems, such as when data sets on different platforms are compared for validation purposes. In this situation, a simple solution is to include the EXTENDSN=NO option on the Proc CIMPORT statement, as this will prevent the additional byte from being added when SAS data sets are re-created:
proc cimport file=cport1 library=targlib extendsn=no;
run;
Please beware that it is only safe to use this option if the risk of losing precision is known or accepted.