Hello,
we need to identify the dependencies among 50 different catalogs in a SAS 9.4 environment (without SAS Studio, but with SAS Explorer).
For example, we would like to find all source code (scl, frame, screen, mainly) in our catalogs universe containing the path to the catalog named "gesco" ("/env/app/gesco").
It seems that the find function doesn't allow us to use this search criteria :
Is there another way to parse the catalog source code to query LIBNAME paths ?
Many thanks in advance,
Wanda
Some code like below should give you the list of all entries belonging to a specific catalog. Requires of course that there is a libname that assigns the folder with the catalog to the SAS session.
proc sql;
create table want as
select *
from dictionary.catalogs
where memname='GESCO' and memtype='CATALOG'
;
quit;
Thank you Patrick, but with this query, I can only get internal references to the catalog 'GESCO', although I know, for example, that in the init.scl file of another catalog (named 'GESBA'), there is the following reference : libname gesco "/env/data/gesco": how can I retrieve it ? Do the dictionary tables contain such information ?
@adnavv wrote:
Thank you Patrick, but with this query, I can only get internal references to the catalog 'GESCO', although I know, for example, that in the init.scl file of another catalog (named 'GESBA'), there is the following reference : libname gesco "/env/data/gesco": how can I retrieve it ? Do the dictionary tables contain such information ?
See if you can do it with a data step.
filename src catalog 'mylib.gesba.init.scl';
data _null_;
infile src;
input;
if find(_infile_,'gesco','i') then list;
run;
@adnavv wrote:
Thank you Patrick, but with this query, I can only get internal references to the catalog 'GESCO', although I know, for example, that in the init.scl file of another catalog (named 'GESBA'), there is the following reference : libname gesco "/env/data/gesco": how can I retrieve it ? Do the dictionary tables contain such information ?
Dictionary tables would only have the library if the library is active in the current session
@adnavv wrote:
Thank you Patrick, but with this query, I can only get internal references to the catalog 'GESCO', although I know, for example, that in the init.scl file of another catalog (named 'GESBA'), there is the following reference : libname gesco "/env/data/gesco": how can I retrieve it ? Do the dictionary tables contain such information ?
SAS catalogues are stored in SAS proprietary binary files with extension .sas7bcat
SAS Note 23187 describes how you can print SOURCE and SCL catalog entries to external text files using PROC BUILD. You can then search the text files using SAS or other text search tools (Notepad++ is a good option). I assume that you would need SAS/AF installed and licensed to do this.
And there is also the filename CATALOG Access Method.
@Patrick - The CATALOG Access Method doesn't appear to work for SCL entries.
Thank you for sharing!
I have done a quick test with appending two catalogs source codes ('gesco', 'gesba'). The procedure has exported a total of 150 pages, which I still need to validate, but it may help me a lot.
We would need to extract the source code of each screen belonging to each catalog (*.sas7bcat). It seems that the PROC BUILD doesn't allow to export the screen source code..
Is there a another way to get it ?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.