The script queries the DICTIONARY.TABLES system view to list the library's contents. It then reads the data from the library passed as a parameter ('lib') for export.
1 Code Block
PROC SQL
Explanation : This step retrieves the list of table names (members) present in the library specified by the &lib parameter by querying the SAS dictionary. The list is stored in the &memlist macro variable.
Copied!
proc sql noprint;
select distinct lowcase(memname)
into: memlist
separated by ' '
from dictionary.tables
where upcase(libname)="%upcase(&lib)";
1
PROC SQL noprint;
2
select distinct lowcase(memname)
3
into: memlist
4
separated BY' '
5
from dictionary.tables
6
where upcase(LIBNAME)="%upcase(&lib)";
2 Code Block
Macro Call
Explanation : Cleans the output directory path (removes trailing slashes) and ensures the directory exists by calling the %mf_mkdir utility macro.
Explanation : Loops through each table found in the library. Calls the %mp_ds2cards macro to generate the corresponding CARDS file. Manages the logic of appending to a single file (append=YES) or creating separate files depending on the value of the &outfile parameter.
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.