Some initial desk-checking with the addition of SAS statement would likely have been revealing about the "macro language compile logic" being used incorrectly: OPTIONS MACROGEN SYMBOLGEN MLOGIC MPRINT; This will raise evidence that the %IF / %THEN logic is not appropriate and instead must be DATA step language IF / THEN logic. As well, adding PUTLOG _ALL_; statements at points in the code-processing would have also been revealing.
... View more