CATALOG Procedure

Example 2: Displaying Contents, Changing Names, and Changing a Description

Features:

PROC CATALOG statement

CHANGE statement options: (ENTRYTYPE=) or (ET=)

CONTENTS statement options: FILE=

Other statements:
MODIFY statement
RUN statement
QUIT statement

Details

This example demonstrates the following actions:
  • lists the entries in a catalog and routes the output to a file
  • changes entry names
  • changes entry descriptions
  • processes entries in multiple run groups

Program

libname perm 'C:\My Documents\proccatalogs';
proc catalog catalog=perm.finance;
   contents;
title1 'Contents of PERM.FINANCE before changes are made';
run;
   change dept=deptcode (et=formatc);
run;
   modify loan.frame (description='Loan analysis app. - ver1');
   contents;
title1 'Contents of PERM.FINANCE after changes are made';
run;
quit;

Program Description

Assign a library reference. The LIBNAME statement assigns a libref to the SAS library that contains a permanent SAS catalog.
libname perm 'C:\My Documents\proccatalogs';
List the entries in a catalog and route the output to a file. The CONTENTS statement creates a listing of the contents of the SAS catalog PERM.FINANCE and routes the output to a file.
proc catalog catalog=perm.finance;
   contents;
title1 'Contents of PERM.FINANCE before changes are made';
run;
Change entry names. The CHANGE statement changes the name of an entry that contains a user-written character format. (ET=) specifies the entry type.
   change dept=deptcode (et=formatc);
run;
Process entries in multiple run groups. The MODIFY statement changes the description of an entry. The CONTENTS statement creates a listing of the contents of PERM.FINANCE after all the changes have been applied. QUIT ends the procedure.
   modify loan.frame (description='Loan analysis app. - ver1');
   contents;
title1 'Contents of PERM.FINANCE after changes are made';
run;
quit;

Output

Contents of PERM.FINANCE