Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 71
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: 447
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: 71
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: 7312

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: 71
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 Concatenate two files of variable rec... Thiru S DFSORT/ICETOOL 3 Wed Aug 21, 2019 11:53 pm
No new posts need assistance on a sort rajiv rengasamy SYNCSORT 11 Fri Jul 26, 2019 8:19 pm
No new posts ALTERNATE RECORD KEY usage for KSDS AIX sophia.lee COBOL Programming 1 Thu Jul 25, 2019 7:28 am
This topic is locked: you cannot edit posts or make replies. Removing duplicate record based on th... Nilanjan Sikdar DFSORT/ICETOOL 4 Mon Jul 22, 2019 8:29 pm
No new posts need help with a tricky sort - Continued rajiv rengasamy SYNCSORT 8 Tue Jul 16, 2019 1:26 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us