34%
if %sysfunc(libref(&libref)) %then %
do;
36 length liburi LibName msg $200;
37 call missing(of _all_);
38 nobj=metadata_getnobj(
"omsobj:SASLibrary?@Libref='&libref'",1,liburi);
40 rc=metadata_getattr(liburi,
"Name",LibName);
42 if libname(
"&libref",,
'meta',cats(
'liburi="',liburi,
'";')) ne 0 then do;
43 putlog
"&libref could not be assigned";
51 if msg=:'ERROR: Libref SAVE is not assigned.' then do;
53 "Could not assign %upcase(&libref).",
54 "Please check metadata permissions! Libname:",libname,
58 else if msg=
"ERROR: User does not have appropriate authorization "!!
59 "level for library SAVE."
62 "ERROR: User does not have appropriate authorization level",
63 "for library %upcase(&libref), libname:",libname,
67 call symputx('msg',msg,
'l');
68 if
"&mabort"='HARD' then call symputx('mp_abort',1,
'l');
72 call symputx('libname',libname,
'L');
73 call symputx('liburi',liburi,
'L');
76 else if nobj>1 then do;
77 if
"&mabort"='HARD' then call symputx('mp_abort',1);
78 call symputx('msg',
"More than one library with libref=&libref");
81 if
"&mabort"='HARD' then call symputx('mp_abort',1);
82 call symputx('msg',
"Library &libref not found in metadata");
90 %put NOTE: Library &libref is already assigned;
93%mp_abort(iftrue= (&mp_abort=1)