discreteattrmap would work beautifully if the assigned sizes would map onto the variables when using the group=attrvar: proc template; define…