Published on :

Reading source code from a SASHELP catalog

This code is also available in: Deutsch Español Français
This code defines a fileref pointing to a specific catalog entry in the SASHELP library (sashelp.assist.houses.source). It then uses a DATA _NULL_ step to read this content line by line and write it to the SAS© log, allowing visualization of the source code or data stored in this catalog.
Data Analysis

Type : SASHELP


Data is read from the 'sashelp.assist' catalog.

1 Code Block
FILENAME
Explanation :
Declaration of a fileref named 'test' referring to the 'houses.source' entry of the 'sashelp.assist' catalog. The 'catalog' engine is specified to access this type of internal SAS storage.
Copied!
1filename test catalog 'sashelp.assist.houses.
2source' ;
3 
2 Code Block
DATA STEP
Explanation :
DATA step without an output table (_null_). It reads the file referenced by 'test' and writes each read line directly to the log using the 'put _infile_' statement.
Copied!
1DATA _null_ ;
2 INFILE test ;
3 INPUT ;
4 put _infile_ ;
5RUN ;
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.