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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.