Explanation : Data Step performing the main logic: searching for the library object via a metadata XML query, looping over found objects, extracting associated extensions, and writing to the 'extend' output table.
Copied!
data extend;
length type id lib_uri ext_uri ext_name $ 50 ext_val $ 256;
call missing(of _CHARACTER_);
obj="omsobj:SASLibrary? @Name=&libname";
libcount=metadata_resolve(obj,type,id);
if libcount > 0 then do n=1 to libcount;
rc=metadata_getnobj(obj,n,lib_uri);
ext_count=metadata_getnasn(lib_uri,"Extensions",1,ext_uri);
if ext_count > 0 then do m=1 to ext_count;
rc=metadata_getnasn(lib_uri,"Extensions",m,ext_uri);
rc=metadata_getattr(ext_uri,"Name",ext_name);
rc=metadata_getattr(ext_uri,"Value",ext_val);
output;
end; else put "NOTE: No Extended Attributes found for library &libname";
end;
else put "NOTE: No library &libname found.";
keep ext_name ext_val;
run;
1
DATA extend;
2
LENGTH type id lib_uri ext_uri ext_name $ 50 ext_val $ 256;
END; ELSE put "NOTE: No Extended Attributes found for library &libname";
18
END;
19
ELSE put "NOTE: No library &libname found.";
20
21
keep ext_name ext_val;
22
RUN;
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.
Copyright Info : Author: Greg Wootton Date: 16MAY2017
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.