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 Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


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