IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Regarding RETURN COmmand


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bobbys

New User


Joined: 13 Oct 2005
Posts: 2
Location: hyderabad

PostPosted: Tue Nov 15, 2005 7:34 pm
Reply with quote

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
View user's profile Send private message
Lkmi

New User


Joined: 04 Mar 2005
Posts: 53
Location: Newyork

PostPosted: Tue Nov 15, 2005 10:28 pm
Reply with quote

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
View user's profile Send private message
Lkmi

New User


Joined: 04 Mar 2005
Posts: 53
Location: Newyork

PostPosted: Tue Nov 15, 2005 10:29 pm
Reply with quote

check out the COBOL for OS/390 & VM Programming Guide Version 2 Release 2 for more details
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Nov 16, 2005 7:25 am
Reply with quote

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. icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
Search our Forums:

Back to Top