Hi SAS Community,
I'm having a problem trying to combine 20 datasets using proc sql. I can do it in a datastep, but is it possible to do with proc sql?
data want;
set have_: ; /*all of my datasets begin with have_*/ /*For instance, have_01, have_02, have_03....etc */
if dc_code = "" then total = total +1;
run;
Is it possible to perform this same procedure using proc sql?
Thanks
Is it possible to perform this same procedure using proc sql?
Thanks
No because Proc sql doesn't support variable/dataset name lists. You could perhaps generate sql union operator statements in a macro or using call execute reading dictionary tables, but that's rather tedious.
Is it possible to perform this same procedure using proc sql?
Thanks
No because Proc sql doesn't support variable/dataset name lists. You could perhaps generate sql union operator statements in a macro or using call execute reading dictionary tables, but that's rather tedious.
Is it possible to perform this same procedure using proc sql?
It's possible by listing out the tables or creating a macro that unions all the tables.
Is it efficient or practical to do so? Not really.
@belboy wrote:
Hi SAS Community,
I'm having a problem trying to combine 20 datasets using proc sql. I can do it in a datastep, but is it possible to do with proc sql?
data want;
set have_: ; /*all of my datasets begin with have_*/ /*For instance, have_01, have_02, have_03....etc */
if dc_code = "" then total = total +1;
run;
Is it possible to perform this same procedure using proc sql?
Thanks
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!
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.