After rewriting we could able to see the updated record...
Not really. . . What was displayed was something in memory, not on dasd.
Where is the file read? If there is no read, there can be no rewrite. . .
Where is the file-status? You haven't checked that the open or the rewrite were successful. . . They probably weren't. . .
Suggest you change the program to read one file and write another. Most organizations will not allow updating a sequential file "in place". If there is a problem in the middle of a run, the input has been corrupted. . .