This features is already supported. As you have alluded to above, using CURVELABEL=GRP option on the SGPLOT SERIES statement will…