It sounds like you have a few misconceptions. Consider these basic concepts.
Both KON and UTB have a length of 8 characters. That's the default length assigned for the style of INPUT statement that you are using.
When you refer to a variable, trailing blanks don't matter. These statements always find the same matches:
if utb='GY' then do;
if utb='GY ' then do;
When SAS detects that it is comparing character strings that have different lengths, it automatically pads the shorter string with blanks to make the lengths equal. (That is, for purposes of making the comparison ... it is not actually changing the values of any variables.)
Does that change the questions that you want to ask?
... View more