Help using Base SAS procedures

removing a password from a library

Accepted Solution Solved
Reply
Contributor
Posts: 24
Accepted Solution

removing a password from a library

Hi All

I have a sasl library e:\sas\data\test2 with a bunch of table s in it *.sas7bdat , this table has a password on it I cant seem to get rid of

using

proc datasets;

   contents data=TEST2.Robm_stir110u_fall_enrolment(pw=<password deleted>);

   run;

   modify TEST2 (pw=<password deleted>/);

   run;

   contents data=TEST2.Robm_stir110u_fall_enrolment;

   run;

how do i remove it from the library?


Accepted Solutions
Solution
‎06-06-2015 05:14 AM
Super User
Posts: 7,782

Re: removing a password from a library

You can use sashelp.vtable to get a list of datasets (use a WHERE condition to select your library). With this list in a dataset, you can use a simple DATA step and the call execute subroutine to create the code dynamically.

data _null_;

set sashelp.vtable (where=(libname='TEST2')) end=done;

if _n_ = 1 then call execute('proc datasets library=TEST2 nolist;');

call execute('modify ' !! strip(memname) !! ' (pw=<password>/);');

if done then call execute('run;');

run;


---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
SAS Employee
Posts: 340

Re: removing a password from a library

This removes the password protection from a dataset (not the library):

proc datasets;

   modify dataset (pw=oldpwd/);

   run;

quit;

Super User
Posts: 7,782

Re: removing a password from a library

Do you mean how to remove passwords from all the datasets in the library?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 24

Re: removing a password from a library

Posted in reply to KurtBremser

yes ideally without listing each data-set in the library manually like I did here

proc datasets library=TEST2 nolist;

modify Stcd110_census_term_enrolment(pw=welcome/);

modify Stcr502_length_of_study(pw=welcome/);

modify Stir110u_fall_enrolment(pw=welcome/);

modify Stir110u_winter_enrolment(pw=welcome/);

modify Stir115u_summer_session_enrolmt(pw=welcome/);

run;

quit;

Solution
‎06-06-2015 05:14 AM
Super User
Posts: 7,782

Re: removing a password from a library

You can use sashelp.vtable to get a list of datasets (use a WHERE condition to select your library). With this list in a dataset, you can use a simple DATA step and the call execute subroutine to create the code dynamically.

data _null_;

set sashelp.vtable (where=(libname='TEST2')) end=done;

if _n_ = 1 then call execute('proc datasets library=TEST2 nolist;');

call execute('modify ' !! strip(memname) !! ' (pw=<password>/);');

if done then call execute('run;');

run;


---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 24

Re: removing a password from a library

Posted in reply to KurtBremser

awesome thanks Kurt that will work for me!

Super User
Posts: 7,782

Re: removing a password from a library

Glad it helped. Could you please mark asnwers as helpful and correct so that the question is properly marked as "answered"

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 24

Re: removing a password from a library

yes but hopefully without listing each table manually as I did here

proc datasets library=TEST2 nolist;

modify Stcd110_census_term_enrolment(pw=<password>/);

modify Stcr502_length_of_study(pw=<password>/);

modify Stir110u_fall_enrolment(pw=<password>/);

modify Stir110u_winter_enrolment(pw=<password>/);

modify Stir115u_summer_session_enrolmt(pw=<password>/);

run;

quit;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 909 views
  • 2 likes
  • 3 in conversation