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

I have several hundred datasets which all need to have password protection added (the same password for all datasets). The naming convention used is data_yyyyMMMdd with the dates increasing weekly (example: data_2022mar13, data_2022mar20).

 

Is there a way to modify all datasets in the dataset procedure?   I looked at the example date %do loop here: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n01vuhy8h909xgn16p0x6rddpoj9.htm

however SAS doesn't seem to recognize the yyyyMMMdd date format.

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

How about this? Run to see how it works and complete as required.

ods output members=MEMBERS;
proc datasets lib=WORK ;
run;
ods output close;

data _null_;
  set MEMBERS;
  where MEMTYPE='DATA';
  if _N_=1 then call execute('proc datasets lib=WORK;');
  call execute('modify '||NAME||';');
run;
run;

 

View solution in original post

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

How about this? Run to see how it works and complete as required.

ods output members=MEMBERS;
proc datasets lib=WORK ;
run;
ods output close;

data _null_;
  set MEMBERS;
  where MEMTYPE='DATA';
  if _N_=1 then call execute('proc datasets lib=WORK;');
  call execute('modify '||NAME||';');
run;
run;

 

Patrick
Opal | Level 21

If these tables are all in a single or only a few libraries then another option could be the use of metadata bound libraries.

https://go.documentation.sas.com/doc/en/bicdc/9.4/bisecag/n1nesjvtxu7783n1pveml8ct4txk.htm 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 769 views
  • 0 likes
  • 3 in conversation