Syntax: CATALOG Procedure


Tip: Supports RUN- group processing.

Tip: Supports the Output Delivery System. See Output Delivery System on page 32 for details.

ODS Table Name : See: Results: CATALOG Procedure on page 168

Reminder: You can perform similar functions with the SAS Explorer window and with dictionary tables in the SQL procedure. For information on the Explorer window, see the online Help. For information on PROC SQL, see Chapter 45, The SQL Procedure, on page 1041.

See: CATALOG Procedure in the documentation for your operating environment.

PROC CATALOG CATALOG=< libref .> catalog <ENTRYTYPE= etype > <FORCE> <KILL>;

  • CONTENTS <OUT= SAS-data-set > <FILE= fileref >;

  • COPY OUT=< libref .> catalog < options >;

    • SELECT entry(s) </ ENTRYTYPE= etype >;

    • EXCLUDE entry(s) </ ENTRYTYPE= etype >;

  • CHANGE old-name-1 = new-name-1

    • < old-name-n = new-name-n >

    • </ ENTRYTYPE= etype >;

  • EXCHANGE name-1 = other-name-1

    • < name-n = other-name-n >

    • </ ENTRYTYPE= etype >;

  • DELETE entry(s) </ ENTRYTYPE= etype >;

  • MODIFY entry (DESCRIPTION=<< > entry-description < >>)</ ENTRYTYPE= etype >;

  • SAVE entry(s) </ ENTRYTYPE= etype >;

To do this

Use this statement

Copy entries from one SAS catalog to another

 
 

Copy or move all entries

COPY (with MOVE option)

 

Copy entries to a new catalog (overwriting the catalog if it already exists)

COPY (with NEW option)

 

Copy only selected entries

COPY, SELECT

 

Copy all except the entries specified

COPY, EXCLUDE

Delete entries from a SAS catalog

 
 

Delete all entries

PROC CATALOG (with KILL option)

 

Delete all entries in catalog opened by another resource environment

PROC CATALOG (with FORCE and KILL options)

 

Delete all except the entries specified

SAVE

Alter names and descriptions

 
 

Change the names of catalog entries

CHANGE

 

Switch the names of two catalog entries

EXCHANGE

 

Change the description of a catalog entry

MODIFY

Print

 
 

Print the contents of a catalog

CONTENTS

PROC CATALOG Statement

PROC CATALOG CATALOG=< libref .> catalog <ENTRYTYPE= etype > <FORCE> <KILL>;

To do this

Use this option

Restrict processing to one entry type

ENTRYTYPE=

Delete all catalog entries

KILL

Force certain statements to execute on a catalog opened by another resource environment

FORCE

Required Arguments

CATALOG=< libref .> catalog

  • specifies the SAS catalog to process.

  • Alias: CAT=, C=

  • Default: If ENTRYTYPE= is not specified, PROC CATALOG processes all entries in the catalog.

Options

ENTRYTYPE= etype

  • restricts processing of the current PROC CATALOG step to one entry type.

  • Alias: ET=

  • Default: If you omit ENTRYTYPE=, PROC CATALOG processes all entries in a catalog.

  • Interaction: The specified entry type applies to any one-level entry names used in a subordinate statement. You cannot override this specification in a subordinate statement.

  • Interaction: ENTRYTYPE= does not restrict the effects of the KILL option.

  • Tip: In order to process multiple entry types in a single PROC CATALOG step, use ENTRYTYPE= in a subordinate statement, not in the PROC CATALOG statement.

  • See also: Specifying an Entry Type on page 165.

  • Featured in: Example 1 on page 168 and Example 2 on page 172

FORCE

  • forces statements to execute on a catalog that is opened by another resource environment.

    Some CATALOG statements require exclusive access to the catalog that they operate on if the statement can radically change the contents of a catalog. If exclusive access cannot be obtained, then the action fails. The statements and the catalogs that are affected by FORCE are

    KILL

    affects the specified catalog

    COPY

    affects the OUT= catalog

    COPY MOVE

    affects the IN= and the OUT= catalogs

    SAVE

    affects the specified catalog.

  • Tip: Use FORCE to execute the statement, even if exclusive access cannot be obtained.

  • Featured in: Example 3 on page 174

KILL

  • deletes all entries in a SAS catalog.

  • Interaction: The KILL option deletes all catalog entries even when ENTRYTYPE= is specified.

  • Interaction: The SAVE statement has no effect because the KILL option deletes all entries in a SAS catalog before any other statements are processed .

  • Tip: KILL deletes all entries but does not remove an empty catalog from the SAS data library. You must use another method, such as PROC DATASETS or the DIR window to delete an empty SAS catalog.

  • Featured in: Example 3 on page 174

  • CAUTION:

    • Do not attempt to limit the effects of the KILL option. This option deletes all entries in a SAS catalog before any option or other statement takes effect.

CHANGE Statement

Renames one or more catalog entries.

