6.2.34.6 GIVING Phrase
-
file-name-3,...
-
The output files.
When the GIVING phrase is specified, all the sorted records in
file-name-1 are automatically transferred to the output files
(file-name-3,...).
All output files must be described in FD entries in the Data Division.
If the output files (file-name-3,...) contain variable-length records,
the size of the records contained in file-name-1 must not be less than
the smallest record nor greater than the largest record described for
the output files. If the output files contain fixed-length records,
the size of the records contained in file-name-1 must not be greater
than the largest record described for the output files. For more
information, see the IBM COBOL Programming Guide for your platform.
At the time the SORT statement is executed, the output files
(file-name-3,...) must not be open. For each of the output files, the
execution of the SORT statement causes the following actions to be
taken:
- The processing of the file is initiated. The initiation is
performed as if an OPEN statement with the OUTPUT phrase had been
executed.
- The sorted logical records are returned and written onto the file.
Each record is written as if a WRITE statement without any
optional phrases had been executed.
For a relative file, the relative key data item for the first
record returned contains the value '1'; for the second record
returned, the value '2', etc.. After execution of the SORT
statement, the content of the relative key data item indicates the
last record returned to the file.
- The processing of the file is terminated. The termination is
performed as if a CLOSE statement without optional phrases had
been executed.
These implicit functions are performed such that any associated USE
AFTER EXCEPTION/ERROR procedures are executed; however, the execution
of such a USE procedure must not cause the execution of any statement
manipulating the file referenced by, or accessing the record area
associated with, file-name-3. On the first attempt to write beyond
the externally defined boundaries of the file, any USE AFTER STANDARD
EXCEPTION/ERROR procedure specified for the file is executed. If
control is returned from that USE procedure or if no such USE
procedure is specified, the processing of the file is terminated.
© Copyright IBM Corp. 1991, 1998
IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.
Return to library:
z/OS |
z/OS.e |
TPF |
z/VSE |
z/VM |
IBM Hardware |
IBM System z Redbooks
Glossary:
IBM terminology
Publications:
How to order publications
Readers:
Download IBM Library Reader |
Download IBM Softcopy Reader |
Download Adobe® Acrobat® Reader®
Library management:
Download IBM Softcopy Librarian
Contacts:
Contact z/OS
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks
of Adobe Systems incorporated.