Using SAS Catalog and Printto to Document SAS Projects

From sasCommunity

Jump to: navigation, search

Contents

Author

Patrick Thornton Bio at SRI Internation

Reference

From: Thornton, S. P. (2006) ‘Using SAS Catalog and Printto to Document SAS Projects’ Paper in the Proceedings of the 14th Annual Western Users of SAS® Software Conference, Irvine, California

Abstract

SAS CATALOG and PRINTTO procedures provide a convenient way to document SAS projects. Using SAS 9.1 on a Windows XP operating system, this paper demonstrates the use of PRINTTO to save and document SAS syntax, OUTPUT, and LOG as entries to a SAS catalog. Examples for the beginning SAS user show how a description of up to 256 characters may be associated with each entry, how entries may be viewed through the SAS Explorer window, and how all catalog metadata may be displayed. Macro programs are also included that may be used with existing programs to save a version of the OUTPUT, LOG and syntax to a catalog.

Introduction

A typical SAS syntax file generates results to an OUTPUT window and a record of the process to a LOG window. It is often critical to be able to locate in the future these 3 elements of a project, the OUTPUT, the LOG and the original syntax, in order to validate, change, and/or re-run the results. You could save OUTPUT as a LIS file and LOG as a LOG file on your operating system, and then be careful not to change the .SAS file containing your original syntax. Another option is to save the project to a SAS catalog, thereby bundling the 3 elements into a single container and having a version of the project that is essentially archived. Each project element is saved as an entry to a catalog (e.g. OUTPUT entry) and SAS maintains metadata, including a 256 character description that you may assign to each entry. SAS also allows you to view the metadata through the SAS Explore frame and obtain the data using Proc CATALOG. The following sections give you an overview of the syntax for saving a project to a catalog, and present macro programs for systematically saving project elements using version numbers.

References

Chapman, D. D. (2004). 'Using SAS catalogs to develop and manage SAS data step program.' SAS Conference proceedings: SUGI 29, Montreal, Canada.

Download Paper

Media: WUSS2006_COD_Thornton_2.pdf

Personal tools