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
 

 

Internal Sorting of File using COBOL

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

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Tue Jul 14, 2009 4:00 pm    Post subject: Internal Sorting of File using COBOL
Reply with quote

Hi,

I am having one enquiry. Can we sort more than one file in a COBOL program using the same SORTWORK space?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Tue Jul 14, 2009 4:21 pm    Post subject:
Reply with quote

What does the manual (link at the top of the page) tell you?
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Tue Jul 14, 2009 4:46 pm    Post subject:
Reply with quote

Actually I am facing a problem...

I am having a LIST file that has number of file names written in the same. These files have unsorted data and my aim is to sort the records present in these input files.

I am currently dynamically allocating the input file as well as the output file with in the cobol program. The program is sorting as well as writing the first file properly.

But when I am trying to sort the next files, the SORTWORK variable is still having the last record of the previous file and thus I am unable to proceed with the sorting and the remaining files that are generated are having no records.

I have initialized the SORTWORK as well as WORKING STORAGE variables but this was of no help...

Can any one please let me know, where m i going wrong..
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: Tue Jul 14, 2009 8:35 pm    Post subject:
Reply with quote

Hello,

Quote:
I have initialized the SORTWORK as well as WORKING STORAGE variables but this was of no help...
How does one initialize sortwk?

Quote:
the SORTWORK variable is still having the last record of the previous file
What is "the SORTWORK variable"? This is not a familiar term to me. Please clarify.

An SD can be sorted multiple times in the same program. . . (or could be long ago icon_smile.gif ). I expect it still can.
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Wed Jul 15, 2009 9:46 am    Post subject:
Reply with quote

Hi Dick,

We were able to perform the sort.. We were going wrong in one aspect... The flag that was set after performing the sort was not initialized... So we were having the problem...

Thanks to all of you who were bothered...
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: Wed Jul 15, 2009 10:02 am    Post subject: Reply to: Internal Sorting of File using COBOL
Reply with quote

Good to hear it is working - thanks for letting us know icon_smile.gif

d
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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