Posts

Showing posts with the label Multiple ampersands

Resolving and Using &&var&i Macro Variables

Here are the 2 important questions always comes up in our minds ,(& vs && vs &&& and single dot and double dots ) when we are dealing with macros for the first time and here are the answers for them. I did find a very good regarding the above topics in the one of the SAS forums and IAN WHITLOCK explained it very clear. direct link : or when to use &,&&,and &&&,how do we distinguish? &MACVAR references a macro variable. The rule is that the scanner reads from left to right. Two ampersands resolve to one and scanner continues. If the resulting expression has ampersands then that expression is scanned again. So &&x resolves to &x resolves to value of X &&&x resolves to & followed by the value of X which then resolves to the value of the variable indicated. If you are familiar with TSO CLISTS (even if you are not), they are very similar to SAS macro. SAS was originally based on PL1, so both SAS syntax an...