Hi,
I am new to Proc Sql and wondering how to use wild cards such as 'SAS%' (SAS*) or 'SAS____ to identify the library names with SAS as prefix in the following code. Same is treu for the MAPS libraries as prefix or SAS as suffix.
Can someone explain these wild cards by showing side by side how they are different from data step.
Appreciated!
data metadata2;
set sashelp.vcolumn;
where libname not in ('SASHELP', "SASHELP", 'SASUSER', 'SAMPSIO',
'SUBFUNC', 'MAPS', 'MAPSSAS', 'MAPSGFK', 'SAL428SL', 'STP:', 'TLV4');
run;
Your use of colon in your initial example wouldn't have worked anyway. Here is a simplified version which, as you can see if you test it, doesn't work:
data metadata2;
set sashelp.vcolumn;
where libname in ('SAS:');
run;
Art, CEO, AnalystFinder.com
The same syntax can be used with both. e.g.:
data metadata2;
set sashelp.vcolumn;
where libname not like ('SAS%') and
libname not like ('STP%') and
libname not like ('MAPS%') and
libname not in ('SAMPSIO','SUBFUNC', 'SAL428SL', 'TLV4');
run;
proc sql;
create table metadata2 as
select *
from dictionary.columns
where libname not like ('SAS%') and
libname not like ('STP%') and
libname not like ('MAPS%') and
libname not in ('SAMPSIO','SUBFUNC', 'SAL428SL', 'TLV4')
;
quit;
Art, CEO, AnalystFinder.com
Your use of colon in your initial example wouldn't have worked anyway. Here is a simplified version which, as you can see if you test it, doesn't work:
data metadata2;
set sashelp.vcolumn;
where libname in ('SAS:');
run;
Art, CEO, AnalystFinder.com
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.