The OPEN statement initiates the processing of files. It also checks and/or writes labels.
___ Format 1--Sequential Files _________________________________________ | | | >>__OPEN_____________________________________________________________> | | | | <________________________________________________________ | | <_________________________________________ | | | >____ _INPUT____file-name-1__ ________________________ _|_ _|_______>< | | | | (1) | | | | | |_REVERSED_______________| | | | | | (1)| | | | | |_ ______ __NO REWIND____| | | | | |_WITH_| | | | | <______________________________________ | | | |_OUTPUT____file-name-2__ _____________________ _|___| | | | |_ ______ __NO REWIND_| | | | | |_WITH_| | | | | <_____________ | | | |_I-O____file-name-3_|_______________________________| | | | <_____________ | | | |_EXTEND____file-name-4_|____________________________| | | | | Note: | | (1) Under OS/390, the REVERSED and WITH NO REWIND phrases are not | | valid for VSAM files. Under AIX, OS/2, and Windows, the REVERSED | | and WITH NO REWIND phases are treated as a comment. | | | |________________________________________________________________________|
___ Format 2--Indexed and Relative Files _______________________________ | | | <_____________________________ | | <_____________ | | | >>__OPEN____ _INPUT____file-name-1_|__ _|___________________________>< | | | <_____________ | | | |_OUTPUT____file-name-2_|_| | | | <_____________ | | | |_I-O____file-name-3_|____| | | | <_____________ | | | |_EXTEND____file-name-4_|_| | | | |________________________________________________________________________|
X ___ Format 3--Line Sequential Files (Workstation Only) _________________ X | | X | <_____________________________ | X | <_____________ | | X | >>__OPEN____ _INPUT____file-name-1_|__ _|___________________________>< | X | | <_____________ | | X | |_OUTPUT____file-name-2_|_| | X | | <_____________ | | X | |_EXTEND____file-name-4_|_| | | | |________________________________________________________________________|At least one of the phrases, INPUT, OUTPUT, I-O, or EXTEND, must be specified with the OPEN key word. The INPUT, OUTPUT, I-O, and EXTEND phrases can appear in any order.
Note: Do not specify OUTPUT for files that:
The EXTEND phrase is only allowed for sequential access files if the
Under OS/390, for QSAM files, do not specify the EXTEND phrase for a multiple file reel.
If you want to append to a file, but are unsure if the file exists, use the SELECT OPTIONAL clause before OPENing the file in EXTEND mode. The file will be created or appended to, depending on whether the file exists.
If the concept of reels has no meaning for the storage medium (for example, a direct access device), the REVERSED and NO REWIND phrases do not apply. <_Host_<
>_Workstation_> Under AIX, OS/2, and Windows, the REVERSED phrase is treated as a comment. <_Workstation_<
>_Workstation_> Under AIX, OS/2, and Windows, the NO REWIND phrase is treated as a comment. <_Workstation_<
Subtopics:
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.