|
|
沙发

楼主 |
发表于 2009-10-10 08:50:21
|
只看该作者
Re: merge是变量长度问题
length attribute
If the length attribute is different, [color=#FF0000:16b1mb9v]SAS takes the length from the first data set that contains the variable[/color:16b1mb9v]. In the following example, all data sets that are listed in the MERGE statement contain the variable Mileage. In QUARTER1, the length of the variable Mileage is four bytes; in QUARTER2, it is eight bytes and in QUARTER3 and QUARTER4, it is six bytes. In the output data set YEARLY, the length of the variable Mileage is four bytes, which is the length derived from QUARTER1.
data yearly;
merge quarter1 quarter2 quarter3 quarter4;
by Account;
run;
To override the default and set the length yourself, specify the appropriate length in a LENGTH statement that precedes the SET, MERGE, or UPDATE statement.
以上的内容是SAS 9.1 Help中的原话。搜索关键词:“Reading, Combining, and Modifying SAS Data Sets”,“Combining SAS Data Sets: Basic Concepts” |
|