Using the Compare function in SAS for comparing strings
The COMPARE function in SAS lets you compare two-character values and with optionally available modifiers, you’ll be able to ignore cases and truncate a longer value to the length of a shorter value before making the comparison.