Thanks all for your input. I've not explored macro functions in as much depth as I should have. Once i've seen how to do it it seems obvious: if you want a sas macro that performs calculations but only outputs the results of those calculations, you need to be using macro functions rather than performing the calculations in base SAS code.
... View more