barbararan 发表于 2014-2-8 15:43 
楼主这里一个问题,
data a;
input id x@@;
这里关键是要搞清楚没有by的merge是什么意思,它是one-to-one merging,而不是match-merging。 还是看原版的解释吧。注意同名变量的变量值替代。
One-to-one merging combines observations from two or more SAS data sets into a single observation in a new data set. To perform a one-to-one merge, use the MERGE statement without a BY statement. SAS combines the first observation from all data sets that are named in the MERGE statement into the first observation in the new data set, the second observation from all data sets into the second observation in the new data set, and so on. In a one-to-one merge, the number of observations in the new data set is equal to the number of observations in the largest data set named in the MERGE statement.