View previous topic :: View next topic
|
Author |
Message |
bobbys
New User
Joined: 13 Oct 2005 Posts: 2 Location: hyderabad
|
|
|
|
hi ,
RETURN SORT-EXTR-FILE
AT END MOVE 1 TO SORT-EOF-SW.
Can you please explain how the above command works.
in the above command SORT-EXTR-FILE is the work file.
THanks,
bobby |
|
Back to top |
|
|
Lkmi
New User
Joined: 04 Mar 2005 Posts: 53 Location: Newyork
|
|
|
|
If you want to select, edit, or otherwise change sorted records before writing them
from the sort work file into another file, use the OUTPUT PROCEDURE phrase of the
SORT statement.
Each output procedure must be contained in either a section or a paragraph. An
output procedure must include both of the following elements:
v At least one RETURN or RETURN INTO statement
v Any statements necessary to process the records that are made available, one at
a time, by the RETURN statement
Chapter 11. Sorting and merging files 173
The RETURN statement makes each sorted record available to your output
procedure. (The RETURN statement for a sort file is similar to a READ statement for an
input file.)
You can use the AT END and END-RETURN phrases with the RETURN statement. The
imperative statements on the AT END phrase are performed after all the records
have been returned from the sort file. The END-RETURN explicit scope terminator
delimits the scope of the RETURN statement.
If you use the RETURN INTO statement instead of RETURN, your records will be
returned to WORKING-STORAGE or to an output area.
Coding considerations when using DFSORT |
|
Back to top |
|
|
Lkmi
New User
Joined: 04 Mar 2005 Posts: 53 Location: Newyork
|
|
|
|
check out the COBOL for OS/390 & VM Programming Guide Version 2 Release 2 for more details |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
One other point about RETURN. You RELEASE the file-name and RETURN the record-name.
It's similar to READ the file-name and WRITE the record-name.
It's a minor point, but the compiler gets snippy about it. |
|
Back to top |
|
|
|