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
 
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 Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am

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