11-08-2017 12:49 PM
I've 2 datasets which has 6 columns in 1 dataset & another has 8 columns. But first 5 columns are same in both. Say first dataset name is A and another B. I want to merge the 2 dataset such that I get 9 total columns. Generally we merge using SQL in the following way:
proc sql; create table example as select a.*,b.var1,b.var2,b.var3 from A as a left join B as b on a.key1 = b.key1 and a.key2 = b.key2 and a.key3 = b.key3 and a.key4 = b.key4 and a.key5 = b.key5; quit;
And if I need to merge the table again and again, I've to repeatedly write the 5 keys again and again.
My question is, is there any way I can pass the key in macro and call the macro while merging?
11-09-2017 05:08 AM
Need further help from the community? Please ask a new question.