The answer to your question is yes, this is the way to do it.
you defined your areas as PIC A(5). As such, they can contain only alphabetic characters or spaces (no numbers).
Most programmers would use PIC X(5) which allows more freedom.
The dot (.) before the ELSE should be removed.
Personnaly, I prefer to use END-IF over a final dot.
Very Important: Use indentation. Like this you can immediately see where the IF ends, when the ELSE starts and so on...
IF A = B THEN
MOVE SPACES TO B
MOVE A TO B