View previous topic :: View next topic
|
Author |
Message |
gmaximus
New User
Joined: 20 Oct 2006 Posts: 1 Location: india
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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"....
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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.
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.) |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Abhijit, methinks you have a devious humour about you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|