Procedure features:
PROC CIMPORT statement option:
INFILE=
This example shows how to use PROC CIMPORT to read from disk a transport file, named TRANFILE, that PROC CPORT created from a SAS data library in another operating environment. The transport file was moved to the new operating environment by means of communications software or magnetic medium. PROC CIMPORT imports the transport file to a SAS data library, called NEWLIB, in the new operating environment.
Specify the library name and filename. The LIBNAME statement specifies a libname for the new SAS data library. The FILENAME statement specifies the filename of the transport file that PROC CPORT created and enables you to specify any operating environment options for file characteristics.
libname newlib SAS-data-library '; filename tranfile ' transport-file ' host-option(s)-for-file-characteristics ;
Import the SAS data library in the NEWLIB library. PROC CIMPORT imports the SAS data library into the library named NEWLIB.
proc cimport library=newlib infile=tranfile; run;
NOTE: Proc CIMPORT begins to create/update catalog NEWLIB.FINANCE NOTE: Entry LOAN.FRAME has been imported. NOTE: Entry LOAN.HELP has been imported. NOTE: Entry LOAN.KEYS has been imported. NOTE: Entry LOAN.PMENU has been imported. NOTE: Entry LOAN.SCL has been imported. NOTE: Total number of entries processed in catalog NEWLIB.FINANCE: 5 NOTE: Proc CIMPORT begins to create/update catalog NEWLIB.FORMATS NOTE: Entry REVENUE.FORMAT has been imported. NOTE: Entry DEPT.FORMATC has been imported. NOTE: Total number of entries processed in catalog NEWLIB.FORMATS: 2
Procedure features:
PROC CIMPORT statement options:
INFILE=
SELECT statement
This example shows how to use PROC CIMPORT to import the individual catalog entries LOAN.PMENU and LOAN.SCL from the transport file TRANS2, which was created from a single SAS catalog.
Specify the library name, filename, and operating environment options. The LIBNAME statement specifies a libname for the new SAS data library. The FILENAME statement specifies the filename of the transport file that PROC CPORT created and enables you to specify any operating environment options for file characteristics.
libname newlib ' SAS-data-library '; filename trans2 ' transport-file ' host-option(s)-for-file-characteristics ;
Import the specified catalog entries to the new SAS catalog. PROC CIMPORT imports the individual catalog entries from the TRANS2 transport file and stores them in a new SAS catalog called NEWLIB.FINANCE. The SELECT statement selects only the two specified entries from the transport file to be imported into the new catalog.
proc cimport catalog=newlib.finance infile=trans2; select loan.pmenu loan.scl; run;
NOTE: Proc CIMPORT begins to create/update catalog NEWLIB.FINANCE NOTE: Entry LOAN.PMENU has been imported. NOTE: Entry LOAN.SCL has been imported. NOTE: Total number of entries processed in catalog NEWLIB.FINANCE: 2
Procedure features:
PROC CIMPORT statement option:
INFILE=
This example shows how to use PROC CIMPORT to import an indexed SAS data set from a transport file that was created by PROC CPORT from a single SAS data set.
Specify the library name, filename, and operating environment options. The LIBNAME statement specifies a libname for the new SAS data library. The FILENAME statement specifies the filename of the transport file that PROC CPORT created and enables you to specify any operating environment options for file characteristics.
libname newdata ' SAS-data-library '; filename trans3 ' transport-file ' host-option(s)-for-file-characteristics ;
Import the SAS data set. PROC CIMPORT imports the single SAS data set that you identify with the DATA= specification in the PROC CIMPORT statement. PROC CPORT exported the data set NEWDATA.TIMES in the transport file TRANS3.
proc cimport data=newdata.times infile=trans3; run;
NOTE: Proc CIMPORT begins to create/update data set NEWDATA.TIMES NOTE: The data set index x is defined. NOTE: Data set contains 2 variables and 2 observations. Logical record length is 16