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?
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;
This removes the password protection from a dataset (not the library):
proc datasets;
modify dataset (pw=oldpwd/);
run;
quit;
Do you mean how to remove passwords from all the datasets in the library?
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;
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;
awesome thanks Kurt that will work for me!
Glad it helped. Could you please mark asnwers as helpful and correct so that the question is properly marked as "answered"
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.