BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

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