Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Skipping a record from Internal SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Keanehelp

New User


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

PostPosted: Tue Jul 28, 2015 9:15 pm    Post subject: Skipping a record from Internal SORT
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: 331
Location: USA

PostPosted: Tue Jul 28, 2015 9:18 pm    Post subject: Reply to: Skipping a record from Internal SORT
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: 70
Location: USA, CA.

PostPosted: Tue Jul 28, 2015 9:27 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Jul 28, 2015 9:31 pm    Post subject: Reply to: Skipping a record from Internal SORT
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: 70
Location: USA, CA.

PostPosted: Tue Jul 28, 2015 9:34 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us