简体   繁体   English

如何在sas中计算加法和减法

[英]How to calculate addition and subtraction in sas

How to calculate this below下面如何计算

Used below formula in Microsoft excel在 Microsoft excel 中使用以下公式

   C = col1-col2- col3 + col4

I used below logic to convert above formula into SAS我使用以下逻辑将上述公式转换为 SAS

   C1 = col1-col2
   C2 = sum(col3,col4)
   C1= C1-C2

Still not able to match value with Microsoft excel output仍然无法将值与 Microsoft excel 输出匹配

You just need to wrap it in a datastep:你只需要将它包装在一个数据步骤中:

data new_data;
   set old_data;
   C = col1 - col2 - col3 + col4;
run;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM