Using the merge technique is an excellent way to simulate leads, although you can't successfully use a BY statement linked to the MERGE.

But you can continue to enjoy the benefits of last.group and first.group through use of a BY statement associated with a separate SET. Just make sure to use a "keep=" option limited to the needed by variable(s):
SET example3 (keep=group);
by group;