CPORT Procedure

Example 5: Exporting Entries Based on Modification Date

Features:
PROC CPORT statement options::
AFTER=
FILE=

Details

This example shows how to use PROC CPORT to transport only the catalog entries with modification dates equal to or later than the date that you specify in the AFTER= option.

Program

libname source 'SAS-data-library';
filename tranfile 'transport-file'
                  
host-option(s)-for-file-characteristics;
proc cport catalog=source.finance file=tranfile
           after='09sep1996'd;
run;

Program Description

Assign library references. The LIBNAME and FILENAME statements assign a libref for the source library and a fileref for the transport file, respectively.
libname source 'SAS-data-library';
filename tranfile 'transport-file'
                  
host-option(s)-for-file-characteristics;
Specify the catalog entries to be written to the transport file. AFTER= specifies that only catalog entries with modification dates on or after September 9, 1996, should be written to the transport file.
proc cport catalog=source.finance file=tranfile
           after='09sep1996'd;
run;

SAS Log

PROC CPORT writes messages to the SAS log to inform you that it began the export process for all the entries in the specified catalog. However, PROC CPORT wrote only the entries LOAN.FRAME and LOAN.HELP in the FINANCE catalog to the transport file because only those two entries had a modification date equal to or later than September 9, 1996. That is, of all the entries in the specified catalog, only two met the requirement of the AFTER= option.

NOTE: Proc CPORT begins to transport catalog SOURCE.FINANCE
NOTE: The catalog has 5 entries and its maximum logical record length is 866.
NOTE: Entry LOAN.FRAME has been transported.
NOTE: Entry LOAN.HELP has been transported.