Chapter Contents

Previous

Next
The CATALOG Procedure

Example 1: Copying, Deleting, and Moving Catalog Entries from Multiple Catalogs


Procedure features:
PROC CATALOG statement:
CATALOG= argument
COPY statement options:
IN=
MOVE
NOEDIT
DELETE statement options:
ENTRYTYPE= or ET=
EXCLUDE statement options:
ENTRYTYPE= or ET=
(ENTRYTYPE=) or (ET=)
QUIT statement
RUN statement
SELECT statement options:
ENTRYTYPE= or ET=

This example


Input Catalogs
The SAS catalog PERM.SAMPLE contains the following entries:

DEFAULT  FORM     Default form for printing  06/16/96
FSLETTER FORM     Standard form for letters  06/16/96
LOAN     FRAME    Loan analysis application  06/16/96
LOAN     HELP     Information about the app. 06/16/96
BUILD    KEYS     Function Key Definitions   06/16/96
LOAN     KEYS     Custom key def. for app.   06/16/96
CREDIT   LOG      credit application log     06/16/96
TEST1    LOG      Inventory program          06/16/96
TEST2    LOG      Inventory program          06/16/96
TEST3    LOG      Inventory program          06/16/96
LOAN     PMENU    Custom menu def. for app.  06/16/96
CREDIT   PROGRAM  credit application pgm     06/16/96
TEST1    PROGRAM  testing budget applic.     06/16/96
TEST2    PROGRAM  testing budget applic.     06/16/96
TEST3    PROGRAM  testing budget applic.     06/16/96
LOAN     SCL      loan analysis SCL code     06/16/96
PASSIST  SLIST    User profile               06/16/96
PRTINFO  XPRINTER Printing Parameters        06/16/96
The SAS catalog PERM.FORMATS contains the following entries:
REVENUE   FORMAT    FORMAT:MAXLEN=16,16,12   06/16/96
DEPT      FORMATC   FORMAT:MAXLEN=1,1,14     06/21/96


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=60 source;
 Note about code
libname perm 'SAS-data-library';

 Note about code
proc catalog cat=perm.sample;
   delete credit.program credit.log;
run;
 Note about code
   copy out=tcatall;
run;
 Note about code
   copy out=testcat;
      exclude test1 test2 test3  passist (et=slist) / et=log;
run;




 Note about code
   copy out=logcat move;
      select test1 test2 test3 / et=log;
run;



 Note about code
   copy out=perm.finance noedit;
      select loan.frame loan.help loan.keys loan.pmenu;
run;


 Note about code
   copy in=perm.formats out=perm.finance;
      select revenue.format dept.formatc;
quit;


Log

         
1    libname perm 'SAS-data-library'; 
NOTE: Directory for library PERM contains files of mixed engine types.
NOTE: Libref PERM was successfully assigned as follows: 
      Engine:        V7 
      Physical Name: 'SAS-data-library'      
2    options nodate pageno=1 linesize=80 pagesize=60 source;
3   proc catalog cat=perm.sample;
4      delete credit.program credit.log;
5   run;
NOTE: Deleting entry CREDIT.PROGRAM in catalog PERM.SAMPLE.
NOTE: Deleting entry CREDIT.LOG in catalog PERM.SAMPLE.
6      copy out=tcatall;
7   run;
NOTE: Copying entry DEFAULT.FORM from catalog PERM.SAMPLE to catalog 
      WORK.TCATALL.
NOTE: Copying entry FSLETTER.FORM from catalog PERM.SAMPLE to catalog 
      WORK.TCATALL.
NOTE: Copying entry LOAN.FRAME from catalog PERM.SAMPLE to catalog WORK.TCATALL.
NOTE: Copying entry LOAN.HELP from catalog PERM.SAMPLE to catalog WORK.TCATALL.
NOTE: Copying entry BUILD.KEYS from catalog PERM.SAMPLE to catalog WORK.TCATALL.
NOTE: Copying entry LOAN.KEYS from catalog PERM.SAMPLE to catalog WORK.TCATALL.
NOTE: Copying entry TEST1.LOG from catalog PERM.SAMPLE to catalog WORK.TCATALL.
NOTE: Copying entry TEST2.LOG from catalog PERM.SAMPLE to catalog WORK.TCATALL.
NOTE: Copying entry TEST3.LOG from catalog PERM.SAMPLE to catalog WORK.TCATALL.
NOTE: Copying entry LOAN.PMENU from catalog PERM.SAMPLE to catalog WORK.TCATALL.
NOTE: Copying entry TEST1.PROGRAM from catalog PERM.SAMPLE to catalog 
      WORK.TCATALL.
