I am working from time to time with very large datasets and I was wondering if there is a way to fuzzy search using PROC CONTENTS or some other method to list specific fields matching one criteria or another.
Of course the fallback way is to just do a CTRL-F but that is really inefficient when you have dataset with two thousand variables.
Do you mean something like this:
create table work.varlist as
select libname, memname, name, type, label, format
where upcase(libname) = 'SASHELP' and
upcase(memname) = 'SHOES' and
name contains 'ry';
proc print data=work.varlist;
title 'Variables from SASHELP.SHOES that contain the string "ry"';
and the output from the job is:
Variables from SASHELP.SHOES that contain the string "ry"
Obs libname memname name type label format
1 SASHELP SHOES Subsidiary char
2 SASHELP SHOES Inventory num Total Inventory DOLLAR12.
In this example, the search is for something about the variable NAME as the selection criteria.
On the other hand, you may actually want to find something about a variable value using a search -- which would require reading the actual file itself instead of dictionary.columns.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.