You've been around long enough to know you should use the Code tags.
REPEAT works for each record in the OUTFIL group. The value cannot be changed.
You can use the slash-operator (/) with multiple IFTHEN=(WHEN=(logicalexpression). If you have lots of possible differences, then you can generate the code. If your differences may be huge, then you'll probably run out of space for the control cards and have to use a more general-purpose programming language (which is also possible right from the start).