condition 1
4000-FILE-REWRITE-PARA.
OPEN I-O OUT-FILE
PERFORM UNTIL FILE-STAT2 = 10
READ OUT-FILE
IF IDS OF FILE-REC2 = 1 THEN
MOVE "HIGH VALUE ." TO PRTY OF FILE-REC2
REWRITE FILE-REC2
INITIALIZE FILE-REC2
END-IF
END-PERFORM.
CLOSE OUT-FILE.
OPEN I-O OUT-FILE
PERFORM UNTIL FILE-STAT2 = 10
READ OUT-FILE
IF IDS OF FILE-REC2 = 1 THEN
MOVE "HIGH VALUE ." TO PRTY OF FILE-REC2
REWRITE FILE-REC2
INITIALIZE FILE-REC2
END-IF
END-PERFORM.
CLOSE OUT-FILE.
output in file
****** ***************************** Top of Data ****
000200 DIPAYAN UNITECH 000002
000300 AYAN TCPX 000003
000400 DIPRA TCHX 000004
000500 BAPPA GTP 000005
000510 MRINMOY UNITECH 000001HIGH VALUE .
000600 PUSHPA GTP 000006
000700 SHRUTHY BIPL 000007
000800 TINA BIPL 000008
000900 ANISH TPLS 000009
001000 RIYA TPLS 000010
****** **************************** Bottom of Data **
000200 DIPAYAN UNITECH 000002
000300 AYAN TCPX 000003
000400 DIPRA TCHX 000004
000500 BAPPA GTP 000005
000510 MRINMOY UNITECH 000001HIGH VALUE .
000600 PUSHPA GTP 000006
000700 SHRUTHY BIPL 000007
000800 TINA BIPL 000008
000900 ANISH TPLS 000009
001000 RIYA TPLS 000010
****** **************************** Bottom of Data **
condition 2
****************************************************
4000-FILE-REWRITE-PARA.
OPEN I-O OUT-FILE
PERFORM UNTIL FILE-STAT2 = 10
READ OUT-FILE
IF IDS OF FILE-REC2 = 1 THEN
MOVE "HIGH VALUE ." TO PRTY OF FILE-REC2
REWRITE FILE-REC2
END-IF
INITIALIZE FILE-REC2
END-PERFORM.
CLOSE OUT-FILE.
****************************************************
4000-FILE-REWRITE-PARA.
OPEN I-O OUT-FILE
PERFORM UNTIL FILE-STAT2 = 10
READ OUT-FILE
IF IDS OF FILE-REC2 = 1 THEN
MOVE "HIGH VALUE ." TO PRTY OF FILE-REC2
REWRITE FILE-REC2
END-IF
INITIALIZE FILE-REC2
END-PERFORM.
CLOSE OUT-FILE.
****************************************************
output in file
****** ***************************** Top of Data
000200 000000
000300 000000
000400 000000
000500 000000
000510 MRINMOY UNITECH 000001HIGH VALUE .
000600 000000
000700 000000
000800 000000
000900 000000
001000 000000
****** **************************** Bottom of Data
000200 000000
000300 000000
000400 000000
000500 000000
000510 MRINMOY UNITECH 000001HIGH VALUE .
000600 000000
000700 000000
000800 000000
000900 000000
001000 000000
****** **************************** Bottom of Data