Tip: You can change multiple names in a single CHANGE statement or use multiple CHANGE statements.

Featured in: Example 2 on page 172

CHANGE old-name-1 = new-name-1

  • < old-name-n = new-name-n >

  • </ ENTRYTYPE= etype >;

Required Arguments

old-name = new-name

  • specifies the current name of a catalog entry and the new name you want to assign to it. Specify any valid SAS name.

  • Restriction: You must designate the type of the entry, either with the name ( ename.etype ) or with the ENTRYTYPE= option.

Options

ENTRYTYPE= etype

  • restricts processing to one entry type.

  • See: The ENTRYTYPE= Option on page 166

  • See also: Specifying an Entry Type on page 165

CONTENTS Statement

Lists the contents of a catalog in the procedure output or writes a list of the contents to a SAS data set, an external file, or both.

Featured in: Example 2 on page 172

CONTENTS <OUT= SAS-data-set > <FILE= fileref >;

Without Options

The output is sent to the procedure output.

Options

Note: The ENTRYTYPE= (ET=) option is not available for the CONTENTS statement.

CATALOG=< libref .> catalog

  • specifies the SAS catalog to process.

  • Alias: CAT=, C=

  • Default: None

FILE= fileref

  • sends the contents to an external file, identified with a SAS fileref.

  • Interaction: If fileref has not been previously assigned to a file, then the file is created and named according to operating environment-dependent rules for external files.

OUT= SAS-data-set

  • sends the contents to a SAS data set. When the statement executes, a message on the SAS log reports that a data set has been created. The data set contains six variables in this order:

    LIBNAME

    the libref

    MEMNAME

    the catalog name

    NAME

    the names of entries

    TYPE

    the types of entries

    DESC

    the descriptions of entries

    DATE

    the dates entries were last modified.

COPY Statement

Copies some or all of the entries in one catalog to another catalog.

Restriction: A COPY statement s effect ends at a RUN statement or at the beginning of a statement other than the SELECT or EXCLUDE statement.

Tip: Use SELECT or EXCLUDE statements, but not both, after the COPY statement to limit which entries are copied .

Tip: You can copy entries from multiple catalogs in a single PROC step, not just the one specified in the PROC CATALOG statement.

Tip: The ENTRYTYPE= option does not require a forward slash (/) in this statement.

Featured in: Example 1 on page 168

COPY OUT=< libref .> catalog < options >;

To do this

Use this option

Restrict processing to one type of entry

ENTRYTYPE=

Copy from a different catalog in the same step

IN=

Move (copy and then delete) a catalog entry

MOVE

Copy entries to a new catalog (overwriting the catalog if it already exists)

NEW

Protect several types of SAS/AF entries from being edited with PROC BUILD

NOEDIT

Not copy source lines from a PROGRAM, FRAME, or SCL entry

NOSOURCE

Required Arguments

OUT=< libref. > catalog

  • names the catalog to which entries are copied.

Options

ENTRYTYPE= etype

  • restricts processing to one entry type for the current COPY statement and any subsequent SELECT or EXCLUDE statements.

  • See: The ENTRYTYPE= Option on page 166

  • See also: Specifying an Entry Type on page 165

IN=< libref .> catalog

  • specifies the catalog to copy.

  • Interaction: The IN= option overrides a CATALOG= argument that was specified in the PROC CATALOG statement.

  • Featured in: Example 1 on page 168

MOVE

  • deletes the original catalog or entries after the new copy is made.

  • Interaction: When MOVE removes all entries from a catalog, the procedure deletes the catalog from the library.

NEW

  • overwrites the destination (specified by OUT=) if it already exists. If you omit NEW, PROC CATALOG updates the destination. For information about using the NEW option with concatenated catalogs, see Catalog Concatenation on page 167.

NOEDIT

  • prevents the copied version of the following SAS/AF entry types from being edited by the BUILD procedure:

    CBT

    PROGRAM

    FRAME

    SCL

    HELP

    SYSTEM

    MENU

     
  • Restriction: If you specify the NOEDIT option for an entry that is not one of these types, it is ignored.

  • Tip: When creating SAS/AF applications for other users, use NOEDIT to protect the application by preventing certain catalog entries from being altered .

  • Featured in: Example 1 on page 168

NOSOURCE

  • omits copying the source lines when you copy a SAS/AF PROGRAM, FRAME, or SCL entry.

  • Alias: NOSRC

  • Restriction: If you specify this option for an entry other than a PROGRAM, FRAME, or SCL entry, it is ignored.

DELETE Statement

Deletes entries from a SAS catalog.

Tip: Use DELETE to delete only a few entries; use SAVE when it is more convenient to specify which entries not to delete.

Tip: You can specify multiple entries. You can also use multiple DELETE statements.

See also: SAVE Statement on page 163

Featured in: Example 1 on page 168

DELETE entry(s) </ ENTRYTYPE= etype >;

Required Arguments

