Examples use generated data (datalines) or SASHELP.
1 Code Block
PROC MIGRATE
Explanation : This example uses the MIGRATE procedure to move members of a SAS library to a newer SAS version. The procedure is the preferred method because it preserves data attributes. The code assumes direct access to source files. Special considerations, such as using a SAS/CONNECT server, are necessary if direct access is not possible or if catalogs are incompatible. Cross-Environment Data Access (CEDA) can be used for read-only access, but with restrictions. The use of the CVP engine may be required to avoid truncation when changing character encoding.
Explanation : This example illustrates copying a SAS library between different environments using the CPORT and CIMPORT procedures, a multi-step process. The first step (PROC CPORT) creates a transport file ('mytransfer') from the source library. The second step (not shown in the SAS code) involves transferring this binary file to the target environment (e.g., via FTP). The third step (PROC CIMPORT) then imports the contents of the transport file into the target library. It is important to note that PROC CPORT and CIMPORT have limitations compared to PROC MIGRATE, supporting only SAS datasets and catalogs, but not other member types. In case of transcoding to a new encoding, truncation may occur, requiring variable length expansion via the CVP engine or the EXTENDVAR= option of PROC CIMPORT. Transport files created by PROC CPORT are not interchangeable with those created by the XPORT engine.
Explanation : This example illustrates copying a SAS library between different environments using the CPORT and CIMPORT procedures, a multi-step process. The first step (PROC CPORT) creates a transport file ('mytransfer') from the source library. The second step (not shown in the SAS code) involves transferring this binary file to the target environment (e.g., via FTP). The third step (PROC CIMPORT) then imports the contents of the transport file into the target library. It is important to note that PROC CPORT and CIMPORT have limitations compared to PROC MIGRATE, supporting only SAS datasets and catalogs, but not other member types. In case of transcoding to a new encoding, truncation may occur, requiring variable length expansion via the CVP engine or the EXTENDVAR= option of PROC CIMPORT. Transport files created by PROC CPORT are not interchangeable with those created by the XPORT engine.
Copied!
libname source 'c:\example';
filename tranfile 'c:\myfiles\mytransfer';
proc cport library=source file=tranfile;
run;
/* Transfert du fichier mytransfer vers l'environnement cible (par exemple, via FTP en mode binaire) */
libname target '/mydata/example';
filename tranfile '/mydata/mytransfer';
proc cimport library=target infile=tranfile;
run;
1
LIBNAMESOURCE'c:\example';
2
filename tranfile 'c:\myfiles\mytransfer';
3
PROC CPORT library=SOURCE file=tranfile;
4
RUN;
5
6
/* Transfert du fichier mytransfer vers l'environnement cible (par exemple, via FTP en mode binaire) */
7
8
LIBNAME target '/mydata/example';
9
filename tranfile '/mydata/mytransfer';
10
PROC CIMPORT library=target INFILE=tranfile;
11
RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.