Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums 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: 7314

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 how to add date & timestamp to th... dharmaraok DFSORT/ICETOOL 5 Thu Apr 18, 2019 2:45 pm
No new posts files whose record count varies with ... janmejay CA Products 0 Fri Mar 08, 2019 9:35 pm
No new posts Sort skiprec imagines DFSORT/ICETOOL 7 Thu Feb 28, 2019 1:30 am
No new posts How to convert hex to Displayable for... Log Thangavel DFSORT/ICETOOL 11 Fri Feb 22, 2019 9:33 am
No new posts Build SQL query using SORT balaji81_k DFSORT/ICETOOL 15 Mon Feb 18, 2019 9:56 am

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