View previous topic :: View next topic
|
Author |
Message |
Keanehelp
New User
Joined: 27 May 2008 Posts: 71 Location: USA, CA.
|
|
|
|
Hi,
Assuming input file is like
HEADER
REC1
REC2
REC3
REC4
TRAILER
Program Sort this file internally, If I need to skip Header from the sorting what should I do?
Please excuse me for the naive question, I tried searching the forum but need this fix quick...
Thanks In Advance |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
You can easily skip the header after read and go on to read the next record. Isn't it ? |
|
Back to top |
|
|
Keanehelp
New User
Joined: 27 May 2008 Posts: 71 Location: USA, CA.
|
|
|
|
Thanks RahulG31.. That would have been the easiest.
But I think when internally sorting COBOL sorts entire file at once (Not sure if understanding is correct)
Flow is like below
Programs SORT like
SORT SORT-FILE
ASCENDING KEY SORT-KEY
INPUT PROCEDURE INPUT-SORT
OUTPUT PROCEDURE OUTPUT-SORT
INPUT-TO-SORT
PERFORM UNTIL END-OF-INPUT
PERFORM RELEASE-TO-SORT
PERFORM READ-INPUT
END-PERFORM
READ-INPUT
READ FILE |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Make your "PERFORM RELEASE-TO-SORT" conditional on it not being a header. |
|
Back to top |
|
|
Keanehelp
New User
Joined: 27 May 2008 Posts: 71 Location: USA, CA.
|
|
|
|
I think I got it,, I need to check Release to SORT..That should help. |
|
Back to top |
|
|
|