You cannot check a COMP variable for spaces, period. This is because of the definition of a COMP variable -- EVERY POSSIBLE VALUE IS VALID FOR A COMP VARIABLE. If you have a PIC S9(04) COMP variable, and it has X'4040' in it -- the value is 4 times 4096 plus 4 times 16 or 16448. It may LOOK like spaces in a memory dump, but the value is actually 16448, because that's the way COMP variables work.