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
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 16. 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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: