IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort using Cobol


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top