33%
if %sysfunc(libref(&libref)) %then %
do;
35 length liburi LibName msg $200;
36 call missing(of _all_);
37 nobj=metadata_getnobj(
"omsobj:SASLibrary?@Libref='&libref'",1,liburi);
39 rc=metadata_getattr(liburi,
"Name",LibName);
41 if libname(
"&libref",,
'meta',cats(
'liburi="',liburi,
'";')) ne 0 then do;
42 putlog "&libref could not be assigned";
50 if msg=:'ERROR: Libref SAVE is not assigned.' then do;
52 "Could not assign %upcase(&libref).",
53 "Please check metadata permissions! Libname:",libname,
57 else if msg="ERROR: User does not have appropriate authorization "!!
58 "level for library SAVE."
61 "ERROR: User does not have appropriate authorization level",
62 "for library %upcase(&libref), libname:",libname,
66 call symputx('msg',msg,'l');
67 if "&mabort"='HARD' then call symputx('mp_abort',1,'l');
71 call symputx('libname',libname,'L');
72 call symputx('liburi',liburi,'L');
75 else if nobj>1 then do;
76 if "&mabort"='HARD' then call symputx('mp_abort',1);
77 call symputx('msg',"More than one library with libref=&libref");
80 if "&mabort"='HARD' then call symputx('mp_abort',1);
81 call symputx('msg',"Library &libref not found in metadata");
89 %put NOTE: Library &libref is already assigned;
92%mp_abort(iftrue= (&mp_abort=1)