sas difference between sum and +?

后端 未结 2 1225
孤独总比滥情好
孤独总比滥情好 2021-01-24 08:49
data whatever;
 infile \'\';
 input price cost;
 ;
run;

In , what\'s the difference between using

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-24 09:27

    You'd probably have trouble with either of those if you actually including it after the input statement.

    The information that ProgramFOX posted is correct, but if you're asking about the difference between these three statements, there's a little more to it:

    total = sum(total,cost);
    total + cost;
    

    The second of these implies a retain total; statement and will also treat nulls as zero. You run into the null problem when you're using this type of expression:

    total = total + cost;
    

提交回复
热议问题