The WRITE statement releases a logical record for an output or input/output file.
When the WRITE statement is executed:
___ Format 1--Sequential Files ___________________________________________________________________ | | | >>__WRITE__record-name-1__ _______________________ ____________________________________________> | | | (1)| | | |_FROM__identifier-1____| | | | | >__ _ ____________________________________________________________ __| phrase 1 |_ ____________> | | | |_ _BEFORE_ __ ___________ __ _ _identifier-2_ __ _______ _ _| | | | | |_AFTER__| |_ADVANCING_| | |_integer-1____| |_LINE__| | | | | | | |_LINES_| | | | | | |_mnemonic-name-1_____________| | | | | |_PAGE________________________| | | | |_| invalid_key |__| not_invalid_key |_________________________________________| | | | | >__ ___________ ______________________________________________________________________________>< | | |_END-WRITE_| | | | | phrase 1: | | |__ _________________________________________________ _________________________________________> | | |_ ____ __ _END-OF-PAGE_ __imperative-statement-3_| | | |_AT_| |_EOP_________| | | | | >__ ______________________________________________________ ____________________________________| | | |_NOT__ ____ __ _END-OF-PAGE_ __imperative-statement-4_| | | |_AT_| |_EOP_________| | | | | invalid_key: | | |__ ________________________________________________ __________________________________________| | | |_ INVALID __ _______ __ imperative-statement-1 _| | | |_ KEY _| | | | | not_invalid_key : | | |__ ____________________________________________________ ______________________________________| | | |_ NOT INVALID __ _______ __ imperative-statement-2 _| | | |_ KEY _| | | | | Note: | | (1) The BEFORE, AFTER, INVALID KEY, and AT END OF PAGE phrases are not valid for STL files, | | OS/390 and VM VSAM files, or OS/2 Btrieve files. | | | |__________________________________________________________________________________________________|
___ Format 2--Indexed and Relative Files _______________________________ | | | >>__WRITE__record-name-1__ ____________________ _____________________> | | |_FROM__identifier-1_| | | | | >__ __________________________________________ ______________________> | | |_INVALID__ _____ __imperative-statement-1_| | | |_KEY_| | | | | >__ ______________________________________________ __________________> | | |_NOT INVALID__ _____ __imperative-statement-2_| | | |_KEY_| | | | | >__ ___________ ____________________________________________________>< | | |_END-WRITE_| | | | |________________________________________________________________________|
___________________________________________________________________________ X | | X | >>__WRITE__record-name-1__ ____________________ ________________________> | X | |_FROM__identifier-1_| | | | X | >____ ___________________________________________________________ ______> | X | |___AFTER____ ___________ __ _ _identifier-2_ __ _______ _ _| | X | |_ADVANCING_| | |_integer-1____| |_LINE__| | | X | | |_LINES_| | | X | |_PAGE________________________| | | | X | >__ ___________ _______________________________________________________>< | X | |_END-WRITE_| | | | |___________________________________________________________________________|
MOVE identifier-1 TO record-name-1. WRITE record-name-1.The MOVE is performed according to the rules for the MOVE statement without the CORRESPONDING phrase.
After the WRITE statement is executed, the information is still available in identifier-1. (See "INTO/FROM Identifier Phrase" under "Common Processing Facilities" in topic 6.1.8.9.)
Subtopics:
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.