The `AHGlibMems` macro takes a library name (default 'work') and a destination macro variable name as input. It queries the `sashelp.vtable` system view to extract the names of tables associated with that library. The result is a list of concatenated names (format `lib.table`) separated by spaces, stored in the specified global macro variable.
Data Analysis
Type : SASHELP
Reading metadata via the standard `sashelp.vtable` system view.
1 Code Block
PROC SQL
Explanation : Global declaration of the list variable. Use of PROC SQL to select and concatenate table names found in `sashelp.vtable` corresponding to the provided `libname`.
Copied!
%macro AHGlibMems(lib=work,locallist=datalist);
%global &locallist;
proc sql noprint;
select compress("&lib.."||memname) into :&locallist separated by ' '
from sashelp.vtable
where libname=upcase("&lib");
quit;
%mend;
1
%macro AHGlibMems(lib=work,locallist=datalist);
2
%global &locallist;
3
PROC SQL noprint;
4
select compress("&lib.."||memname) into :&locallist separated BY' '
5
from sashelp.vtable
6
where LIBNAME=upcase("&lib");
7
QUIT;
8
9
%mend;
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.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.