OpenCOBOL Forum Index OpenCOBOL
implementation of ocsort | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| Angus | Posted on: 2010/2/15 22:21 |
Not too shy to talk ![]() ![]() Joined: 2009/12/1 From: Posts: 24 |
implementation of ocsort Hi
Proud to present an implementation of ocsort Here a light presentation : OCSort 0.0.1 OCSort is an open source sort tool, which implement a subset of the functionnality of the Microfocus(c) MFSORT(c) utility. This program is distributed under the GNU General Public License. See COPYING for details. Functionnality supported : SORT FIELDS (only CH and BI type of field) INCLUDE COND OMIT COND USE (multiple file, and only sequential fixed record length) GIVE (just one file, and only sequential fixed record length) OUTREC FIELDS (not everythin) SUM FIELDS Source can be found here : http://www.add1tocobol.com/tiki-download_file.php?fileId=74 Regards, Angus |
| btiffin | Posted on: 2010/2/16 0:31 |
Home away from home ![]() ![]() Joined: 2008/6/7 From: CANADA Posts: 737 |
Re: implementation of ocsort Angus;
Thanks, compiled clean here. Umm, need to beg favours now though. Do you have a short usage example? For those of us denied MFSORT experience? And, I'd like to tech chat on your .l and .y source code. As the Pakleds explained in STNG, "We want your computer things", "We like things that make us go" ;) Cheers, Brian |
| Angus | Posted on: 2010/2/16 10:35 |
Not too shy to talk ![]() ![]() Joined: 2009/12/1 From: Posts: 24 |
Re: implementation of ocsort MfSort is microfocus clone of IBM ICEMAN (on MVS).
This is a sample : ocsort sort fields"(1,5,CH,A,11,4,CH,A)" use inputfile record f,391 org sq give outputfile org sq This will sort the file "inputfile", a fixed length file (391 byte each record, organization sequential), and create a file "outputfile" sorted (which is of the same type). The sort fields are : (start, length, type, direction) => start=1 => length=5 => type = character (you can sort on comp3 fields, but ocsort don't handle it) => direction = ascending (or descending) It's like an order by. The omit/include condition allow to remove record from the file (ex if character number 5 of this record is 'F', omit the record). You can use and, or, greater than...) I'm not an expert as using bison / flex (gnu tools to parse grammar language, opencobol use it to parse the cobol), but i will be happy to chat with you. I don't understand the end of the sentence Angus |
| btiffin | Posted on: 2010/2/17 5:26 |
Home away from home ![]() ![]() Joined: 2008/6/7 From: CANADA Posts: 737 |
Re: implementation of ocsort "end of the sentence" That was me being funny? It's from an episode of Star Trek the Next Generation, Pakleds are thugs, acting helpless then snagging technology. I've always used "We want your computer things" as a praise when first-person, and a derogatory in third person. It was praise here.
![]() And yeah, I was curious about your Flex and Bison skills, as OpenCOBOL may be able to leverage that expertise, (as good Pakleds would). I put a fair whack of REPORT SECTION parsing into cobc/parser.y but there are a few places that need, umm, bigger better logic. ;) Have you had a chance to look through the cobc source code? I hope to pull off something like http://opencobol.add1tocobol.com/docs/cobc.html for the full tarball as a favour to Roger some day. Ahh, someday. And thanks for the how-to on ocsort, time to play. Where verify.cob is When verify.cob was changed to ASSIGN "inputfile" it output about 49,000 out of orders, in paired lines, so the sort did some work on the random file. Need to run more tests, but this seems like a nice little engine Angus, 100 thousand records in 0.8 on my little P4. Cheers, Brian |
| Angus | Posted on: 2010/2/17 8:17 |
Not too shy to talk ![]() ![]() Joined: 2009/12/1 From: Posts: 24 |
Re: implementation of ocsort For the sort, this is the qsort function of the libc which do the job. It loads the entire file in ram, but ram is cheaper now.
I will look in the cobc source, but i like you to said me what is wrong... For the Star Trek Next Generation. , i'm a big fan (have & see all the episodes). I remember this episode, when alien try to kidnap Jordi Laforge, to repair these old ship. But i don't see it in VO... Regards, Angus |
| btiffin | Posted on: 2010/2/26 4:01 |
Home away from home ![]() ![]() Joined: 2008/6/7 From: CANADA Posts: 737 |
Re: implementation of ocsort Angus;
I referenced your sorter in the FAQ. Now I realize I didn't really ask how you felt about that. Feel free to tell me to change/update the entry. I was thinking about maybe creating an ocsort Pygments syntax highlighter, and throwing in a few more samples. Cheers, Brian |
| Angus | Posted on: 2010/2/26 8:38 |
Not too shy to talk ![]() ![]() Joined: 2009/12/1 From: Posts: 24 |
Re: implementation of ocsort Hi
I have no problem with that. But this is just a proposal. A beta version. I had in mind "Release early, release often". Perhaps rewrite the parser code should be done (remarks are welcomed) Regards, Angus |
| btiffin | Posted on: 2010/2/27 5:15 |
Home away from home ![]() ![]() Joined: 2008/6/7 From: CANADA Posts: 737 |
Re: implementation of ocsort Angus; thanks for the proposal. :)
A few of us from add1tocobol.com discussed this very thing a while back; a sorter/filter/file manip thingy. This is more than a perfect start. On the next FAQ update I'll make sure to date the entry and put in a beta stamp (for now). Cheers, Brian |
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |








