BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

In a permanent library called labqret there are multiple data sets.

Some of the data sets  there have the name labqret.ABC_TS_YYMMB

For example:

labqret.ABC_TS_2106B   (It means June 2021)

labqret.ABC_TS_2105B  (It means MAY 2021)

labqret.ABC_TS_2104B  (It means April 2021)

and so on

 

I want to write a program that create a macro variable called memlist with names of data sets that exists in library labqret only with names labqret.ABC_TS_YYMMB.

The problem is that I get null result

proc sql noprint ;
%let memlist=_null_;
  select catx('.',libname,memname)
    into :memlist separated by ' '
    from dictionary.members 
    where libname='labqret'
      and ((memname like 'ABC_TS_%'))
  ;
quit;
%put &memlist;
2 REPLIES 2

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 542 views
  • 1 like
  • 3 in conversation