在SAS中执行列之间差异的最有效方法

时间:2015-05-03 18:31:24

标签: sas diff

我有一个如下所示的SAS数据集。我想使用第一列值作为minuend,即第2列 - 第1列,第3列 - 第1列,第4列 - 第1列......哪种在SAS中进行这种差异的最有效方法是什么?使用数组还是执行循环?

Android SDK was installed to C:\Users\Alex\AppData\Local\Android\sdk
Refresh Sources:
  Fetched Add-ons List successfully
  Refresh Sources

Installing Archives:
  Preparing to install archives
  Skipping 'Google APIs, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
  Skipping 'Google APIs Intel x86 Atom System Image, Google Inc. API 22, revision 1'; it depends on 'Google APIs, Android API 22, revision 1' which was not installed.
  Done. Nothing was installed.
The following SDK components were not installed: sys-img-x86-addon-google_apis-google-22 and addon-google_apis-google-22
Refresh Sources:
  Fetched Add-ons List successfully
  Refresh Sources

Installing Archives:
  Preparing to install archives
  Skipping 'Google APIs, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
  Skipping 'Google APIs Intel x86 Atom System Image, Google Inc. API 22, revision 1'; it depends on 'Google APIs, Android API 22, revision 1' which was not installed.
  Done. Nothing was installed.
The following SDK components were not installed: sys-img-x86-addon-google_apis-google-22 and addon-google_apis-google-22

1 个答案:

答案 0 :(得分:1)

使用arrays,如下所示

data _NULL_;
set test;
array all{*} expense2-expense5;
array diff{*} diff_exp2-diff_exp5;
do i=1 to dim(all);
diff[i]= expense1 - all{i};
end;
put _ALL_;
run;