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

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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;


View solution in original post

7 REPLIES 7
gergely_batho
SAS Employee

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

proc datasets;

   modify dataset (pw=oldpwd/);

   run;

quit;

merrittr
Obsidian | Level 7

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;

Kurt_Bremser
Super User

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;


merrittr
Obsidian | Level 7

awesome thanks Kurt that will work for me!

merrittr
Obsidian | Level 7

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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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