i want to combine two tables to one table by using merge..
DAta report;
merge table1 table2;
run;
Table1 has 200000 records
TAble2. Has 5000 records
when I run the merge I get 13k from table 1 and table2 has 4k
somehow it brings in less record to new table".. Thanks for assistance
If you ran it without any changes I doubt its what you want.
Typically you want a BY statement in a merge, so you can join the two tables on some field.
data want;
merge table1 table2;
BY ID;
run;
Please show your log. The code you showed will not have the result you claimed.
Hi Hai kuo
i just reran the script an it merge the correct amount of 200k and 5 k records.... without any changes. To my script could you provide me an example of how it should look since you said mine looks incorrect ...I'm happy that is merging correctly but don't understand why it didn't first couple times ...thank you again for your assistance
Glad it worked out for you as it should. What I meant is that your code will not produce the outcome you claimed (13k and 4k) , I didn't say it can't produce something that 'you wanted'.
If you ran it without any changes I doubt its what you want.
Typically you want a BY statement in a merge, so you can join the two tables on some field.
data want;
merge table1 table2;
BY ID;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.