Doing subtraction with macro variables

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Doing subtraction with macro variables

albert_sun
Hi, all:

if !LET !a=1. !LET !b=2., and you can not do sum using !LET !c=!a + !b. However, you can do it using !LET !c=!LENGTH(!CONCAT(!BLANK(!a),!BLANK(!b)).

My question is how to do subtraction /multiplication/ division with similar method?

any idea?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Doing subtraction with macro variables

Bruce Weaver
Administrator

http://www.spsstools.net/Macros/MacrosVariable/ArithmeticWithMacroVariables.txt


albert_sun wrote
Hi, all:

if !LET !a=1. !LET !b=2., and you can not do sum using !LET !c=!a + !b. However, you can do it using !LET !c=!LENGTH(!CONCAT(!BLANK(!a),!BLANK(!b)).

My question is how to do subtraction /multiplication/ division with similar method?

any idea?

Thanks
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Doing subtraction with macro variables

albert_sun
Thanks. Exactly what I need.