Code Comments
Programming Forum and web based access to our favorite programming groups.<docdwarf@panix.com> wrote in message news:dj1h87$aih$1@reader2.panix.com... > In article <qiX4f.62491$K91.29552@twister.nyroc.rr.com>, > Christine Frayda <cfrayda@rochester.rr.com> wrote: > > [snip] > > > It's usually much faster if someone else does your homework for you, sure! > > DD And thanks to the group for the help with my homework! (I don't get paid for this, afterall.) Please take all of your sharp wits to the web page to critique our work. -- Constructive criticism will be accepted most quickly. :) http://en.wikibooks.org/wiki/ Softw...y:COBOL It is a wiki, so you are welcome to fix problems in place too, Chris
Post Follow-up to this messageChristine Frayda wrote: > <docdwarf@panix.com> wrote in message news:dj1h87$aih$1@reader2.panix.com. . > > > > And thanks to the group for the help with my homework! (I don't get paid > for this, afterall.) > > Please take all of your sharp wits to the web page to critique our work. - - > Constructive criticism will be accepted most quickly. :) > http://en.wikibooks.org/wiki/ Softw...y:COB OL > > It is a wiki, so you are welcome to fix problems in place too, > Chris HA! Most of the items on that page come from me, in a private email to Christine Frayda. Since I know next to nothing about object-oriented programming, or C++ for that matter, and my point of view might be rather limited, it would probably be a very good thing for some other COBOL programmers to jump in and correct my flippant comments. And possibly correct my examples, which were written very hastily without any kind of syntax checking. We wouldn't want our favorite programming language to be misrepresented in the Wiki world, would we? With kindest regards, -- http://arnold.trembley.home.att.net/
Post Follow-up to this messageArnold Trembley wrote: > > HA! Most of the items on that page come from me, in a private email to > Christine Frayda. Since I know next to nothing about object-oriented > programming, or C++ for that matter, and my point of view might be > rather limited, it would probably be a very good thing for some other > COBOL programmers to jump in and correct my flippant comments. And > possibly correct my examples, which were written very hastily without > any kind of syntax checking. > > We wouldn't want our favorite programming language to be misrepresented > in the Wiki world, would we? > Well Arnold, a valiant initial attempt at OO - BUT........, there's just so damn much to cover. I've never checked, perhaps Bill or Chuck have - but I doubt that OO has added more than 20 - 30 RESERVED WORDS to COBOL, including extensions like :- Procedural - set ContinueProgram to true OO - set ThisNewObject to thisOldObject *> you can't MOVE objects In my judgment, OO COBOL is more about a Conceptual approach, using a combination of the OO RESERVED WORDS above. Not that it's put forward as an idea, but I'm a strong advocate of REUSE associated with polymorphism. (E.g. work out the general logic to retrieve different elements in a collection, and with minor twiddling, the methods can be applied to any other collection, be they collections of customers, fruits, cheeses, car parts or whatever). There I go - both F/J and M/F have collections, which as yet are not part of the J4 OO Standard ! If you think on it - why bother with a 'newie' like OO unless it's going to give you some program development advantages. On the minus side - design-wise you have got to figure out your support classes in advance, which takes time when you are new to the topic - but when you get there you quickly avoid the onerous task of having to think how to handle, files, their file-status errors, SQL Tables and their SQLSTATE/ERRORs, GUIs the Web, or whatever - you have these as a set of 'canned' or 'template' classes which then draw as necessary on utility classes provided by the COBOL vendor. My 'utility' classes never go wrong, but they can hiccup because of the messages, (parameters) I send to them - and that's no different to Procedural:- CALL Program2 using a, c, d when Program2 is anticipating receiving a,b,c,d and returning e (not mentioned above) No. Be much braver if I sat down and tried my hand at writing a book on OO COBOL ! Then like Thane, once a month I could take my wife out to a burger-joint on the royalties :-) Jimmy
Post Follow-up to this messageOn Tue, 25 Oct 2005 03:38:18 GMT, "James J. Gavan" <jgavandeletethis@shaw.ca> wrote: >No. Be much braver if I sat down and tried my hand at writing a book on >OO COBOL ! Then like Thane, once a month I could take my wife out to a >burger-joint on the royalties :-) I didn't know Thane knew your wife.
Post Follow-up to this message"James J. Gavan" <jgavandeletethis@shaw.ca> wrote in message news:KMh7f.287612$oW2.107047@pd7tw1no... > Well Arnold, a valiant initial attempt at OO - BUT........, there's just > so damn much to cover. I've never checked, perhaps Bill or Chuck have - > but I doubt that OO has added more than 20 - 30 RESERVED WORDS to COBOL, > including extensions like :- ... I just went through the reserved word lists for the '85 and '02 standards. The '02 standard *adds* ADDRESS, ALIGNED, ALLOCATE, ANYCASE, AS, B-AND, B-NOT, B-OR, B-XOR, BASED, BINARY-CHAR, BINARY-DOUBLE, BINARY-LONG, BINARY-SHORT, BIT, BOOLEAN, CLASS-ID, COL, COLS, COLUMNS, CONDITION,CONSTANT, CRT, CURSOR, DATA-POINTER, DEFAULT, EC, END-ACCEPT, END-DISPLAY, EO, EXCEPTION-OBJECT, FACTORY, FLOAT-EXTENDED, FLOAT-LONG, FLOAT-SHORT, FORMAT, FREE, FUNCTION, FUNCTION-ID, GET, GOBACK, GROUP-USAGE, INHERITS, INTERFACE, INTERFACE-ID, INVOKE, LOCAL-STORAGE, LOCALE, METHOD, METHOD-ID, MINUS, NATIONAL, NATIONAL-EDITED, NESTED, NULL, OBJECT, OBJECT-REFERENCE, OPTIONS, OVERRIDE, PRESENT, PROGRAM-POINTER, PROPERTY, PROTOTYPE, RAISE, RAISING, RESUME, RETRY, RETURNING, SCREEN, SELF, SHARING, SOURCES, SUPER, SYSTEM-DEFAULT, TYPEDEF, UNIVERSAL, UNLOCK, USER-DEFAULT, VAL-STATUS, VALID, VALIDATE, VALIDATE-STATUS, the operators "&" (concatenation) and "::" (method invocation), the floating comment indicator "*>", and the compiler directive indicator ">>". By my count that's a total of 87 new entries in the reserved word list in the '02 standard. The '02 standard *drops* ALTER, AUTHOR, CLOCK-UNITS, COBOL (!), DATE-COMPILED, DATE-WRITTEN, DEBUG-CONTENTS, DEBUG-ITEM, DEBUG-LINE, DEBUG-NAME, DEBUG-SUB-1, DEBUG-SUB-2, DEBUG-SUB-3, ENTER, EVERY, INSTALLATION, LABEL, MEMORY, MODULES, MULTIPLE, POSITION, PROCEDURES, PROCEED, REFERENCES, RERUN, SECURITY, SEGMENT-LIMIT, TAPE, and WORDS for a total of 29 entries that have been deleted from the reserved word list as it was in the '85 standard. I leave it as an exercize for the reader to figure out which of the new reserved words are properly characterized as directly supporting OO. > Procedural - set ContinueProgram to true > > OO - set ThisNewObject to thisOldObject *> you can't MOVE objects Ah, but SET is hardly a new reserved word. <<There I go - both F/J and M/F have collections, which as yet are not part of the J4 OO Standard !>> It is expected that the Collection Class Library proposal (currently WDTR 24717; the most recent update is J4/05-0214, available on www.cobolportal.com/j4/), will, after a few further minor editorial tweaks, be submitted as a DTR for international ballot Real Soon Now, and if the national standards bodies agree, it will apply to the '02 standard. WG4 has also requested that this TR along with the also-still-being-refined Native COBOL Syntax for XML processing TR are to be "folded into" the draft for the 2008 revision to the standard when they've passed their DTR process. The Finalizer TR, which has already been approved, is also to be incorporated into the draft. -Chuck Stevens
Post Follow-up to this messageChuck Stevens wrote: > "James J. Gavan" <jgavandeletethis@shaw.ca> wrote in message > news:KMh7f.287612$oW2.107047@pd7tw1no... > > > > > I just went through the reserved word lists for the '85 and '02 standards. > > The '02 standard *adds* ADDRESS, ALIGNED, ALLOCATE, ANYCASE, AS, B-AND, > B-NOT, B-OR, B-XOR, BASED, BINARY-CHAR, BINARY-DOUBLE, BINARY-LONG, > BINARY-SHORT, BIT, BOOLEAN, CLASS-ID, COL, COLS, COLUMNS, > CONDITION,CONSTANT, CRT, CURSOR, DATA-POINTER, DEFAULT, EC, END-ACCEPT, > END-DISPLAY, EO, EXCEPTION-OBJECT, FACTORY, FLOAT-EXTENDED, FLOAT-LONG, > FLOAT-SHORT, FORMAT, FREE, FUNCTION, FUNCTION-ID, GET, GOBACK, GROUP-USAGE , > INHERITS, INTERFACE, INTERFACE-ID, INVOKE, LOCAL-STORAGE, LOCALE, METHOD, > METHOD-ID, MINUS, NATIONAL, NATIONAL-EDITED, NESTED, NULL, OBJECT, > OBJECT-REFERENCE, OPTIONS, OVERRIDE, PRESENT, PROGRAM-POINTER, PROPERTY, > PROTOTYPE, RAISE, RAISING, RESUME, RETRY, RETURNING, SCREEN, SELF, SHARING , > SOURCES, SUPER, SYSTEM-DEFAULT, TYPEDEF, UNIVERSAL, UNLOCK, > USER-DEFAULT, VAL-STATUS, VALID, VALIDATE, VALIDATE-STATUS, the operators > "&" (concatenation) and "::" (method invocation), the floating comment > indicator "*>", and the compiler directive indicator ">>". > > By my count that's a total of 87 new entries in the reserved word list in > the '02 standard. > > The '02 standard *drops* ALTER, AUTHOR, CLOCK-UNITS, COBOL (!), > DATE-COMPILED, DATE-WRITTEN, DEBUG-CONTENTS, DEBUG-ITEM, DEBUG-LINE, > DEBUG-NAME, DEBUG-SUB-1, DEBUG-SUB-2, DEBUG-SUB-3, ENTER, EVERY, > INSTALLATION, LABEL, MEMORY, MODULES, MULTIPLE, POSITION, PROCEDURES, > PROCEED, REFERENCES, RERUN, SECURITY, SEGMENT-LIMIT, TAPE, and WORDS for a > total of 29 entries that have been deleted from the reserved word list as it > was in the '85 standard. > > I leave it as an exercize for the reader to figure out which of the new > reserved words are properly characterized as directly supporting OO. > > > > > Ah, but SET is hardly a new reserved word. No, wasn't suggesting it was - but pointing out it's now been 'extended' to give the additional meaning in OO. > > <<There I go - both F/J and M/F have collections, which as yet are not par t > of the J4 OO Standard !>> > > It is expected that the Collection Class Library proposal (currently WDTR > 24717; the most recent update is J4/05-0214, available on > www.cobolportal.com/j4/), will, after a few further minor editorial tweaks , > be submitted as a DTR for international ballot Real Soon Now, and if the > national standards bodies agree, it will apply to the '02 standard. > > WG4 has also requested that this TR along with the also-still-being-refine d > Native COBOL Syntax for XML processing TR are to be "folded into" the draf t > for the 2008 revision to the standard when they've passed their DTR proces s. > The Finalizer TR, which has already been approved, is also to be > incorporated into the draft. > > -Chuck Stevens > > Thanks for your efforts Chuck, I guess the actual OO 'additives' are even less than I thought, taking your list. I'm not sure of some, as they may also apply to Procedural, but the following look like, and most are, definitely OO :- AS, CLASS-ID, EO, EXCEPTION-OBJECT, FACTORY, INHERITS, INTERFACE, INTERFACE-ID, INVOKE, METHOD, METHOD-ID, OBJECT (this also has a Procedural connotation doesn't it ?), OBJECT-REFERENCE, OVERRIDE, PROPERTY, SELF, SUPER and the *ugly* "::" (method invocation). A possible 'maybe' without checking - BASED Above is even smaller than I thought - 19 by my reckoning. Tends to support my comment, it's not in the syntax, but how you 'join' the above together. Jimmy, Calgary AB
Post Follow-up to this messageChristine Frayda wrote: > > <docdwarf@panix.com> wrote in message > news:dj1h87$aih$1@reader2.panix.com... > > And thanks to the group for the help with my homework! (I don't get paid > for this, afterall.) > > Please take all of your sharp wits to the web page to critique our work. > -- Constructive criticism will be accepted most quickly. :) > http://en.wikibooks.org/wiki/ Softw...y:COBOL At a glance the wiki seems to concentrate on the (very interesting) trees without showing a map of the forest. I would put the following up front: ---------------------------------- COBOL is a computer programming language whose layout and statements were intended to resemble those of a written business procedure or a military order. Hence it is divided hierarchically into DIVISIONs, SECTIONs, named paragraphs, and sentence-like statements, each ending in a period. Although recent versions have tended to stray from this original model the format persists. Here is a skeleton of the structure of a typical COBOL program: IDENTIFICATION DIVISION. PROGRAM-ID. MYPROGRAM (etc.) ------------------------------------- I'll submit my own skeleton program in a separate posting, with specific identifiers fictionalized of course. COBOL doesn't do well when we try to put it in a FORTRAN or C++ context. It isn't one of those. But in general we should try to be helpful, even to engineers ;,). -- John Culleton Able Indexers and Typesetters
Post Follow-up to this messageChristine Frayda wrote: > > <docdwarf@panix.com> wrote in message > news:dj1h87$aih$1@reader2.panix.com... I haven't used it much recently but I was active in the language from about 1968 to about 1990 or so. Here is my skeleton program: ----------------------------- 000010 IDENTIFICATION DIVISION. 000020 PROGRAM-ID. TEMPLATE. 000030 AUTHOR. AUTHOR NAME. 000040 INSTALLATION. COMPANY NAME. 000045 Company address 000050*REMARKS. 000060* THIS IS A TEMPLATE FOR OPEN COBOL AND HTCOBOL. 000070 ENVIRONMENT DIVISION. 000080 000090 CONFIGURATION SECTION. 000100 SOURCE-COMPUTER. 000110 Linux. 000120 OBJECT-COMPUTER. 000230 Linux. 000140 000150 INPUT-OUTPUT SECTION. 000160 FILE-CONTROL. 000170 SELECT PRINTFILE ASSIGN TO PRINTER. 000180 DATA DIVISION. 000190 000200 FILE SECTION. 000210 000220 WORKING-STORAGE SECTION. 000230 000240 PROCEDURE DIVISION. 000250 001-MAIN-PROCEDURE. 000260 DISPLAY "TEMPLATE". 000270 STOP RUN. ----------------------------------------------- -- John Culleton Able Indexers and Typesetters
Post Follow-up to this messageIn article <ubCdnav6dt8c5sLeRVn-jQ@adelphia.com>, John Culleton <john@wexfordpress.com> wrote: [snip] >COBOL doesn't do well when we try to put it in a FORTRAN or C++ context. It >isn't one of those. > >But in general we should try to be helpful, even to engineers ;,). It just might be that engineers would have been taught a programming language is a tool to accomplish a task and that no single tool is appropriate to all jobs... well, then again there's the Swiss Army knife and (position of reverence) Vise-Grip Locking Pliers... maybe I'll stop now. DD
Post Follow-up to this message"John Culleton" <john@wexfordpress.com> wrote in message news:xaudnUUVbZXtesLeRVn-jQ@adelphia.com... > My skeleton compiles on two current flavors of COBOL, OpenCOBOL and > TinyCOBOL. I'm really kind of surprised that neither of your cited compilers seem to notice that COBOL itself requires both a SELECT and an FD in order fully to describe any file: "Each file described in the Data Division must be named once and only once as file-name in the FILE-CONTROL paragraph. Each file sepecified in the file control entry must have a file description entry in the Data Division." (ANSI X3.23-1974 page IV-4, 2.1.2.3, The FILE-CONTROL paragraph, Syntax Rule 2. The '85 standard echoes this sentiment, as does the 2002 standard and the draft proposed for 2008. I even see strong evidence that this required correspondence exists in the original COBOL-60 specification). What "value add" do these compilers provide by allowing one without the other? In other words, what "feature" useful to the end user or to the programmer does allowing SELECT without an associated FD represent? How *should* a compiler diagnose this? Does this skeleton program include an extra SELECT statement, or does it have a missing File Description? If the shoe were on the other foot -- a FD without an associated SELECT, would either compiler complain? If so, why? If not, why not? > It is possible to be a good COBOL programmer and yet au courant by > commenting these paragraphs. Well, yeah; but I'm a bit at a loss to understand what's "au courant" about commenting out a SELECT statement in COBOL of *any* vintage just to get the program to compile ... -Chuck Stevens
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.