I do like this:
LIBNAME aaa SASIOLA TAG=aaa PORT=000 HOST="aaa" SIGNER="http://aaa/SASLASRAuthorization" ;
/* Remove existing table from LASR if loaded already */
%macro deletedsifexists(lib,name);
%if %sysfunc(exist(&lib..&name.)) %then %do;
proc datasets library=&lib. nolist;
delete &name.;
quit;
%end;
%mend deletedsifexists;
%deletedsifexists(MEBELA, im_medbedom); proc copy in=fromLIB OUT=aaa; select myTable; quit; %macro registertable( REPOSITORY=Foundation, REPOSID=, LIBRARY=, TABLE=, FOLDER=, TABLEID=, PREFIX= ); /* Mask special characters */ %let REPOSITORY=%superq(REPOSITORY); %let LIBRARY =%superq(LIBRARY); %let FOLDER =%superq(FOLDER); %let TABLE =%superq(TABLE); %let REPOSARG=%str(REPNAME="&REPOSITORY."); %if ("&REPOSID." ne "") %THEN %LET REPOSARG=%str(REPID="&REPOSID."); %if ("&TABLEID." ne "") %THEN %LET SELECTOBJ=%str(&TABLEID.); %else %LET SELECTOBJ=&TABLE.; %if ("&FOLDER." ne "") %THEN %PUT INFO: Registering &FOLDER./&SELECTOBJ. to &LIBRARY. library.; %else %PUT INFO: Registering &SELECTOBJ. to &LIBRARY. library.; proc metalib; omr ( library="&LIBRARY." %str(&REPOSARG.) ); %if ("&TABLEID." eq "") %THEN %DO; %if ("&FOLDER." ne "") %THEN %DO; folder="&FOLDER."; %end; %end; %if ("&PREFIX." ne "") %THEN %DO; prefix="&PREFIX."; %end; select ("&SELECTOBJ."); run; quit; %mend; /* Synchronize table registration */ %registerTable( LIBRARY=%nrstr(/Path/to/LASRLib) , REPOSITORY=%nrstr(Foundation) , TABLE=%nrstr(myTable) , FOLDER=%nrstr(/Path/to/metadataFolder) );
Works great and the RLS is still there 🙂
If you stlll have problems with RLS, you can add them using scripts after your reload:
http://documentation.sas.com/?docsetId=bisecag&docsetTarget=n1sjpmdvbsgp7bn1vpx0hsvsizcz.htm&docsetVersion=9.4&locale=sv
//Fredrik
... View more