To expand what @WarrenKuhfeld said. When SAS sees an & the compiler starts looking for macro variables. But, if it sees two of them, it replaces them with one, then continues to look for more macro variables. When it is done with the first loop of the checking, it does it again to see if there are any "new" references. So, in your case: %put &&&seg1; SAS now translates && -> & and &seg1 -> SegmentA. Now we have: %put &SegmentA; SAS now does the last translation &SegmentA -> 100. Now we have: %put 100; As we don't have any more macro variables, SAS looks at macro programs (anything with %). In this case %put. It runs that code and prints "100" to the log file.
... View more