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: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 502 views
  • 1 like
  • 3 in conversation