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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.