SAS合并具有相同变量名称的两个数据集

问题描述 投票:1回答:1

我有以下程序合并两个观察,但具有相同的列名(变量),我想知道为什么在合并结果列A中被删除?

data three;
     merge one(in=a) two;
     by ID;     
run;

enter image description here

sas
1个回答
2
投票

您应该在日志中记下告诉您原因的说明。

WARNING: The variable a exists on an input data set and is also set by an I/O statement 
         option.  The variable will not be included on any output data set and unexpected
         results can occur.

如果您不需要,请不要使用IN=数据集选项。或者确保不要使用已经是数据集中的变量的名称。

data three;
  merge one(in=in1) two;
  by ID;
  if in1;
run;
© www.soinside.com 2019 - 2024. All rights reserved.