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
 

 

Sorting with out using sort command and arrays in cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Sorting with out using sort command and arrays in cobol
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: 686
Location: Earth

PostPosted: Thu Apr 05, 2007 7:38 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Apr 05, 2007 7:41 pm    Post subject: Re: sorting
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: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 05, 2007 7:45 pm    Post subject:
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: 686
Location: Earth

PostPosted: Thu Apr 05, 2007 8:11 pm    Post subject:
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: 8593
Location: Back in jolly old England

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

Abhijit, methinks you have a devious humour about you.
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: Fri Apr 06, 2007 12:49 am    Post subject:
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    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
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am


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