WRITE CAPTECH1-REC FROM WS-RECORD1 END-WRITE.
File opened in OUTPUT or EXTEND mode then we can use WRITE statement to write records into the file. If from is used then the data in WS-RECORD1 is moved to record and writing take place. If FROM is omitted then Data moved to record name will be written into file. If we are reading file we refer file name in READ statement, whereas while writing we refer record name with WRITE command.
REWRITE command is used to update a record in a file. If file is opened in I-O mode then only we can use REWRITE command on that file. This REWRITE is not available in Sequential file. Before using REWRITE command, corresponding record should be read.
Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!