entry(s)

  • specifies the name of one or more SAS catalog entries.

  • Restriction: You must designate the type of the entry, either with the name ( ename.etype ) or with the ENTRYTYPE= option.

Options

ENTRYTYPE= etype

  • restricts processing to one entry type.

  • See: The ENTRYTYPE= Option on page 166

  • See also: Specifying an Entry Type on page 165

EXCHANGE Statement

Switches the name of two catalog entries.

Restriction: The catalog entries must be of the same type.

EXCHANGE name-1 = other-name-1

  • < name-n = other-name-n >

  • </ ENTRYTYPE= etype >;

Required Arguments

name = other-name

  • specifies two catalog entry names that the procedure will switch.

  • Interaction: You can specify only the entry name without the entry type if you use the ENTRYTYPE= option on either the PROC CATALOG statement or the EXCHANGE statement.

  • See also: Specifying an Entry Type on page 165

Options

ENTRYTYPE= etype

  • restricts processing to one entry type.

  • See: The ENTRYTYPE= Option on page 166

  • See also: Specifying an Entry Type on page 165

EXCLUDE Statement

Specifies entries that the COPY statement does not copy.

Restriction: Requires the COPY statement.

Restriction: Do not use the EXCLUDE statement with the SELECT statement.

Tip: You can specify multiple entries in a single EXCLUDE statement.

Tip: You can use multiple EXCLUDE statements with a single COPY statement within a RUN group.

See also: COPY Statement on page 158 and SELECT Statement on page 163

Featured in: Example 1 on page 168

EXCLUDE entry(s) </ ENTRYTYPE= etype >;

Required Arguments

entry(s)

  • specifies the name of one or more SAS catalog entries.

  • Restriction: You must designate the type of the entry, either when you specify the name ( ename.etype ) or with the ENTRYTYPE= option.

  • See also: Specifying an Entry Type on page 165

Options

ENTRYTYPE= etype

  • restricts processing to one entry type.

  • See: The ENTRYTYPE= Option on page 166

  • See also: Specifying an Entry Type on page 165

MODIFY Statement

Changes the description of a catalog entry.

Featured in: Example 2 on page 172

MODIFY entry (DESCRIPTION=<< > entry-description < >>) </ ENTRYTYPE= etype >;

Required Arguments

entry

  • specifies the name of one SAS catalog entry. Optionally, you can specify the entry type with the name.

  • Restriction: You must designate the type of the entry, either when you specify the name ( ename.etype ) or with the ENTRYTYPE= option.

  • See also: Specifying an Entry Type on page 165

DESCRIPTION=<< > entry-description < >>

  • changes the description of a catalog entry by replacing it with a new description, up to 256 characters long, or by removing it altogether. Optionally, you can enclose the description in single or double quotes.

  • Alias: DESC

  • Tip: Use DESCRIPTION= with no text to remove the current description.

Options

ENTRYTYPE= etype

  • restricts processing to one entry type.

  • See: The ENTRYTYPE= Option on page 166

  • See also: Specifying an Entry Type on page 165

SAVE Statement

Specify entries not to delete from a SAS catalog.

Restriction: Cannot limit the effects of the KILL option.

Tip: Use SAVE to delete all but a few entries in a catalog. Use DELETE when it is more convenient to specify which entries to delete.

Tip: You can specify multiple entries and use multiple SAVE statements.

See also: DELETE Statement on page 160

SAVE entry(s) </ ENTRYTYPE= etype >;

Required Arguments

entry(s)

  • specifies the name of one or more SAS catalog entries.

  • Restriction: You must designate the type of the entry, either with the name ( ename.etype ) or with the ENTRYTYPE= option.

Options

ENTRYTYPE= etype

  • restricts processing to one entry type.

  • See: The ENTRYTYPE= Option on page 166

  • See also: Specifying an Entry Type on page 165

SELECT Statement

Specifies entries that the COPY statement will copy.

Restriction: Requires the COPY statement.

Restriction: Cannot be used with an EXCLUDE statement.

Tip: You can specify multiple entries in a single SELECT statement.

Tip: You can use multiple SELECT statements with a single COPY statement within a RUN group.

See also: COPY Statement on page 158 and EXCLUDE Statement on page 161

Featured in: Example 1 on page 168

SELECT entry(s) </ ENTRYTYPE= etype >;

Required Arguments

entry(s)

  • specifies the name of one or more SAS catalog entries.

  • Restriction: You must designate the type of the entry, either when you specify the name ( ename.etype ) or with the ENTRYTYPE= option.

Options

ENTRYTYPE= etype

  • restricts processing to one entry type.

  • See: The ENTRYTYPE= Option on page 166.

  • See also: Specifying an Entry Type on page 165.




Base SAS 9.1.3 Procedures Guide (Vol. 1)
Base SAS 9.1 Procedures Guide, Volumes 1, 2, 3 and 4
ISBN: 1590472047
EAN: 2147483647
Year: 2004
Pages: 260

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net