CPORT Procedure

PROC CPORT Statement

Creates a transport file.
Exporting Multiple Catalogs

Exporting Individual Catalog Entries

Exporting a Single SAS Data Set

Applying a Translation Table

Exporting Entries Based on Modification Date

Syntax

Summary of Optional Arguments

exports SAS/AF PROGRAM and SCL entries without Edit capability when you import them.
specifies that exported catalog entries contain compiled SCL code, but not the source code.
specifies a libref associated with a SAS library.
Control the contents of the transport file
suppresses the conversion of displayed character data to transport format.
controls the exportation of integrity constraints.
copies the created and modified date and time to the transport file.
controls the exportation of indexes with indexed SAS data sets.
specifies the type of DBCS data stored in the SAS files to be exported.
suppresses the compression of binary zeros and blanks in the transport file.
writes all alphabetic characters to the transport file in uppercase.
translates specified characters from one ASCII or EBCDIC value to another.
Identify the transport file
specifies the transport file to write to.
directs the output from PROC CPORT to a tape.
Select files to export
exports copies of all data sets or catalog entries that have a modification date equal to or later than the date that you specify.
excludes specified entry types from the transport file.
includes specified entry types in the transport file.
specifies whether to export all generations of a data set.
specifies that only data sets, only catalogs, or both, be moved when a library is exported.

Required Argument

source-type=libref | < libref.>member-name
identifies the type of file to export and specifies the catalog, SAS data set, or SAS library to export.
Tip
Refer to Names in the SAS Language in SAS Language Reference: Concepts for naming conventions that you can use for names and member names.
source-type
identifies one or more files to export as a single catalog, as a single SAS data set, or as the members of a SAS library. The source-type argument can be one of the following:
CATALOG | CAT | C
DATA | DS | D
LIBRARY | LIB | L
Note:If you specify a password-protected data set as the source type, you must also include the password when creating its transport file. For details, see READ= Data Set Option in the PROC CPORT Statement .
libref | <libref.>member-name
specifies the specific catalog, SAS data set, or SAS library to export. If source-type is CATALOG or DATA, you can specify both a libref and a member name. If the libref is omitted, PROC CPORT uses the default library as the libref, which is usually the WORK library. If the source-type argument is LIBRARY, specify only a libref. If you specify a library, PROC CPORT exports only data sets and catalogs from that library. You cannot export other types of files.

Optional Arguments

AFTER=date
exports copies of all data sets or catalog entries that have a modification date later than or equal to the date that you specify. The modification date is the most recent date when the contents of the data set or catalog entry changed. Specify date as a SAS date literal or as a numeric SAS date value.
Tip:You can determine the modification date of a catalog entry by using the CATALOG procedure.
ASIS
suppresses the conversion of displayed character data to transport format. Use this option when you move files that contain DBCS (double-byte character set) data from one operating environment to another if both operating environments use the same type of DBCS data.
Interactions:The ASIS option invokes the NOCOMPRESS option.

You cannot use both the ASIS option and the OUTTYPE= options in the same PROC CPORT step.

CONSTRAINT=YES | NO
controls the exportation of integrity constraints that have been defined on a data set. When you specify CONSTRAINT=YES, all types of integrity constraints are exported for a library; only general integrity constraints are exported for a single data set. When you specify CONSTRAINT=NO, indexes created without integrity constraints are ported, but neither integrity constraints nor any indexes created with integrity constraints are ported. For more information about integrity constraints, see the section on SAS files in SAS Language Reference: Concepts.
Alias:CON=
Default:YES
Interactions:You cannot specify both CONSTRAINT= and INDEX= in the same PROC CPORT step.

If you specify INDEX=NO, no integrity constraints are exported.

DATECOPY
copies the SAS internal date and time when the SAS file was created and the date and time when it was last modified to the resulting transport file. Note that the operating environment date and time are not preserved.
Restriction:DATECOPY can be used only when the destination file uses the V8 or V9 engine.
Tip:You can alter the file creation date and time with the DTC= option in the MODIFY statement in a PROC DATASETS step. For details, see MODIFY Statement.
EET=(etype(s))
excludes specified entry types from the transport file. If etype is a single entry type, then you can omit the parentheses. Separate multiple values with a space.
Interaction:You cannot use both the EET= option and the ET= option in the same PROC CPORT step.
ET=(etype(s))
includes specified entry types in the transport file. If etype is a single entry type, then you can omit the parentheses. Separate multiple values with a space.
Interaction:You cannot use both the EET= option and the ET= option in the same PROC CPORT step.
FILE=fileref | 'filename'
specifies a previously defined fileref or the filename of the transport file to write to. If you omit the FILE= option, then PROC CPORT writes to the fileref SASCAT, if defined. If the fileref SASCAT is not defined, PROC CPORT writes to SASCAT.DAT in the current directory.
Note:The behavior of PROC CPORT when SASCAT is undefined varies from one operating environment to another. For details, see the SAS documentation for your operating environment.
Example:All examples.
GENERATION=YES | NO
specifies whether to export all generations of a SAS data set. To export only the base generation of a data set, specify GENERATION=NO in the PROC CPORT statement. To export a specific generation number, use the GENNUM= data set option when you specify a data set in the PROC CPORT statement. For more information about generation data sets, see SAS Language Reference: Concepts.
Alias:GEN=
Default:YES for libraries; NO for single data sets
Note:PROC CIMPORT imports all generations of a data set that are present in the transport file. It deletes any previous generation set with the same name and replaces it with the imported generation set, even if the number of generations does not match.
INDEX=YES | NO
specifies whether to export indexes with indexed SAS data sets.
Default:YES
Interactions:You cannot specify both INDEX= and CONSTRAINT= in the same PROC CPORT step.