NOTE: Copying entry TEST2.PROGRAM from catalog PERM.SAMPLE to catalog 
      WORK.TCATALL.
NOTE: Copying entry TEST3.PROGRAM from catalog PERM.SAMPLE to catalog 
      WORK.TCATALL.
NOTE: Copying entry LOAN.SCL from catalog PERM.SAMPLE to catalog WORK.TCATALL.
NOTE: Copying entry PASSIST.SLIST from catalog PERM.SAMPLE to catalog 
      WORK.TCATALL.
NOTE: Copying entry PRTINFO.XPRINTER from catalog PERM.SAMPLE to catalog 
      WORK.TCATALL.
8      copy out=testcat;
9         exclude test1 test2 test3  passist (et=slist) / et=log;
10   run;
NOTE: Copying entry DEFAULT.FORM from catalog PERM.SAMPLE to catalog 
      WORK.TESTCAT.
NOTE: Copying entry FSLETTER.FORM from catalog PERM.SAMPLE to catalog 
      WORK.TESTCAT.
NOTE: Copying entry LOAN.FRAME from catalog PERM.SAMPLE to catalog WORK.TESTCAT.
NOTE: Copying entry LOAN.HELP from catalog PERM.SAMPLE to catalog WORK.TESTCAT.
NOTE: Copying entry BUILD.KEYS from catalog PERM.SAMPLE to catalog WORK.TESTCAT.
NOTE: Copying entry LOAN.KEYS from catalog PERM.SAMPLE to catalog WORK.TESTCAT.
NOTE: Copying entry LOAN.PMENU from catalog PERM.SAMPLE to catalog WORK.TESTCAT.
NOTE: Copying entry TEST1.PROGRAM from catalog PERM.SAMPLE to catalog 
      WORK.TESTCAT.
NOTE: Copying entry TEST2.PROGRAM from catalog PERM.SAMPLE to catalog 
      WORK.TESTCAT.
NOTE: Copying entry TEST3.PROGRAM from catalog PERM.SAMPLE to catalog 
      WORK.TESTCAT.
NOTE: Copying entry LOAN.SCL from catalog PERM.SAMPLE to catalog WORK.TESTCAT.
NOTE: Copying entry PRTINFO.XPRINTER from catalog PERM.SAMPLE to catalog 
      WORK.TESTCAT.
11      copy out=logcat move;
12         select test1 test2 test3 / et=log;
13   run;
NOTE: Moving entry TEST1.LOG from catalog PERM.SAMPLE to catalog WORK.LOGCAT.
NOTE: Moving entry TEST2.LOG from catalog PERM.SAMPLE to catalog WORK.LOGCAT.
NOTE: Moving entry TEST3.LOG from catalog PERM.SAMPLE to catalog WORK.LOGCAT.
14      copy out=perm.finance noedit;
15         select loan.frame loan.help loan.keys loan.pmenu;
16   run;
NOTE: Copying entry LOAN.FRAME from catalog PERM.SAMPLE to catalog PERM.FINANCE.
NOTE: Copying entry LOAN.HELP from catalog PERM.SAMPLE to catalog PERM.FINANCE.
NOTE: Copying entry LOAN.KEYS from catalog PERM.SAMPLE to catalog PERM.FINANCE.
NOTE: Copying entry LOAN.PMENU from catalog PERM.SAMPLE to catalog PERM.FINANCE.
17      copy in=perm.formats out=perm.finance;
18         select revenue.format dept.formatc;
19   quit;
NOTE: Copying entry REVENUE.FORMAT from catalog PERM.FORMATS to catalog 
      PERM.FINANCE.
NOTE: Copying entry DEPT.FORMATC from catalog PERM.FORMATS to catalog 
      PERM.FINANCE.


Chapter Contents

Previous

Next

Top of Page

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