Your code compares TRTP to "A", but if TRTP is formatted, it may have underlying values different than what you see.
Any such comparison
if TRTP eq "A"
uses the unformatted values, not the formatted values. So the comparison would fail, even if it LOOKS LIKE your variable TRTP has value "A".
So just to make up an example, if the format $TRT1. is something like this:
proc format;
value $trt "A","B","Q","T"="A";
run;
Then the comparison you would want to do is
if TRTP in ("A","B","Q","T")
--
Paige Miller