s*********h 发帖数: 16 | 1 想不明白为什么下面两个datasets merge会出错。请指教
The variable attributes of SAS data sets ONE and TWO are shown below:
ONE
# Variable Type Len Pos
2 sales Num 8 8
1 year Num 8 0
TWO
# Variable Type Len Pos
2 budget Num 8 8
3 sales Char 8 16
1 year Num 8 0
Data set ONE contains 100 observations. Data set TWO contains 50
observations. Both data sets are sorted by the
variable YEAR. The following SAS program is submitted:
data three;
merge one two;
by year;
run;
Which one of the following is the result of the prog |
c**********e 发帖数: 2007 | 2 B.
I got the real problem when I tried to merge two datasets
by patient id, but in one dataset it was numeric, but in
another dataset it was char. The two variables look identical.
I had to change type of one of them before merging.
This problem is different in that the type mismatch is not for
the by variable. But the error message is the same. |
c**********e 发帖数: 2007 | 3 To make it work, you either change type or rename the
sales variable in one of the datasets.
【在 s*********h 的大作中提到】 : 想不明白为什么下面两个datasets merge会出错。请指教 : The variable attributes of SAS data sets ONE and TWO are shown below: : ONE : # Variable Type Len Pos : 2 sales Num 8 8 : 1 year Num 8 0 : TWO : # Variable Type Len Pos : 2 budget Num 8 8 : 3 sales Char 8 16
|
s*********h 发帖数: 16 | |