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
 

 

need the logic to sort an array table in cobol(internal so

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

New User


Joined: 04 Dec 2007
Posts: 3
Location: pune

PostPosted: Thu Feb 14, 2008 9:05 am    Post subject: need the logic to sort an array table in cobol(internal so
Reply with quote

Hi frnds,
Can any one help me on this .

I have a array table fields are name ,age, data of joining.
First i need to sort the data by name,if the name has came duplicates,then sort on age ,in the ascending order.
Could you please help me on this .

Thanks,
Hanuma
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Feb 14, 2008 9:22 am    Post subject:
Reply with quote

Hello Hanuma and welcome to the forums,

An easy to load an array in some sequence is to read the external records containing the data, SORT the records (RELEASE) on the needed fields in the COBOL program, and RETURN the sorted values into the code and move the data into the array.

If you are not familiar with using the SORT inside a COBOL program, you can find the info in the COBOl documentation available via the "Manuals" link at the top of the page.
Back to top
View user's profile Send private message
hanuma
Currently Banned

New User


Joined: 04 Dec 2007
Posts: 3
Location: pune

PostPosted: Mon Feb 18, 2008 2:50 pm    Post subject: Reply to: need the logic to sort an array table in cobol(i
Reply with quote

Hi dck,

I need the sort logic, the data is not coming from the file .
The data is already in the table. i am not using any files.
Directly i need to sort the array table deta.First field is name if two name s came equal then i need to sort the data on age field.
I reffered the manuals also as you suggestaed,I am not able to find out the logic.

Could you please help me out on this.

correct me if i am wrong.

Thanks,
Hanuma.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon Feb 18, 2008 4:07 pm    Post subject:
Reply with quote

Hanuma,

Did you forgot you posted the same topic earlier and also you dint say what Dick had asked for?

http://www.ibmmainframes.com/viewtopic.php?t=28347&highlight=array

Also search the forum as this was discussed earlier.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 18, 2008 5:06 pm    Post subject:
Reply with quote

Quote:
The data is already in the table. i am not using any files.

Huh ?

I can only assume that you might be refering to using a DB2 (or other product) table here. Or are you really saying that the table is coded in the program source ?
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Fri Feb 22, 2008 10:57 pm    Post subject: Reply to: need the logic to sort an array table in cobol(i
Reply with quote

I posted copybooks awhile back that do a sort. Search the forum.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sat Feb 23, 2008 2:57 am    Post subject: Re: Reply to: need the logic to sort an array table in cob
Reply with quote

TG Murphy wrote:
I posted copybooks awhile back that do a sort. Search the forum.
And here is the link for that copybook...
Back to top
View user's profile Send private message
hanuma
Currently Banned

New User


Joined: 04 Dec 2007
Posts: 3
Location: pune

PostPosted: Mon Feb 25, 2008 2:40 pm    Post subject: Reply to: need the logic to sort an array table in cobol(i
Reply with quote

Hi anuj,

Thanks for reply...

I got the solution for this..

Regards,
Hanumaiah.G
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Feb 26, 2008 6:59 am    Post subject:
Reply with quote

Hi,

You are welcome, but I didn't help You much in solving Your problem. If possible, can You please share Your solution with us, so that if later some one search for similar kind of problem can get a solution rightaway.
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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


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