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
 

 

Sort using Cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
arthiv

New User


Joined: 15 Jul 2005
Posts: 2

PostPosted: Mon Jul 18, 2005 4:48 pm    Post subject: Sort using Cobol
Reply with quote

CAN u please tell me how to write a program in cobol to sort a file.
Back to top
View user's profile Send private message

parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Mon Jul 18, 2005 5:35 pm    Post subject: Re: Sort using Cobol
Reply with quote

Well,

cobol has inbuilt facility to sort fles

Example syntax can be as follows:

SORT WORK-FILE ON ASCENDING KEY DATA-NAME1
DESCENDING KEY DATA-NAME2
USING INPUTFILE GIVING OUTPUTFILE.

Where WORK-FILE is the file defined using SD entry.
INPUTFILE is the input unsorted file which remains unchanged after sorting, and OUTPUTFILE is the final sorted file.

you can sort the file on ascending or descending keys for even more than one key.

Please search the forum for detailed answers. I am sure there will be a number of posts regarding this.
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 -> JCL & VSAM 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 change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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