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

Sorting with out using sort command and arrays in cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gmaximus

New User


Joined: 20 Oct 2006
Posts: 1
Location: india

PostPosted: Thu Apr 05, 2007 7:34 pm
Reply with quote

hi all,

i want to sort a sequential file and to store to another file with out using sort command and arrays in cobol.can any one give me a solution
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Thu Apr 05, 2007 7:38 pm
Reply with quote

At the top of the page there is a link to 'Search' and 'Forum Rules'.
Taking a look at em will benefit you a lot for LONG run. icon_smile.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Apr 05, 2007 7:41 pm
Reply with quote

gmaximus wrote:
i want to sort a sequential file and to store to another file with out using sort command and arrays in cobol.can any one give me a solution
When I need to do something that seems impossible like that, I usually use "smoke and mirrors".... icon_lol.gif
OK, you are in the COBOL forum so you are allowed to use COBOL?
But the only way I know to "sort" is with the SORT verb or an in-core table sort but that requires SORT and/or arrays?
What do you want, really, in detail, short sentences separated by carriage returns.....
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Apr 05, 2007 7:45 pm
Reply with quote

Why not use the SORT product installed at your site.

What better tool for sorting data could you possibly think of ?
Why the restriction for using COBOL - why not the SORT product ?

Does the cynic in me suspect a HOMEWORK question here ?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Thu Apr 05, 2007 8:11 pm
Reply with quote

1.Use DFSORT/SYNCSORT
2. Open the file is 'view' mode
type line command SORT 1 10 (OR RANGE OF CHARACTERS of sort key)
then CRE .ZF .ZL 'NEW.FILE.NAME'
(IF you dont want to type command 'sort' then create an edit macro named MAGIC and call SORT command through it. icon_lol.gif
Cobol without Array and Sort will take the hell out of you.

Expat,
It can be a good interview question...
(if you dont like person sitting in front of you.) icon_lol.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Apr 05, 2007 8:17 pm
Reply with quote

Abhijit, methinks you have a devious humour about you.
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: Fri Apr 06, 2007 12:49 am
Reply with quote

Hello gmaximus,

Just curious - where did the idea originate to cause sequencing a file using a cobol program but without using the sort or arrays?

For a rather small file it can be done, but whatever might drive such a requirement. . . .?
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 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 RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
Search our Forums:

Back to Top