I have the following code within a macro which goes from 1 to 2. Example data for ALL_KLMEAN1 and ALL_KLMEAN2 is included with the code.
DATA ALLA_KLMEAN&K;
SET nsum&K;
BY NREP;
IF uclm => 0.79 THEN ANSWER1=1;
IF uclm LT 0.79 THEN ANSWER1=0;
RUN;
option spool;
proc sql number;
CREATE TABLE FINAL AS
select UCLM, ANSWER1 ,NREP
from ALLA_KLMEAN&K;
QUIT;
Data: nrep lclm uclm Answer1
ALLA_KLMEAN1 1 -0.003 0.044 0
ALLA_KLMEAN2 2 -0.004 0.049 0
After the macro is run the table final only contains the results from ALL_KLMEAN2.. I want the final table to contain ALL_KLMEAN2
and ALL_KLMEAN1 results so it would look like this:
nrep uclm answer1
1 0.044 0
2 0.049 0
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.