Chapter Contents

Previous

Next
The CPORT Procedure

PROC CPORT Statement


PROC CPORT source-type=libref | <libref.>member-name<option(s)>;

To do this Use this option
Identify the transport file

Specify the transport file to write to FILE=

Direct the output from PROC CPORT to a tape TAPE
Select files to export

Export copies of all data sets or catalog entries that have a modification date equal to or later than the date you specify AFTER=

Exclude specified entry types from the transport file EET=

Include specified entry types in the transport file ET=

Specify whether to export all generations of a data set GENERATION=

Specify that only data sets, only catalogs, or both, be moved when a library is exported MEMTYPE=
Control the contents of the transport file

Suppress the conversion of displayed character data to transport format ASIS

Control the exportation of integrity constraints CONSTRAINT

Control the exportation of indexes with indexed SAS data sets INDEX

Suppress the compression of binary zeros and blanks in the transport file NOCOMPRESS

Write all alphabetic characters to the transport file in uppercase OUTTYPE=UPCASE

Translate specified characters from one ASCII or EBCDIC value to another TRANSLATE
Export SAS/AF PROGRAM and SCL entries without edit capability when you import them NOEDIT
Specify that exported catalog entries contain compiled SCL code, but not the source code NOSRC
Specify a libref associated with a SAS data library OUTLIB=


Required Arguments

source-type=libref | < libref.>member-name
identifies the type of file to export and specifies the catalog, SAS data set, or SAS data library to export.

source-type
identifies the file or files to export as a single catalog, as a single SAS data set, or as the members of a SAS data library. The source-type argument can be one of the following:
CATALOG | CAT | C
DATA | DS | D
LIBRARY | LIB | L

libref | <libref.>member-name
specifies the specific catalog, SAS data set, or SAS data library to export. If the source-type argument 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.


Options

AFTER=date
exports copies of all data sets or catalog entries that have a modification date later than or equal to the date 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 find out the modification date of a catalog entry by using the CATALOG procedure.
Featured in: Exporting Entries Based on Modification Date .

ASIS
suppresses the conversion of displayed character data to transport format.
Interaction: The ASIS option invokes the NOCOMPRESS option.
Interaction: 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 CONTRAINT=NO, indexes created without integrity constraints are ported, but neither integrity constraints nor any indexes created with integrity constraints are ported. For more information on integrity constraints, see the section on SAS files in SAS Language Reference: Concepts.
Alias: CON=
Default: YES
Interaction: You cannot specify both CONSTRAINT= and INDEX= in the same PROC CPORT step.
Interaction: If you specify INDEX=NO, no integrity constraints are exported.

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 environnment.  [cautionend]
Featured in: 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 on generation data sets, see SAS Language Reference: Concepts.

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.  [cautionend]
Alias: GEN=
Default: YES for libraries; NO for single data sets

INDEX=YES | NO
specifies whether to export indexes with indexed SAS data sets.
Default: YES
Interaction: You cannot specify both INDEX= and CONSTRAINT= in the same PROC CPORT step.
Interaction: If you specify INDEX=NO, no integrity constraints are exported.

MEMTYPE=mtype
specifies that only data sets, only catalogs, or both, be moved when a library is exported. Values for mtype can be

ALL
both catalogs and data sets

CATALOG | CAT
catalogs

DATA | DS
SAS data sets

Alias: MT=
Default: ALL
Featured in: Exporting Multiple Catalogs .

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 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.  [cautionend]

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.

Note:   The NOEDIT option affects only SAS/AF PROGRAM and SCL entries. It does not affect FSEDIT SCREEN or FSVIEW FORMULA entries.  [cautionend]
Alias: NEDIT

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 data library. If you specify the OUTLIB= option, PROC CIMPORT is invoked automatically to re-create the input data library, data set, or catalog in the specified library.
Alias: OUT=

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 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)


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.