07-03-2011 10:59 AM
Is there any method to merge two datasets without using MERGE statement . it might be simple question . but as I am new to SAS , Please provide the information . thanks!!
07-04-2011 02:27 PM
Depends on what you are trying to do. Does the following approximate what you are calling merging?
input y $;
07-05-2011 01:54 AM
Hi, You can use the proc sql statement to join your two tables.
the inner join is the match join. You'll need your id in the two tables to have it as output.
the left or right join permitts to join a source table with an other and one of the tables is used as reference.
the full join just tries to match your two tables. it's the less used.
07-12-2011 09:40 AM
There are lot of methods available for merging 2 datasets. But which method you use is based on the type of data and number of observation it has.
1. PROC SQL;
FROM TABLE1 AS T1,TABLE2 AS T2
In PROC SQL itself there are many methods available (Inner Join, Left Join, Right Join) and apart from that you can use SET operators (EXCEPT,INTERCEPT, UNION) to merge datasets. (But each one serve different purpose).
2. SET statement
a) DATA dataset-name;
b) DATA dataset-name;
SET sas-dataset KEY=index-name;
When you specify the index name in the KEY=option, processing changes from sequential to direct access, and SAS reads only the observation that satisfies the lookup.
Hope this answers your question.