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

Skipping a record from Internal SORT


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Keanehelp

New User


Joined: 27 May 2008
Posts: 71
Location: USA, CA.

PostPosted: Tue Jul 28, 2015 9:15 pm
Reply with quote

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

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Tue Jul 28, 2015 9:18 pm
Reply with quote

You can easily skip the header after read and go on to read the next record. Isn't it ?
Back to top
View user's profile Send private message
Keanehelp

New User


Joined: 27 May 2008
Posts: 71
Location: USA, CA.

PostPosted: Tue Jul 28, 2015 9:27 pm
Reply with quote

Thanks RahulG31.. icon_smile.gif 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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 28, 2015 9:31 pm
Reply with quote

Make your "PERFORM RELEASE-TO-SORT" conditional on it not being a header.
Back to top
View user's profile Send private message
Keanehelp

New User


Joined: 27 May 2008
Posts: 71
Location: USA, CA.

PostPosted: Tue Jul 28, 2015 9:34 pm
Reply with quote

I think I got it,, I need to check Release to SORT..That should help.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top