If you specify INDEX=NO, no integrity constraints are exported.

INTYPE=DBCS-type
specifies the type of DBCS data stored in the SAS files to be exported. Double-byte character set (DBCS) data uses up to two bytes for each character in the set. DBCS-type must be one of the following values:
IBM | HITAC | FACOM for z/OS
IBM for VSE
DEC | SJIS for OpenVMS
PCIBM | SJIS for OS/2
Default:If the INTYPE= option is not used, the DBCS type defaults to the value of the SAS system option DBCSTYPE=.
Restriction:The INTYPE= option is allowed only if SAS is built with Double-Byte Character Set (DBCS) extensions. Because these extensions require significant computing resources, there is a special distribution for those sites that require it. An error is reported if this option is used at a site for which DBCS extensions are not enabled.
Interactions:Use the INTYPE= option in conjunction with the OUTTYPE= option to change from one type of DBCS data to another.

The INTYPE= option invokes the NOCOMPRESS option.

You cannot use the INTYPE= option and the ASIS option in the same PROC CPORT step.

Tip:You can set the value of the SAS system option DBCSTYPE= in your configuration file.
MEMTYPE=mtype
restricts the type of SAS file that PROC CPORT writes to the transport file. MEMTYPE= restricts processing to one member type. Values for mtype can be
ALL
both catalogs and data sets
CATALOG | CAT
catalogs
DATA | DS
SAS data sets
Alias:MT=
Default:ALL
NOCOMPRESS
suppresses the compression of binary zeros and blanks in the transport file.
Alias:NOCOMP
Default:By default, PROC CPORT compresses binary zeros and blanks to conserve space.
Interaction:The ASIS, INTYPE=, and OUTTYPE= options invoke the NOCOMPRESS option.
Note:Compression of the transport file does not alter the flag in each catalog and data set that indicates whether the original file was compressed.
NOEDIT
exports SAS/AF PROGRAM and SCL entries without Edit capability when you import them.
The NOEDIT option produces the same results as when you create a new catalog to contain SCL code by using the MERGE statement with the NOEDIT option in the BUILD procedure of SAS/AF software.
Alias:NEDIT
Note:The NOEDIT option affects only SAS/AF PROGRAM and SCL entries. It does not affect FSEDIT SCREEN or FSVIEW FORMULA entries.
NOSRC
specifies that exported catalog entries contain compiled SCL code but not the source code.
The NOSRC option produces the same results as when you create a new catalog to contain SCL code by using the MERGE statement with the NOSOURCE option in the BUILD procedure of SAS/AF software.
Alias:NSRC
OUTLIB=libref
specifies a libref associated with a SAS library. If you specify the OUTLIB= option, PROC CIMPORT is invoked automatically to re-create the input library, data set, or catalog in the specified library.
Alias:OUT=
Tip:Use the OUTLIB= option when you change SAS files from one DBCS type to another within the same operating environment if you want to keep the original data intact.
OUTTYPE=UPCASE
writes all displayed characters to the transport file and to the OUTLIB= file in uppercase.
Interaction:The OUTTYPE= option invokes the NOCOMPRESS option.
TAPE
directs the output from PROC CPORT to a tape.
Default:The output from PROC CPORT is sent to disk.
TRANSLATE=(translation-list)
translates specified characters from one ASCII or EBCDIC value to another. Each element of translation-list has the following form:
  • ASCII-value-1 TO ASCII-value-2
  • EBCDIC-value-1 TO EBCDIC-value-2
You can use hexadecimal or decimal representation for ASCII values. If you use the hexadecimal representation, values must begin with a digit and end with an x. Use a leading zero if the hexadecimal value begins with an alphabetic character.
For example, to translate all left brackets to left braces, specify the TRANSLATE= option as follows (for ASCII characters):
translate=(5bx to 7bx)
The following example translates all left brackets to left braces and all right brackets to right braces:
translate=(5bx to 7bx 5dx to 7dx)