compute ChangeN;
_c4_ = (_c3_ - _c2_);
endcomp;
when _C3_ is 2
and column _C2_ 0
I want to see -2
but I am seeing in _c4_ 0
how to solve it.
@USHAKS wrote:
compute ChangeN;
_c4_ = (_c3_ - _c2_);
endcomp;
when _C3_ is 2
and column _C2_ 0
I want to see -2
but I am seeing in _c4_ 0
how to solve it.
How about
_c4_ = _c2_-_c3_;
compute ChangeN;
_c4_ = (_c3_ - _c2_);
endcomp;
C3 is 2020 sales
c2 is 2019 sales
when it is c3 is 13
and c2 is 15 I get -2
Assume C3 is 2020 sales and it is 0
C2 2019 sales 2
I do not get -2
thanks,
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.