Chapter Contents |
Previous |
Next |
The CATALOG Procedure |
Interactive Processing with RUN Groups |
A set of procedure statements ending with a RUN statement is called
a RUN group. The changes specified in a given group of statements
take effect when a RUN statement is encountered.
Note: When you enter a QUIT, DATA, or PROC
statement,
any statements following the last RUN group execute before the CATALOG procedure
terminates. If you enter a RUN statement with the CANCEL option, however,
the remaining statements do not execute before the procedure
ends.
See Displaying Contents, Changing Names, and Changing a Description .
For example, the following statements contain a misspelled DELETE statement:
proc catalog catalog=misc entrytype=help; copy out=drink; select coffee tea; del juices; /* INCORRECT!!! */ exchange glass=plastic; run; change calstats=nutri; run;
Because the DELETE statement is incorrectly specified as DEL, no statements in that RUN group execute, except the PROC CATALOG statement itself. The CHANGE statement does execute, however, because it is in a different RUN group.
Specifying an Entry Type |
You can supply an entry type with... | Example | |
---|---|---|
the entry name |
delete test1.program test1.log test2.log; |
|
ET= in parenthesis |
delete test1 (et=program); |
|
ET= after a slash (table note 1) |
delete test1 (et=program) test1 test2 / et=log; |
|
ENTRYTYPE= without a slash (table note 2) |
proc catalog catalog=mycat et=log; delete test1 test2; |
TABLE NOTE 1: in a subordinate statement
TABLE NOTE 2: in the PROC CATALOG or the COPY
statement
All statements, except the CONTENTS statement, accept the ENTRYTYPE=
(alias ET=) option.
To create a default for entry type for all statements in the current step, use ENTRYTYPE= in the PROC CATALOG statement. To set the default for only the current statement, use ENTRYTYPE= in a subordinate statement.
If many entries are of one type, but a few are of other types, you can
use ENTRYTYPE= to specify a default and then override that for individual
entries with (ENTRYTYPE=) in parenthesis after those entries.
/* THIS IS INCORRECT CODE. */ proc catalog cat=sample et=help; delete a b c / et=program; run;
Alias: | ET= |
Default: | If you omit ENTRYTYPE=, PROC CATALOG processes all entries in the catalog. |
Interaction: | If you specify ENTRYTYPE= in the PROC CATALOG statement, do not specify either ENTRYTYPE= or (ENTRYTYPE=) in a subordinate statement. |
Interaction: | (ENTRYTYPE=etype) in parenthesis immediately following an entry name overrides ENTRYTYPE= in that same statement. |
Tip: | On all statements except the PROC CATALOG and COPY statements, this option follows a slash. |
Tip: | 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 . |
Featured in: | Copying, Deleting, and Moving Catalog Entries from Multiple Catalogs |
Alias: | (ET=) |
Restriction: | (ENTRYTYPE=etype) immediately following an entry name in a subordinate statement cannot override an ENTRYTYPE= option in the PROC CATALOG statement. It generates a syntax error. |
Interaction: | (ENTRYTYPE=etype) immediately following an entry name overrides ENTRYTYPE= in that same statement. |
Tip: | This form is useful mainly for specifying
exceptions to an ENTRYTYPE= option used in a subordinate statement. The following
statement deletes A.HELP, B.FORMAT, and C.HELP:
delete a b (et=format) c / et=help; |
Tip: | For the CHANGE and EXCHANGE statements,
specify (ENTRYTYPE=) in parenthesis only once for each pair of
names following the second name in the pair. For example,
change old1=new1 (et=log) old1=new2 (et=help); |
See also: | Specifying an Entry Type |
Featured in: | Copying, Deleting, and Moving Catalog Entries from Multiple Catalogs and Displaying Contents, Changing Names, and Changing a Description |
Catalog Concatenation |
For example, the following code demonstrates these two rules, and the copy fails:
libname first 'path-name1'; libname second 'path-name2'; /* create contat.x */ libname concat (first second); /* fails rule #1 */ proc catalog c=concat.x; copy out=first.x new; run; quit; /* fails rule #2 */ proc catalog c=first.x; copy out=concat.x new; run; quit;
In summary, the following table shows when copies are allowed. In the table, A and B are libraries, and each contains catalog X. Catalog C is an implicit concatenation of A and B, and catalog D is an implicit concatenation of B and A.
Input catalog | Output catalog | Copy allowed? |
C.X | B.X | No |
C.X | D.X | No |
D.X | C.X | No |
A.X | A.X | No |
A.X | B.X | Yes |
B.X | A.X | Yes |
C.X | A.X | No |
B.X | C.X | Yes |
A.X | C.X | No |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.