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

Hi,

 

Using https://www.lexjansen.com/sesug/2015/76_Final_PDF.pdf as a starting point, I have 

 

 

ods output variables = proc_vars;
proc contents data=par_dat._all_;
run;
proc sort data=proc_vars;
 by member num;
run;
options nobyline;
ODS EXCEL FILE="&xpt.par_dat_contents.xlsx"
 options(sheet_name="#BYVAL(member)"
 embedded_titles='yes');
proc print data=proc_vars noobs;
 by member;
 pageby member;
 title "Variables in #BYVAL(member) table";
run;
ODS EXCEL CLOSE;

 I don't actually want the proc contents of all of the datasets, but only the ones that end in 20210720 (where=(memname like '%20210720')). How can the code be updated to limit the output? Thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

Why not just use this?

proc print data=PROC_VARS(where=(MEMNAME like '%20210720')) noobs;

 

View solution in original post

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

Why not just use this?

proc print data=PROC_VARS(where=(MEMNAME like '%20210720')) noobs;

 

kb011235
Obsidian | Level 7

Thanks, update memname to member and it works. 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1297 views
  • 2 likes
  • 2 in conversation