When i am comparing them it is giving me 0c7 error. Here is my comparision

Code:

IF WS-LINES-PRINTED = WS-PAGE-SIZE
MOVE WS-PAGE-NO TO HD01-PAGE-NO
WRITE RPT-REC FROM HEAD-LINE-1 AFTER ADVANCING 1 LINE
WRITE RPT-REC FROM HEAD-LINE-2 AFTER ADVANCING 1 LINE
WRITE RPT-REC FROM HEAD-LINE-3 AFTER ADVANCING 1 LINE
WRITE RPT-REC FROM HEAD-LINE-4 AFTER ADVANCING 1 LINE
WRITE RPT-REC FROM HEAD-LINE-5 AFTER ADVANCING 1 LINE
WRITE RPT-REC FROM HEAD-LINE-6 AFTER ADVANCING 1 LINE
WRITE RPT-REC FROM HEAD-LINE-4 AFTER ADVANCING 1 LINE
MOVE +7 TO WS-LINES-PRINTED
DISPLAY 'HELLO IN IF'
ADD +1 TO WS-PAGE-NO
END-IF.

Just to be sure that you haven't modified the fields.. you can use a debugging tool to see the value what it is having at the time of comparison... or .. you could redefine the fields as ALPHANUMERIC and display these fields just before comparison.