I have the following datasets in a list;
proc sql noprint;
select distinct MEMNAME
into :MEM_LIST separated by " "
from DICTIONARY.COLUMNS
where LIBNAME="PMODA";
quit;%put &MEM_LIST;
APR_19 APR_20 AUG_19 DEC_19 FEB_19 FEB_20 JAN_19 JAN_20 JUL_19 JUN_19 MAR_19 MAR_20 MAY_19 NOV_19 OCT_19 SEP_19 YEAR_TO_DATE_19However, I want to only have datasets which end in _19 in my variable called mem_list.
I've tried to use and memname like "19%" in my sql query but this does appear to pick it up.
Can anyone provide some suggestions, please?
Well if you are filtering using LIBNAME='PMODA' , you would only have those datasets in that library.
Hmm, I am wondering whether you are asking to concatenate the libname with memname? Is this correct?If yes, you may want to do this-
select distinct catx('.',libname,MEMNAME) as memname
select distinct catx('.',libname,MEMNAME) as memname
into :MEM_LIST separated by " "
from DICTIONARY.COLUMNS
where LIBNAME="PMODA";
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.