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
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.