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
 

 

sorting the records based on the second string.

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

New User


Joined: 24 Jan 2007
Posts: 4
Location: mumbai

PostPosted: Wed May 23, 2007 3:31 pm    Post subject: sorting the records based on the second string.
Reply with quote

hi ,any body can help with the logic in cobol.
a file has 4 variable length records
1. 'abc efgh'
2. 'abcd fdbh'
3. 'abcde abched'
4. 'd hbca'
i want to sort the records based on the second record using cobol
only.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed May 23, 2007 3:40 pm    Post subject:
Reply with quote

Read the file, reformatting the second string to a fixed position (unstring) and pass the reformatted record to sort.
Upon returning from sort, reverse the format back to the original and output.

If only four records, just unstring into a table and compare, outputting from lowest to highest.
Back to top
View user's profile Send private message
Raphael Bacay

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Wed May 23, 2007 3:45 pm    Post subject: Re: sorting the records based on the second string.
Reply with quote

Hello,

What does the record field layout look like?


Thanks.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed May 23, 2007 4:06 pm    Post subject:
Reply with quote

Looks pretty free-form to me.....
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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm


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