Hi Have number of tables in work library and want to combined result of below query in a one table
SELECT count(distinct Client_Key) FROM work.Table_C
WHERE Memberstatus='Existing'
SELECT count(distinct Client_Key) FROM work.Table_2019_07_jul WHERE Memberstatus='Existing' SELECT count(distinct client_key) FROM work.Table_2019_06_jun WHERE Memberstatus='Existing' SELECT count(distinct Client_Key) FROM work.Table_2019_05_may WHERE Memberstatus='Existing'
proc sql;
create table all as
select count(distinct Client_Key) as count
from work.Table_C
where Memberstatus='Existing'
union all
select count(distinct Client_Key) as count
from work.Table_2019_07_jul
where Memberstatus='Existing'
union all
select count(distinct client_key) as count
from work.Table_2019_06_jun
where Memberstatus='Existing'
union all
select count(distinct Client_Key) as count
from work.Table_2019_05_may
where Memberstatus='Existing'
;
quit;
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.