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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.