I'm setting up a proof-of-concept mini-bijou-datamartette. Because the source Microsofty tables are quite sensitive, I must retain security while I go about my investigation phase.
I don't have access to Management Studio (although I'm working on it) and the tables aren't registered with metadata, so I'm cutting my code by hand. It's not ideal, but it's just the way things are.
When I bring the staging data over from the source, can I code a Base-engined libname with a read and write passwords over every dataset, or do I have to apply the passwords individually to each target dataset? If the latter I don't really mind, but it'd be easier if I could apply them higher up.
Ngā mihi nui,
Laurie
I don't see anything on the libname that indicates this is possible. That doesn't mean it doesn't exist though.
Here's a macro approach that you can use if desired.
%macro lockdown(lib=, datain=, pw=, alter=, read=, write=);
proc datasets lib=&lib.;
modify &datain. (pw=&pw alter=&alter read=&read write=&write);
run;quit;
%mend;
%let lib=demo;
data check;
length str $200.;
format str $200.;
set sashelp.vtable (keep= libname memname);
where libname=upcase("&lib");
str = catt('%lockdown(lib= ', libname,
', datain=', memname,
', pw=', 'Password1',
', alter=', 'Password2',
', read=', 'Password3',
', write=', 'Password4',
');');
*call execute(str);
run;
I don't see anything on the libname that indicates this is possible. That doesn't mean it doesn't exist though.
Here's a macro approach that you can use if desired.
%macro lockdown(lib=, datain=, pw=, alter=, read=, write=);
proc datasets lib=&lib.;
modify &datain. (pw=&pw alter=&alter read=&read write=&write);
run;quit;
%mend;
%let lib=demo;
data check;
length str $200.;
format str $200.;
set sashelp.vtable (keep= libname memname);
where libname=upcase("&lib");
str = catt('%lockdown(lib= ', libname,
', datain=', memname,
', pw=', 'Password1',
', alter=', 'Password2',
', read=', 'Password3',
', write=', 'Password4',
');');
*call execute(str);
run;
Thanks, Reeza! Nicely done. I was thinking along those lines but had been putting it off. Having it a library level would be handy though.
In a perfect world I'd get metadata to control it...oh well.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.