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

Internal Sorting of File using COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 14, 2009 4:21 pm
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
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

Moderator Emeritus


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

PostPosted: Tue Jul 14, 2009 8:35 pm
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
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

Moderator Emeritus


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

PostPosted: Wed Jul 15, 2009 10:02 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
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
Search our Forums:

Back to Top