BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LaurieF
Barite | Level 11

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

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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;

View solution in original post

2 REPLIES 2
Reeza
Super User

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;
LaurieF
Barite | Level 11

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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 934 views
  • 3 likes
  • 2 in conversation