Issue:
I need to find out all the column name for all the table in a specific library, table name with specific string.Solution:
To get all the column name for all the table in all the library use below code:
PROC sql;SELECT name
FROM dictionary.columns;
QUIT;
To get column name from specific library:
PROC sql;SELECT name
FROM dictionary.columns
WHERE libname='MYLIB';
QUIT;
In the place of MYLIB use the libref of the library.
To get column name for specific table:
PROC sql;SELECT name
FROM dictionary.columns
WHERE libname='MYLIB' and memname like 'EWF%';
QUIT;
The above query will get you the result for all the table that contains string starting with EWF.
Reference: http://www2.sas.com/proceedings/sugi30/070-30.pdf
Comments
Post a Comment