Published on :
Utility SASHELP

SAS Catalog Scan Utility

This code is also available in: Deutsch Español Français
Attention : This code requires administrator privileges.
The script defines a macro named `catscan` that takes two arguments: the SAS© catalog name (`cat`) and the output file path (`file`). Inside the macro, PROC BUILD is used to access the catalog. The `print source` option requests printing the catalog's source content to the file specified by `prtfile`. After PROC BUILD execution, a DM (Display Manager) command is used to display the created file via `fslist`. The macro is then called with the system catalog `sashelp.webeis` and the output file `webeis.txt`.
Data Analysis

Type : SASHELP


The script uses the system catalog 'sashelp.webeis' which is an internal SAS data source, provided by default with the SAS installation.

1 Code Block
MACRO DEFINITION
Explanation :
This block defines the `catscan` macro. It encapsulates the logic for accessing a SAS catalog (`proc build catalog=&cat`) and printing its source code (`print source prtfile="&file"`). The `batch` keyword is used for non-interactive execution. The command `dm 'fslist "&file"' fslist ;` is a Display Manager command that opens a window to display the content of the generated file, which is useful for immediate result verification.
Copied!
1%macro catscan(cat,file) ;
2 PROC BUILD catalog=&cat batch ;
3 PRINT SOURCE prtfile="&file" ;
4 RUN ;
5 dm 'fslist "&file"' fslist ;
6%mend catscan ;
2 Code Block
MACRO CALL
Explanation :
This call executes the `catscan` macro defined previously. It passes `sashelp.webeis` as the catalog name to analyze and `webeis.txt` as the name of the file where the catalog's source content will be printed. After execution, a `webeis.txt` file will be created and its content displayed in a Display Manager window.
Copied!
1%catscan(sashelp.webeis,webeis.txt)
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.