COMPGROUPS.NET | Post | Groups | Users | Stream | Browse | About | |

### EXIT SECTION/PARAGRAPH

• Email
• Follow

Does the per subject terminate current execution
of this module (possibly the runtime executable)
when
a) No section is there , (with EXIT PARAGRAPH)
b) SECTION is there but no paragraph.

Roger


 0
Reply simrw (226) 9/7/2007 2:31:51 PM

See related articles to this posting

"Roger While" <simrw@sim-basis.de> wrote in message
news:fbrnco$hhi$03$1@news.t-online.com... > Does the per subject terminate current execution > of this module (possibly the runtime executable) > when > a) No section is there , (with EXIT PARAGRAPH) > b) SECTION is there but no paragraph. EXIT SECTION without a section is a syntax error, as required by 2002, EXIT statement SR(11). EXIT PARAGRAPH in an unnamed paragraph transfers control to the end of the paragraph, as required by 2002, EXIT statement GR(11). Note that, if declaratives are used and there is only one section for the body of the procedure division, EXIT SECTION will transfer control to the end of that section as required by 2002, EXIT statement GR(12). This will, in effect, transfer control to the explicit GOBACK statement that occurs at the end of the source element, as described in 2002, 14.5.3, last paragraph.   0 Reply ricksmith (875) 9/7/2007 4:59:30 PM "Rick Smith" <ricksmith@mfi.net> wrote in message news:13e312ci1s7ur41@corp.supernews.com... [snip] > This will, in effect, transfer control to the > explicit GOBACK statement [...] I should have written "... implicit GOBACK satement ...".   0 Reply ricksmith (875) 9/7/2007 5:30:10 PM On Fri, 7 Sep 2007 16:31:51 +0200, "Roger While" <simrw@sim-basis.de> wrote: >Does the per subject terminate current execution >of this module (possibly the runtime executable) >when >a) No section is there , (with EXIT PARAGRAPH) >b) SECTION is there but no paragraph. EXIT PERFORM from code that's not under a paragraph header will give a compiler error like "must appear within a paragraph". EXIT SECTION from code that's not under a section header will give a compiler error like "must appear within a section". If they pass those tests, they go to the end of the paragraph or section, same as if your code fell to the end. If that means falling off the end of the procedure division, most compilers generate a GOBACK there, some throw an exception.   0 Reply Robert 9/8/2007 3:13:34 AM On Fri, 7 Sep 2007 12:59:30 -0400, "Rick Smith" <ricksmith@mfi.net> wrote: >Note that, if declaratives are used and there is only >one section for the body of the procedure division, >EXIT SECTION will transfer control to the end of >that section as required by 2002, EXIT statement >GR(12). This will, in effect, transfer control to the >explicit GOBACK statement that occurs at the end >of the source element, as described in 2002, 14.5.3, >last paragraph. Old School Cobol programmers have an almost genetic belief that the last line of a program must be its exit. I've seen this structure thousands of times: procedure division. main-line. *> non-functional paragraph name perform beginning-of-program perform middle-of-program perform end-of-program. ..... end-of-program. goback. * --- last line in source code --- Why don't they say GO TO end-of-program, or just say goback in main-line? Why don't they understand that temporal cohesion is a poor way to structure a program? Cohesion is supposed to be functional. Now that goback at the end is in the Standard, their instictive belief has been vindicated. They'll cite it as proof they were Right all along.   0 Reply Robert 9/8/2007 3:45:59 AM Interesting. I have NEVER seen that structure. I almost always see either a "perform 999-End-Of-Program" - that never comes back - but includes closes and GOBACK, etc. Or I see the GOBACK at the end of the mainline. FYI, You might want to look at the section "5.1.1.8 Implicit EXIT PROGRAM" in the COBOL Migration Guide at: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3mg32/5.1.1.8 The "user expecting an ABEND if you "fall off" the end of the source code" is the problem that I have heard of with OLD IBM mainframe code. -- Bill Klein wmklein <at> ix.netcom.com "Robert" <no@e.mail> wrote in message news:gq54e3tujvakviekt9uklks3hv2vlracur@4ax.com... > On Fri, 7 Sep 2007 12:59:30 -0400, "Rick Smith" <ricksmith@mfi.net> wrote: > >>Note that, if declaratives are used and there is only >>one section for the body of the procedure division, >>EXIT SECTION will transfer control to the end of >>that section as required by 2002, EXIT statement >>GR(12). This will, in effect, transfer control to the >>explicit GOBACK statement that occurs at the end >>of the source element, as described in 2002, 14.5.3, >>last paragraph. > > Old School Cobol programmers have an almost genetic belief that the last line > of a program > must be its exit. I've seen this structure thousands of times: > > procedure division. > main-line. *> non-functional paragraph name > perform beginning-of-program > perform middle-of-program > perform end-of-program. > .... > end-of-program. > goback. > * --- last line in source code --- > > Why don't they say GO TO end-of-program, or just say goback in main-line? > > Why don't they understand that temporal cohesion is a poor way to structure a > program? > Cohesion is supposed to be functional. > > Now that goback at the end is in the Standard, their instictive belief has > been > vindicated. They'll cite it as proof they were Right all along.   0 Reply wmklein (2605) 9/8/2007 7:10:31 AM On Sat, 08 Sep 2007 07:10:31 GMT, "William M. Klein" <wmklein@nospam.netcom.com> wrote: >Interesting. I have NEVER seen that structure. I almost always see either a >"perform 999-End-Of-Program" - that never comes back - but includes closes and >GOBACK, etc. Same as my example. I omitted closes to illustrate the point. >Or I see the GOBACK at the end of the mainline. That's where it belongs. Entry was at main-line, so exit should be at the same level. The fundamental problem is PERFORM, a degraded form of CALL. If paragraphs had been CALLed, they would have received as much respect as programs. Moreover, we could have passed parameters to them. Instead of being forced to write: move x to foo-input perform foo move foo-output to y We should have written call foo using x, y >FYI, > You might want to look at the section "5.1.1.8 Implicit EXIT PROGRAM" in the >COBOL Migration Guide at: > http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3mg32/5.1.1.8 > >The "user expecting an ABEND if you "fall off" the end of the source code" is >the problem that I have heard of with OLD IBM mainframe code. In the days of GO TO spaghetti, there was a real danger of going into free fall. To guard against that, large programs had safety nets -- paragraphs that would abend because they should never have been fallen into. foo-exit. exit. foo-exit-safety-net. display 'Control fell out of foo ' call 'abend'. Why did we ever have GO TO? It derived from assembly language. Hardware engineers had an unseen role in the design of Cobol. It took more than a decade to figure out that GO TO was a bad idea. Thirty years later, we still don't undrstand why the more subtle PERFORM, derived from Basic GOSUB, is a bad idea. It's a bad idea for the same reason slavery was bad: we don't need second class entities. The system works better when all logic entities have the same structure and standing. >-- >Bill Klein > wmklein <at> ix.netcom.com >"Robert" <no@e.mail> wrote in message >news:gq54e3tujvakviekt9uklks3hv2vlracur@4ax.com... >> On Fri, 7 Sep 2007 12:59:30 -0400, "Rick Smith" <ricksmith@mfi.net> wrote: >> >>>Note that, if declaratives are used and there is only >>>one section for the body of the procedure division, >>>EXIT SECTION will transfer control to the end of >>>that section as required by 2002, EXIT statement >>>GR(12). This will, in effect, transfer control to the >>>explicit GOBACK statement that occurs at the end >>>of the source element, as described in 2002, 14.5.3, >>>last paragraph. >> >> Old School Cobol programmers have an almost genetic belief that the last line >> of a program >> must be its exit. I've seen this structure thousands of times: >> >> procedure division. >> main-line. *> non-functional paragraph name >> perform beginning-of-program >> perform middle-of-program >> perform end-of-program. >> .... >> end-of-program. >> goback. >> * --- last line in source code --- >> >> Why don't they say GO TO end-of-program, or just say goback in main-line? >> >> Why don't they understand that temporal cohesion is a poor way to structure a >> program? >> Cohesion is supposed to be functional. >> >> Now that goback at the end is in the Standard, their instictive belief has >> been >> vindicated. They'll cite it as proof they were Right all along. >   0 Reply Robert 9/8/2007 11:17:45 AM In article <gq54e3tujvakviekt9uklks3hv2vlracur@4ax.com>, Robert <no@e.mail> wrote: >On Fri, 7 Sep 2007 12:59:30 -0400, "Rick Smith" <ricksmith@mfi.net> wrote: > >>Note that, if declaratives are used and there is only >>one section for the body of the procedure division, >>EXIT SECTION will transfer control to the end of >>that section as required by 2002, EXIT statement >>GR(12). This will, in effect, transfer control to the >>explicit GOBACK statement that occurs at the end >>of the source element, as described in 2002, 14.5.3, >>last paragraph. > >Old School Cobol programmers have an almost genetic belief that the last >line of a program >must be its exit. I've seen this structure thousands of times: > >procedure division. >main-line. *> non-functional paragraph name > perform beginning-of-program > perform middle-of-program > perform end-of-program. >.... >end-of-program. > goback. >* --- last line in source code --- > >Why don't they say GO TO end-of-program, or just say goback in main-line? I barely know why *I* say things, Mr Wagner, let alone anyone else... but many's the time I've been on a site where the standard was: PROCEDURE DIVISION. PERFORM 0000-HOUSKEEPING THRU 0000-EX. PERFORM 3000-MAIN-LINE THRU 3000-EX. PERFORM 9999-EOJ THRU 9999-EX. GOBACK. 3000-MAIN-LINE. <== note 'out-of-sequence' numbering. The reason given for this is that Housekeeping is done once and should be 'out of the way' (farther down in the source), EOJ is at the end and, likewise, farther down... and most problems occur in the mainline, so keep that more convenient than the other paragraphs. > >Why don't they understand that temporal cohesion is a poor way to >structure a program? The way that a program's skeleton was put together, decades on back, just might possibly not reflect the current programmers' understandings. >Cohesion is supposed to be functional. Mr Wagner, this is not a world where, in my experience, 'supposed to be' is actualised often enough that the lack of this occurring is worthy of much note... perhaps our experiences are different. > >Now that goback at the end is in the Standard, their instictive belief has been >vindicated. They'll cite it as proof they were Right all along. As long as the checks clear the bank, Mr Wagner, a Real Programmer might not see much more in 'what they cite' than noise. DD   0 Reply docdwarf (6044) 9/8/2007 11:52:47 AM  "Robert" <no@e.mail> wrote in message news:m9s4e31kd9spf9011fb891re7ktpsdt81g@4ax.com... > On Sat, 08 Sep 2007 07:10:31 GMT, "William M. Klein" > <wmklein@nospam.netcom.com> wrote: > >>Interesting. I have NEVER seen that structure. I almost always see >>either a >>"perform 999-End-Of-Program" - that never comes back - but includes >>closes and >>GOBACK, etc. > > Same as my example. I omitted closes to illustrate the point. > >>Or I see the GOBACK at the end of the mainline. > > That's where it belongs. Entry was at main-line, so exit should be at the > same level. > > The fundamental problem is PERFORM, a degraded form of CALL. If paragraphs > had been > CALLed, they would have received as much respect as programs. Moreover, we > could have > passed parameters to them. Instead of being forced to write: > > move x to foo-input > perform foo > move foo-output to y > > We should have written > > call foo using x, y > >>FYI, >> You might want to look at the section "5.1.1.8 Implicit EXIT PROGRAM" >> in the >>COBOL Migration Guide at: >> >> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3mg32/5.1.1.8 >> >>The "user expecting an ABEND if you "fall off" the end of the source code" >>is >>the problem that I have heard of with OLD IBM mainframe code. > > In the days of GO TO spaghetti, there was a real danger of going into free > fall. To guard > against that, large programs had safety nets -- paragraphs that would > abend because they > should never have been fallen into. > > foo-exit. > exit. > > foo-exit-safety-net. > display 'Control fell out of foo ' > call 'abend'. > > Why did we ever have GO TO? It derived from assembly language. Hardware > engineers had an > unseen role in the design of Cobol. It took more than a decade to figure > out that GO TO > was a bad idea. Thirty years later, we still don't undrstand why the more > subtle PERFORM, > derived from Basic GOSUB, is a bad idea. It's a bad idea for the same > reason slavery was > bad: we don't need second class entities. The system works better when all > logic entities > have the same structure and standing. That's an interesting opinion and very well stated. I thought about it and I can't agree. :-) I don't see PERFORM as a second class citizen at all, and have been very glad to use it in COBOL programs over decades. I can't see... CALL foo USING parm1 parm2 parm3 ON EXCEPTION CALL something-else VARYING parm1 FROM 1 BY 1 UNTIL parm1 > 1000 AFTER parm2 FROM 1 BY 1 UNTIL parm2 > 1000 AFTER parm3 FROM 1 BY 1 UNTIL parm3 > 1000 END-CALL ...as having quite the same elegance. I believe there is a place for calling something external, and there is a place for using something internal and the two are of equal Class and standing. Of course, people who are persuaded by your argument are not REQUIRED to use PERFORM. (COBOL is very democratic that way... :-)) Pete. -- "I used to write COBOL...now I can do anything".   0 Reply dashwood (4370) 9/8/2007 1:57:11 PM In article <m9s4e31kd9spf9011fb891re7ktpsdt81g@4ax.com>, Robert <no@e.mail> wrote: [snip] >The fundamental problem is PERFORM, a degraded form of CALL. Mr Wagner, it might well be argued that 'PERFORM' is no more 'a degraded form of CALL' in the same wise that 'any way to transfer control from the currently executing statement' is 'a degraded form of (branch instruction)'. Such arguments may, perhaps, be able to give their originators and/or participants a 'such a clever lad I am!' feeling... but be of limited application once the client starts paying for time. Philosophising, for some, is an enjoyable thing but, as Wittgenstein said, 'The bridge must not fall down'... this has been pointed out in response to your postings previously. >If >paragraphs had been >CALLed, they would have received as much respect as programs. If my Sainted Paternal Grandmother - may she sleep with the angels! - had wheels then she'd have been a trolley-car. She didn't. DD   0 Reply docdwarf (6044) 9/8/2007 1:57:56 PM On Sun, 9 Sep 2007 01:57:11 +1200, "Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote: > > >"Robert" <no@e.mail> wrote in message >news:m9s4e31kd9spf9011fb891re7ktpsdt81g@4ax.com... >> On Sat, 08 Sep 2007 07:10:31 GMT, "William M. Klein" >> <wmklein@nospam.netcom.com> wrote: >> >>>Interesting. I have NEVER seen that structure. I almost always see >>>either a >>>"perform 999-End-Of-Program" - that never comes back - but includes >>>closes and >>>GOBACK, etc. >> >> Same as my example. I omitted closes to illustrate the point. >> >>>Or I see the GOBACK at the end of the mainline. >> >> That's where it belongs. Entry was at main-line, so exit should be at the >> same level. >> >> The fundamental problem is PERFORM, a degraded form of CALL. If paragraphs >> had been >> CALLed, they would have received as much respect as programs. Moreover, we >> could have >> passed parameters to them. Instead of being forced to write: >> >> move x to foo-input >> perform foo >> move foo-output to y >> >> We should have written >> >> call foo using x, y >> >>>FYI, >>> You might want to look at the section "5.1.1.8 Implicit EXIT PROGRAM" >>> in the >>>COBOL Migration Guide at: >>> >>> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3mg32/5.1.1.8 >>> >>>The "user expecting an ABEND if you "fall off" the end of the source code" >>>is >>>the problem that I have heard of with OLD IBM mainframe code. >> >> In the days of GO TO spaghetti, there was a real danger of going into free >> fall. To guard >> against that, large programs had safety nets -- paragraphs that would >> abend because they >> should never have been fallen into. >> >> foo-exit. >> exit. >> >> foo-exit-safety-net. >> display 'Control fell out of foo ' >> call 'abend'. >> >> Why did we ever have GO TO? It derived from assembly language. Hardware >> engineers had an >> unseen role in the design of Cobol. It took more than a decade to figure >> out that GO TO >> was a bad idea. Thirty years later, we still don't undrstand why the more >> subtle PERFORM, >> derived from Basic GOSUB, is a bad idea. It's a bad idea for the same >> reason slavery was >> bad: we don't need second class entities. The system works better when all >> logic entities >> have the same structure and standing. > >That's an interesting opinion and very well stated. > >I thought about it and I can't agree. :-) > >I don't see PERFORM as a second class citizen at all, and have been very >glad to use it in COBOL programs over decades. > >I can't see... > CALL foo > USING parm1 parm2 parm3 > ON EXCEPTION > CALL something-else > VARYING parm1 > FROM 1 > BY 1 > UNTIL parm1 > 1000 > AFTER parm2 > FROM 1 > BY 1 > UNTIL parm2 > 1000 > AFTER parm3 > FROM 1 > BY 1 > UNTIL parm3 > 1000 > END-CALL > > ...as having quite the same elegance. > >I believe there is a place for calling something external, and there is a >place for using something internal and the two are of equal Class and >standing. There is a place for loop control and there is a place for call. Assigning both roles to the verb PERFORM is equivocal. Loop control should enclose the code being looped. It doesn't belong on the invoking call. Someone reading the paragraph has no clue it's inside a loop. set address of foo-variable-1 to address of parm1 set address of foo-variable-2 to address of parm2 set address of foo-variable-3 to address of parm3 perfxorm foo foo. PERFORM VARYING foo-variable-1 FROM 1 BY 1 UNTIL foo-variable-1 > 1000 .... END-PERFORM. >Of course, people who are persuaded by your argument are not REQUIRED to use >PERFORM. > >(COBOL is very democratic that way... :-)) CALL 'foo' USING parm1 parm2 parm3 ENTRY 'foo' USING foo-variable-1 foo-variable-2 foo-variable-3 PERFORM VARYING foo-variable-1 FROM 1 BY 1 UNTIL foo-variable-1 > 1000 .... END-PERFORM GOBACK. Don't like either? Write foo as a called program. Whatever you do, do *not* use EXTERNAL or GLOBAL.   0 Reply Robert 9/8/2007 5:00:12 PM On Sat, 8 Sep 2007 13:57:56 +0000 (UTC), docdwarf@panix.com () wrote: >In article <m9s4e31kd9spf9011fb891re7ktpsdt81g@4ax.com>, >Robert <no@e.mail> wrote: > >[snip] > >>The fundamental problem is PERFORM, a degraded form of CALL. > >Mr Wagner, it might well be argued that 'PERFORM' is no more 'a degraded >form of CALL' in the same wise that 'any way to transfer control from the >currently executing statement' is 'a degraded form of (branch >instruction)'. > >Such arguments may, perhaps, be able to give their originators and/or >participants a 'such a clever lad I am!' feeling... but be of limited >application once the client starts paying for time. The client pays oarsmen to row the boat until higher paid shipbuilders finish its replacement built with J2EE and Beans. > Philosophising, for >some, is an enjoyable thing but, as Wittgenstein said, 'The bridge must >not fall down'... �The limits of my language mean the limits of my world.� �If people did not sometimes do silly things, nothing intelligent would ever get done.�   0 Reply Robert 9/8/2007 5:28:45 PM On Sat, 8 Sep 2007 11:52:47 +0000 (UTC), docdwarf@panix.com () wrote: >As long as the checks clear the bank, Mr Wagner, a Real Programmer might >not see much more in 'what they cite' than noise. Checks that no longer clear the bank: Westinghouse, Enron, AT&T, Gulf Oil, Texaco, Best, Builders Square, Marshall Field's, Montgomery Ward, FW Woolworth, Zayre, Houston Natural Gas, Sylvania, Lionel, Doubleday, Winchester, Pullman, Braniff, TWA, Chase Manhattan Bank, Arthur Anderson, EF Hutton, Paine Webber, American Motors, McDonnell Douglas, Grumman, Banquet Foods, United Fruit, Amdahl, Control Data, DEC, Netscape, Prime, Tandem, Compaq, Hayes, Burroughs, Commodore, AgfaPhoto, IG Farben, Golden Nugget, MGM Grand, Caesars.   0 Reply Robert 9/8/2007 5:44:01 PM And which of those companies stopped "clearing their checks" because of the placement of GOBACK (or Stop Run) in their COBOL programs???? <G> -- Bill Klein wmklein <at> ix.netcom.com "Robert" <no@e.mail> wrote in message news:1in5e35i7lvu73ocsbaqasvp00skl6quun@4ax.com... > On Sat, 8 Sep 2007 11:52:47 +0000 (UTC), docdwarf@panix.com () wrote: > > >>As long as the checks clear the bank, Mr Wagner, a Real Programmer might >>not see much more in 'what they cite' than noise. > > Checks that no longer clear the bank: > > Westinghouse, Enron, AT&T, Gulf Oil, Texaco, Best, Builders Square, Marshall > Field's, > Montgomery Ward, FW Woolworth, Zayre, Houston Natural Gas, Sylvania, Lionel, > Doubleday, > Winchester, Pullman, Braniff, TWA, Chase Manhattan Bank, Arthur Anderson, EF > Hutton, Paine > Webber, American Motors, McDonnell Douglas, Grumman, Banquet Foods, United > Fruit, Amdahl, > Control Data, DEC, Netscape, Prime, Tandem, Compaq, Hayes, Burroughs, > Commodore, > AgfaPhoto, IG Farben, Golden Nugget, MGM Grand, Caesars. >   0 Reply wmklein (2605) 9/8/2007 6:05:12 PM William M. Klein wrote: > And which of those companies stopped "clearing their checks" because of the > placement of GOBACK (or Stop Run) in their COBOL programs???? <G> Heh.... 000-PRINT-CHECKS. PERFORM PRINT-ROBERTS-CHECK. PERFORM PRINT-PETES-CHECK. PERFORM PRINT-DANIELS-CHECK. STOP RUN. PERFORM PRINT-BILLS-CHECK. Don't ya hate it when that happens? ;) -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ / \/ _ o ~ Live from Albuquerque, NM! ~ ~ _ /\ | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Business E-mail ~ daniel @ "Business Website" below ~ ~ Business Website ~ http://www.djs-consulting.com ~ ~ Tech Blog ~ http://www.djs-consulting.com/linux/blog ~ ~ Personal E-mail ~ "Personal Blog" as e-mail address ~ ~ Personal Blog ~ http://daniel.summershome.org ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ !O M--
V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e h---- r+++ z++++

"Who is more irrational?  A man who believes in a God he doesn't see,
or a man who's offended by a God he doesn't believe in?" - Brad Stine

 0
Reply lxi0007 (1830) 9/8/2007 6:41:21 PM

In article <38m5e31437e4ns5h772h3t0lvsqhg2pvkt@4ax.com>,
Robert  <no@e.mail> wrote:
>On Sat, 8 Sep 2007 13:57:56 +0000 (UTC), docdwarf@panix.com () wrote:
>
>>In article <m9s4e31kd9spf9011fb891re7ktpsdt81g@4ax.com>,
>>Robert  <no@e.mail> wrote:
>>
>>[snip]
>>
>>>The fundamental problem is PERFORM, a degraded form of CALL.
>>
>>Mr Wagner, it might well be argued that 'PERFORM' is no more 'a degraded
>>form of CALL' in the same wise that 'any way to transfer control from the
>>currently executing statement' is 'a degraded form of (branch
>>instruction)'.
>>
>>Such arguments may, perhaps, be able to give their originators and/or
>>participants a 'such a clever lad I am!' feeling... but be of limited
>>application once the client starts paying for time.
>
>The client pays oarsmen to row the boat until higher paid shipbuilders
>finish its
>replacement built with J2EE and Beans.

The client does with its money as it sees fit, Mr Wagner; as long as what
is requested of me fits into the rate and is neither illegal nor a
sufficient affront to my professional standards I put in my eight and try
to come in just slightly under time, under budget and over spec.

>
>> Philosophising, for
>>some, is an enjoyable thing but, as Wittgenstein said, 'The bridge must
>>not fall down'...
>
>The limits of my language mean the limits of my world.

This above all, to thine own cells be true. - Gregor Mendel, maybe.

>If people did not sometimes do silly things, nothing intelligent would
>ever get done.

Those who cite the fine line between genius and madness frequently fall
closer to the latter than the former. - Anonymous

DD


 0
Reply docdwarf (6044) 9/8/2007 9:48:35 PM

In article <1in5e35i7lvu73ocsbaqasvp00skl6quun@4ax.com>,
Robert  <no@e.mail> wrote:
>On Sat, 8 Sep 2007 11:52:47 +0000 (UTC), docdwarf@panix.com () wrote:
>
>
>>As long as the checks clear the bank, Mr Wagner, a Real Programmer might
>>not see much more in 'what they cite' than noise.
>
>Checks that no longer clear the bank:
>
>Westinghouse, Enron, AT&T, Gulf Oil, Texaco, Best, Builders Square,
>Marshall Field's,
>Montgomery Ward, FW Woolworth, Zayre, Houston Natural Gas, Sylvania,
>Lionel, Doubleday,
>Winchester, Pullman, Braniff, TWA, Chase Manhattan Bank, Arthur
>Anderson, EF Hutton, Paine
>Webber, American Motors, McDonnell  Douglas, Grumman, Banquet Foods,
>United Fruit, Amdahl,
>Control Data, DEC, Netscape, Prime, Tandem, Compaq, Hayes, Burroughs, Commodore,
>AgfaPhoto, IG Farben, Golden Nugget, MGM Grand, Caesars.

Companies come and companies go, Mr Wagner... and the checks issued by my
current client still clear the bank.

DD


 0
Reply docdwarf (6044) 9/8/2007 9:50:31 PM

On Sep 8, 11:17 pm, Robert <n...@e.mail> wrote:

> The fundamental problem is PERFORM, a degraded form of CALL. If paragraphs had been
> CALLed, they would have received as much respect as programs. Moreover, we could have
> passed parameters to them. Instead of being forced to write:
>
> move x to foo-input
> perform foo
> move foo-output to y

You are not "forced to write" that at all.

> We should have written
>
> call foo using x, y

And how will a 'paragraph' receive these parameters ? Oh, wait, that
looks just like a nested program now.

> In the days of GO TO spaghetti, there was a real danger of going into free fall. To guard

Only when written by incompetent programmers^H^H^H^H^H^H^Hcoders.

> against that, large programs had safety nets -- paragraphs that would abend because they
> should never have been fallen into.
>
> foo-exit.
>     exit.
>
> foo-exit-safety-net.
>     display 'Control fell out of foo '
>     call 'abend'.

> Why did we ever have GO TO? It derived from assembly language. Hardware engineers had an
> unseen role in the design of Cobol. It took more than a decade to figure out that GO TO

GO TO was how programmers designed and implemented programs in the
1950s.

> Thirty years later, we still don't undrstand why the more subtle PERFORM,
> derived from Basic GOSUB, is a bad idea.

COBOL predated BASIC by many years, it doesn't have anything "derived
from Basic".

> It's a bad idea for the same reason slavery was
> bad: we don't need second class entities. The system works better when all logic entities
> have the same structure and standing.

Please give an example of any programming language where "all logic
entities have the same structure and standing". For example where a
class has the same "structure and standing" as a statement.


 0
Reply riplin (4127) 9/8/2007 11:09:07 PM

On Sep 8, 3:13 pm, Robert <n...@e.mail> wrote:
> On Fri, 7 Sep 2007 16:31:51 +0200, "Roger While" <si...@sim-basis.de> wrote:
> >Does the per subject terminate current execution
> >of this module (possibly the runtime executable)
> >when
> >a) No section is there , (with EXIT PARAGRAPH)
> >b) SECTION is there but no paragraph.
>
> EXIT PERFORM from code that's not under a paragraph header will give a compiler error like

You obviously meant EXIT PARAGRAPH.

> "must appear within a paragraph".

No. Wrong. There is no code in a Cobol program that is not in a
'paragraph', It may be an implicit unnamed paragraph if the programmer

> EXIT SECTION from code that's not under a section header will give a compiler error like
> "must appear within a section".
>
> If they pass those tests, they go to the end of the paragraph or section, same as if your
> code fell to the end. If that means falling off the end of the procedure division, most
> compilers generate a GOBACK there, some throw an exception.

Which ones "throw an exception" ?


 0
Reply riplin (4127) 9/8/2007 11:18:14 PM


"Robert" <no@e.mail> wrote in message
news:64j5e35naar2qs3kqhirlih79e3l1vm2eg@4ax.com...
> On Sun, 9 Sep 2007 01:57:11 +1200, "Pete Dashwood"
> <dashwood@removethis.enternet.co.nz>
> wrote:
>
>>
>>
>>"Robert" <no@e.mail> wrote in message
>>news:m9s4e31kd9spf9011fb891re7ktpsdt81g@4ax.com...
>>> On Sat, 08 Sep 2007 07:10:31 GMT, "William M. Klein"
>>> <wmklein@nospam.netcom.com> wrote:
>>>
>>>>Interesting.  I have NEVER seen that structure.  I almost always see
>>>>either a
>>>>"perform 999-End-Of-Program" -  that never comes back - but includes
>>>>closes and
>>>>GOBACK, etc.
>>>
>>> Same as my example. I omitted closes to illustrate the point.
>>>
>>>>Or I see the GOBACK at the end of the mainline.
>>>
>>> That's where it belongs. Entry was at main-line, so exit should be at
>>> the
>>> same level.
>>>
>>> The fundamental problem is PERFORM, a degraded form of CALL. If
>>> paragraphs
>>> CALLed, they would have received as much respect as programs. Moreover,
>>> we
>>> could have
>>> passed parameters to them. Instead of being forced to write:
>>>
>>> move x to foo-input
>>> perform foo
>>> move foo-output to y
>>>
>>> We should have written
>>>
>>> call foo using x, y
>>>
>>>>FYI,
>>>>   You might want to look at the section "5.1.1.8 Implicit EXIT PROGRAM"
>>>> in the
>>>>COBOL Migration Guide at:
>>>>
>>>> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3mg32/5.1.1.8
>>>>
>>>>The "user expecting an ABEND if you "fall off" the end of the source
>>>>code"
>>>>is
>>>>the problem that I have heard of with OLD IBM mainframe code.
>>>
>>> In the days of GO TO spaghetti, there was a real danger of going into
>>> free
>>> fall. To guard
>>> against that, large programs had safety nets -- paragraphs that would
>>> abend because they
>>> should never have been fallen into.
>>>
>>> foo-exit.
>>>    exit.
>>>
>>> foo-exit-safety-net.
>>>    display 'Control fell out of foo '
>>>    call 'abend'.
>>>
>>> Why did we ever have GO TO? It derived from assembly language. Hardware
>>> unseen role in the design of Cobol. It took more than a decade to figure
>>> out that GO TO
>>> was a bad idea. Thirty years later, we still don't undrstand why the
>>> more
>>> subtle PERFORM,
>>> derived from Basic GOSUB, is a bad idea. It's a bad idea for the same
>>> reason slavery was
>>> bad: we don't need second class entities. The system works better when
>>> all
>>> logic entities
>>> have the same structure and standing.
>>
>>That's an interesting opinion and very well stated.
>>
>>I thought about it and I can't agree. :-)
>>
>>I  don't see PERFORM as a second class citizen at all, and have been very
>>
>>I can't see...
>>                CALL foo
>>                           USING parm1 parm2 parm3
>>                                     ON EXCEPTION
>>                                             CALL something-else
>>                 VARYING parm1
>>                       FROM  1
>>                            BY   1
>>                       UNTIL   parm1 > 1000
>>                                 AFTER  parm2
>>                                 FROM  1
>>                                       BY  1
>>                                  UNTIL  parm2 > 1000
>>                                               AFTER  parm3
>>                                               FROM  1
>>                                                      BY 1
>>                                                UNTIL  parm3 > 1000
>>                   END-CALL
>>
>> ...as having quite the same elegance.
>>
>>I believe there is a place for calling something external, and there is a
>>place for using something internal and the two are of equal Class and
>>standing.
>
> There is a place for loop control and there is a place for call. Assigning
> both roles to
> the verb PERFORM is equivocal.
>
> Loop control should enclose the code being looped. It doesn't belong on
> the invoking call.
> Someone reading the paragraph has no clue it's inside a loop.
>
>    perfxorm foo
>
> foo.
>    PERFORM VARYING foo-variable-1 FROM 1 BY 1 UNTIL foo-variable-1 > 1000
>         ....
>    END-PERFORM.
>
>>Of course, people who are persuaded by your argument are not REQUIRED to
>>use
>>PERFORM.
>>
>>(COBOL is very democratic that way... :-))
>
> CALL 'foo' USING parm1 parm2 parm3
>
> ENTRY 'foo' USING foo-variable-1 foo-variable-2 foo-variable-3
>    PERFORM VARYING foo-variable-1 FROM 1 BY 1 UNTIL foo-variable-1 > 1000
>         ....
>    END-PERFORM
>    GOBACK.
>
> Don't like either? Write foo as a called program.
>

The above demonstrates the flexibility of COBOL :-)

> Whatever you do, do *not* use EXTERNAL or GLOBAL.
>

There are occasions when it makes a lot of sense to use EXTERNAL and GLOBAL.
Nested progams are a case in point.

Furthermore Fujitsu PowerCOBOL (a very useful quick build GUI with all event
processing written in COBOL) REQUIRES the use of EXTERNAL GLOBAL for data to
be shared across forms.

Be careful with sweeping statements based on opinion, even when it is
informed opinion, Robert :-)

Pete.
--
"I used to write COBOL...now I can do anything."

>
>


 0
Reply dashwood (4370) 9/9/2007 12:32:10 AM


<docdwarf@panix.com> wrote in message news:fbv5bj$l5m$1@reader1.panix.com...
> In article <38m5e31437e4ns5h772h3t0lvsqhg2pvkt@4ax.com>,
> Robert  <no@e.mail> wrote:
>>On Sat, 8 Sep 2007 13:57:56 +0000 (UTC), docdwarf@panix.com () wrote:
>>
>>>In article <m9s4e31kd9spf9011fb891re7ktpsdt81g@4ax.com>,
>>>Robert  <no@e.mail> wrote:
>>>
>>>[snip]
>>>
>>>>The fundamental problem is PERFORM, a degraded form of CALL.
>>>
>>>Mr Wagner, it might well be argued that 'PERFORM' is no more 'a degraded
>>>form of CALL' in the same wise that 'any way to transfer control from the
>>>currently executing statement' is 'a degraded form of (branch
>>>instruction)'.
>>>
>>>Such arguments may, perhaps, be able to give their originators and/or
>>>participants a 'such a clever lad I am!' feeling... but be of limited
>>>application once the client starts paying for time.
>>
>>The client pays oarsmen to row the boat until higher paid shipbuilders
>>finish its
>>replacement built with J2EE and Beans.
>
> The client does with its money as it sees fit, Mr Wagner; as long as what
> is requested of me fits into the rate and is neither illegal nor a
> sufficient affront to my professional standards I put in my eight and try
> to come in just slightly under time, under budget and over spec.
>
>>
>>> Philosophising, for
>>>some, is an enjoyable thing but, as Wittgenstein said, 'The bridge must
>>>not fall down'...
>>
>>The limits of my language mean the limits of my world.
>
> This above all, to thine own cells be true. - Gregor Mendel, maybe.
>
>>If people did not sometimes do silly things, nothing intelligent would
>>ever get done.
>
> Those who cite the fine line between genius and madness frequently fall
> closer to the latter than the former. - Anonymous
>
That Algernon Nonymous...pretty safe for him to snipe at people. Sometimes
he is right on target, though.

I smiled at this last because it caused an image to come to my mind which I
haven't seen in, oh, fifty years... :-)

A group of schoolboys are being introduced to "Bookkeeping" which they would
not normally be doing, but their usual teacher is sick. The Bookkeeping
teacher is a very dour, humourless Scottish gentleman who has a reputation
for beating boys painfully and unmercifully, and is therefore not to be
confronted or trifled with.

The teacher, in an attempt to explain double entry bookkeeping, had related
how, in ancient times people carved one side of a stick to represent money
coming in and the other side to represent value going out. When the stick
was symettrical the account had a zero balance.

A grubby 12 year old urchin put his hand up.

"Sir, why didn't they just put stones in a bag to represent money coming in
and take them out to represent payments? Then, when the bag was empty the
account would be cleared, and they wouldn't have to lug sticks around with
them." (The boy had obviously not considered the inconvenience of lugging
bags of stones around with them...)

There was a silence. The steel blue Scottish eyes bored into the boy...

"Dashwood, there is a fine line between genius and idiocy. You are on that
line..."

I never asked any more questions in Bookkeeping and our normal teacher
returned soon after so we didn't have to do it any more and could get back
to more important things like Science and Literature... :-)

Pete.
--
"I used to write COBOL...now I can do anything."


 0
Reply dashwood (4370) 9/9/2007 12:51:53 AM


"LX-i" <lxi0007@netscape.net> wrote in message
> William M. Klein wrote:
>> And which of those companies stopped "clearing their checks" because of
>> the placement of GOBACK (or Stop Run) in their COBOL programs????  <G>
>
> Heh....
>
> 000-PRINT-CHECKS.
>     PERFORM PRINT-ROBERTS-CHECK.
>     PERFORM PRINT-PETES-CHECK.
>     PERFORM PRINT-DANIELS-CHECK.
>     STOP RUN.
>     PERFORM PRINT-BILLS-CHECK.
>
> Don't ya hate it when that happens?  ;)
>
Lol!

(Thanks for paying me... ;-))

Pete.
--
"I used to write COBOL...now I can do anything."


 0
Reply dashwood (4370) 9/9/2007 12:55:55 AM

On Sat, 08 Sep 2007 18:05:12 GMT, "William M. Klein" <wmklein@nospam.netcom.com> wrote:

>And which of those companies stopped "clearing their checks" because of the
>placement of GOBACK (or Stop Run) in their COBOL programs????  <G>

Tech companies with the highest job growth:

Omnivision (camera chips)
Perficient (consulting)
AMD
Apple
Genentech
Network Appliance
Cognizant (consulting)
Nvida
iMergent (exploitation jobs)
Akami (internet content delivery)
Cybersource (electronic payment processing)
Netflix
Priceline

None of them has an opening for a Cobol programmer.

 0

On Sat, 8 Sep 2007 21:48:35 +0000 (UTC), docdwarf@panix.com () wrote:

>>The client pays oarsmen to row the boat until higher paid shipbuilders
>>finish its
>>replacement built with J2EE and Beans.
>
>The client does with its money as it sees fit, Mr Wagner; as long as what
>is requested of me fits into the rate and is neither illegal nor a
>sufficient affront to my professional standards I put in my eight and try
>to come in just slightly under time, under budget and over spec.

As the boat sinks, I picture you dutifully staying on board playing "PERFORM 9999-EOJ
THRU 9999-EX." I picture a bumper sticker "I'll give up my THRU when they pry my cold
fingers from the keyboard."

 0

In article <k5k6e3l3eeu3olemculjklao692o2hq6rq@4ax.com>,
Robert  <no@e.mail> wrote:
>On Sat, 8 Sep 2007 21:48:35 +0000 (UTC), docdwarf@panix.com () wrote:
>
>
>>>The client pays oarsmen to row the boat until higher paid shipbuilders
>>>finish its
>>>replacement built with J2EE and Beans.
>>
>>The client does with its money as it sees fit, Mr Wagner; as long as what
>>is requested of me fits into the rate and is neither illegal nor a
>>sufficient affront to my professional standards I put in my eight and try
>>to come in just slightly under time, under budget and over spec.
>
>As the boat sinks, I picture you dutifully staying on board playing
>"PERFORM 9999-EOJ
>THRU 9999-EX." I picture a bumper sticker "I'll give up my THRU when
>they pry my cold
>fingers from the keyboard."

That you can picture it, Mr Wagner, gives it no force of existence outside
of what you can picture; I am nowhere near believing 'it happened
yesterday, therefore it must happen tomorrow'.

There just might, possibly, be things in Heaven and upon Earth not dreamt

DD


 0
Reply docdwarf (6044) 9/9/2007 2:05:31 AM

On Sat, 08 Sep 2007 16:18:14 -0700, Richard <riplin@Azonic.co.nz> wrote:

>On Sep 8, 3:13 pm, Robert <n...@e.mail> wrote:
>> On Fri, 7 Sep 2007 16:31:51 +0200, "Roger While" <si...@sim-basis.de> wrote:
>> >Does the per subject terminate current execution
>> >of this module (possibly the runtime executable)
>> >when
>> >a) No section is there , (with EXIT PARAGRAPH)
>> >b) SECTION is there but no paragraph.
>>
>> EXIT PARAGRAPH from code that's not under a paragraph header will give a compiler error like
>> "must appear within a paragraph".
>
>No. Wrong. There is no code in a Cobol program that is not in a
>'paragraph', It may be an implicit unnamed paragraph if the programmer

That's what I thought, until I tried it with Micro Focus Server Express 2.2.

>> EXIT SECTION from code that's not under a section header will give a compiler error like
>> "must appear within a section".
>>
>> If they pass those tests, they go to the end of the paragraph or section, same as if your
>> code fell to the end. If that means falling off the end of the procedure division, most
>> compilers generate a GOBACK there, some throw an exception.
>
>Which ones "throw an exception" ?

Bill says old mainframe compilers, which sounds right to me.

 0

Pete Dashwood wrote:
> "LX-i" <lxi0007@netscape.net> wrote in message
>> William M. Klein wrote:
>>> And which of those companies stopped "clearing their checks" because of
>>> the placement of GOBACK (or Stop Run) in their COBOL programs????  <G>
>> Heh....
>>
>> 000-PRINT-CHECKS.
>>     PERFORM PRINT-ROBERTS-CHECK.
>>     PERFORM PRINT-PETES-CHECK.
>>     PERFORM PRINT-DANIELS-CHECK.
>>     STOP RUN.
>>     PERFORM PRINT-BILLS-CHECK.
>>
>> Don't ya hate it when that happens?  ;)
>>
> Lol!
>
> (Thanks for paying me... ;-))

Well, you're check's been printed, but the STOP RUN came in there before
PERFORM MAIL-THE-CHECKS.  Sorry...  :(

;)

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~     / \/ _ o     ~          Live from Albuquerque, NM!          ~
~     _ /\   |     ~                                              ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ Business Website ~ http://www.djs-consulting.com                ~
~ Tech Blog        ~ http://www.djs-consulting.com/linux/blog     ~
~ Personal E-mail  ~ "Personal Blog" as e-mail address            ~
~ Personal Blog    ~ http://daniel.summershome.org                ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$!O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e h---- r+++ z++++ "Who is more irrational? A man who believes in a God he doesn't see, or a man who's offended by a God he doesn't believe in?" - Brad Stine   0 Reply lxi0007 (1830) 9/9/2007 4:37:36 AM On Sep 9, 2:22 pm, Robert <n...@e.mail> wrote: > On Sat, 08 Sep 2007 16:18:14 -0700, Richard <rip...@Azonic.co.nz> wrote: > >> EXIT PARAGRAPH from code that's not under a paragraph header will give a compiler error like > >> "must appear within a paragraph". > > >No. Wrong. There is no code in a Cobol program that is not in a > >'paragraph', It may be an implicit unnamed paragraph if the programmer > >hasn't written a header. > > That's what I thought, until I tried it with Micro Focus Server Express 2.2. MF Cobol doesn't give an error because "it's not in a paragraph", if it does give an error it is for some other reason. > >> EXIT SECTION from code that's not under a section header will give a compiler error like > >> "must appear within a section". > > >> If they pass those tests, they go to the end of the paragraph or section, same as if your > >> code fell to the end. If that means falling off the end of the procedure division, most > >> compilers generate a GOBACK there, some throw an exception. > > >Which ones "throw an exception" ? > > Bill says old mainframe compilers, which sounds right to me. The standard for Cobol requires that 'falling off the end of the code' is equivalent to a STOP RUN (or EXIT PROGRAM) and always has done. Whether Bill actually said that is unsupported hearsay.   0 Reply riplin (4127) 9/9/2007 10:27:03 PM On Sep 9, 5:00 am, Robert <n...@e.mail> wrote: > Whatever you do, do *not* use EXTERNAL or GLOBAL. You seem unaware of how the object model is implemented in Cobol. Perhaps you are stuck in an obsolete pre-OO mindset. OO Cobol is an expansion of the nested program model. The class is a separate module with object data being 'GLOBAL' to the methods that are 'sub-programs' within the module. Claiming that GLOBAL should not be used is contrary to the ability to create an 'object' with 'methods' using the nested program structure available for a couple of decades. But then you have never let facts get in the way of your opinionated rants.   0 Reply riplin (4127) 9/9/2007 11:11:49 PM On Sun, 09 Sep 2007 16:11:49 -0700, Richard <riplin@Azonic.co.nz> wrote: >On Sep 9, 5:00 am, Robert <n...@e.mail> wrote: > >> Whatever you do, do *not* use EXTERNAL or GLOBAL. > >You seem unaware of how the object model is implemented in Cobol. >Perhaps you are stuck in an obsolete pre-OO mindset. > >OO Cobol is an expansion of the nested program model. The class is a >separate module with object data being 'GLOBAL' to the methods that >are 'sub-programs' within the module. > >Claiming that GLOBAL should not be used is contrary to the ability to >create an 'object' with 'methods' using the nested program structure >available for a couple of decades. That's what the object-storage section is for. It is global to either class or instance methods without using the word GLOBAL.   0 Reply Robert 9/10/2007 5:31:52 AM Richard, True today - not always true. See SUBSTANTIVE CHANGE 21 on page XVII-61 of the '85 Standard which starts with, "EXIT PROGRAM statement (1 IPC). When there is no next executable statement in a called program, an implicit EXIT PROGRAM statement is executed." P.S. This is why the IBM mainframe compilers have different behavior for their '74 vs '85 compiler setting (CMPR2 - causes an ABEND while '85 acts as if EXIT PROGRAM were coded). I did provide the reference in an earlier note and can provide it again - if anyone wants it. P.P.S. I don't know if Micro Focus emulates this with their OSVS or VSC2(2) compiler settings, but it wouldn't surprise me if they did. -- Bill Klein wmklein <at> ix.netcom.com "Richard" <riplin@Azonic.co.nz> wrote in message news:1189376823.322007.290810@50g2000hsm.googlegroups.com... > > On Sep 9, 2:22 pm, Robert <n...@e.mail> wrote: >> On Sat, 08 Sep 2007 16:18:14 -0700, Richard <rip...@Azonic.co.nz> wrote: > >> >> EXIT PARAGRAPH from code that's not under a paragraph header will give a >> >> compiler error like >> >> "must appear within a paragraph". >> >> >No. Wrong. There is no code in a Cobol program that is not in a >> >'paragraph', It may be an implicit unnamed paragraph if the programmer >> >hasn't written a header. >> >> That's what I thought, until I tried it with Micro Focus Server Express 2.2. > > MF Cobol doesn't give an error because "it's not in a paragraph", if > it does give an error it is for some other reason. > >> >> EXIT SECTION from code that's not under a section header will give a >> >> compiler error like >> >> "must appear within a section". >> >> >> If they pass those tests, they go to the end of the paragraph or section, >> >> same as if your >> >> code fell to the end. If that means falling off the end of the procedure >> >> division, most >> >> compilers generate a GOBACK there, some throw an exception. >> >> >Which ones "throw an exception" ? >> >> Bill says old mainframe compilers, which sounds right to me. > > The standard for Cobol requires that 'falling off the end of the code' > is equivalent to a STOP RUN (or EXIT PROGRAM) and always has done. > Whether Bill actually said that is unsupported hearsay. > >   0 Reply wmklein (2605) 9/10/2007 5:55:06 AM If a compiler claims to conform to the '02 Standard (at least for this) - or has such an extension, a "conforming" compiler need not have all procedure division code within NAMED paragraphs. See substantive change 90 on page 828 of the '02 Standard. It states, "90) Paragraph-name. A paragraph-name is not required at the beginning of the procedure division or a section." I believe (but won't swear to it), that MF has had this as an extension for many releases. "Richard" <riplin@Azonic.co.nz> wrote in message news:1189376823.322007.290810@50g2000hsm.googlegroups.com... > > On Sep 9, 2:22 pm, Robert <n...@e.mail> wrote: >> On Sat, 08 Sep 2007 16:18:14 -0700, Richard <rip...@Azonic.co.nz> wrote: > >> >> EXIT PARAGRAPH from code that's not under a paragraph header will give a >> >> compiler error like >> >> "must appear within a paragraph". >> >> >No. Wrong. There is no code in a Cobol program that is not in a >> >'paragraph', It may be an implicit unnamed paragraph if the programmer >> >hasn't written a header. >> >> That's what I thought, until I tried it with Micro Focus Server Express 2.2. > > MF Cobol doesn't give an error because "it's not in a paragraph", if > it does give an error it is for some other reason. > >> >> EXIT SECTION from code that's not under a section header will give a >> >> compiler error like >> >> "must appear within a section". >> >> >> If they pass those tests, they go to the end of the paragraph or section, >> >> same as if your >> >> code fell to the end. If that means falling off the end of the procedure >> >> division, most >> >> compilers generate a GOBACK there, some throw an exception. >> >> >Which ones "throw an exception" ? >> >> Bill says old mainframe compilers, which sounds right to me. > > The standard for Cobol requires that 'falling off the end of the code' > is equivalent to a STOP RUN (or EXIT PROGRAM) and always has done. > Whether Bill actually said that is unsupported hearsay. > >   0 Reply wmklein (2605) 9/10/2007 6:00:15 AM On Sep 10, 5:31 pm, Robert <n...@e.mail> wrote: > On Sun, 09 Sep 2007 16:11:49 -0700, Richard <rip...@Azonic.co.nz> wrote: > >On Sep 9, 5:00 am, Robert <n...@e.mail> wrote: > > >> Whatever you do, do *not* use EXTERNAL or GLOBAL. > > >You seem unaware of how the object model is implemented in Cobol. > >Perhaps you are stuck in an obsolete pre-OO mindset. > > >OO Cobol is an expansion of the nested program model. The class is a > >separate module with object data being 'GLOBAL' to the methods that > >are 'sub-programs' within the module. > > >Claiming that GLOBAL should not be used is contrary to the ability to > >create an 'object' with 'methods' using the nested program structure > >available for a couple of decades. > > That's what the object-storage section is for. It is global to either class or instance > methods without using the word GLOBAL. So ? Using ANSI'85 nested programs over the last 20 years to emulate OO just means that one has to use GLOBAL for object data rather than have it implicit with the much later actual OO.   0 Reply riplin (4127) 9/10/2007 6:27:58 AM On Sep 10, 6:00 pm, "William M. Klein" <wmkl...@nospam.netcom.com> wrote: > If a compiler claims to conform to the '02 Standard (at least for this) - or has > such an extension, a "conforming" compiler need not have all procedure division > code within NAMED paragraphs. > > See substantive change 90 on page 828 of the '02 Standard. It states, > > "90) Paragraph-name. A paragraph-name is not required at the beginning of the > procedure division or a section." > > I believe (but won't swear to it), that MF has had this as an extension for many > releases. EXIT PARAGRAPH is an extension prior to '02.   0 Reply riplin (4127) 9/10/2007 7:23:56 AM On Sep 10, 5:55 pm, "William M. Klein" <wmkl...@nospam.netcom.com> wrote: > Richard, > True today - not always true. > > See SUBSTANTIVE CHANGE 21 on page XVII-61 of the '85 Standard which starts with, > > "EXIT PROGRAM statement (1 IPC). When there is no next executable statement in a > called program, an implicit EXIT PROGRAM statement is executed." > > P.S. This is why the IBM mainframe compilers have different behavior for their > '74 vs '85 compiler setting (CMPR2 - causes an ABEND while '85 acts as if EXIT > PROGRAM were coded). With '74 (and earlier) does 'falling off the end' of an UNcalled program cause a STOP RUN or an ABEND ?   0 Reply riplin (4127) 9/10/2007 7:28:20 AM It is my MEMORY (without checking it) that even the '85 and '02 Standards do NOT define what is "required" to happen when you "fall off the end" of source code in the "main" (not called/activated) program. From looking at: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3MG32/5.1.1.8.3 I think (but haven't tested it) that results are STILL (post-85-standard) undefined when there is no STOP RUN (or GOBACK) at the end of source code in the main program. I have NOT checked this in the '85 or '02 Standards, so I could be mistaken on this. -- Bill Klein wmklein <at> ix.netcom.com "Richard" <riplin@Azonic.co.nz> wrote in message news:1189409300.085925.239340@r34g2000hsd.googlegroups.com... > On Sep 10, 5:55 pm, "William M. Klein" <wmkl...@nospam.netcom.com> > wrote: >> Richard, >> True today - not always true. >> >> See SUBSTANTIVE CHANGE 21 on page XVII-61 of the '85 Standard which starts >> with, >> >> "EXIT PROGRAM statement (1 IPC). When there is no next executable statement >> in a >> called program, an implicit EXIT PROGRAM statement is executed." >> >> P.S. This is why the IBM mainframe compilers have different behavior for >> their >> '74 vs '85 compiler setting (CMPR2 - causes an ABEND while '85 acts as if >> EXIT >> PROGRAM were coded). > > With '74 (and earlier) does 'falling off the end' of an UNcalled > program cause a STOP RUN or an ABEND ? > > >   0 Reply wmklein (2605) 9/10/2007 2:07:15 PM Sorry that I wasn't clear. I am POSITIVE that MF introduced EXIT PARAGRAPH as an extension before the '02 Standard was passed. What I am not as positive of, is that I *think* that MF had n extension allowing for procedure division code to exist before/without a paragraph (or section) header. My note was replying to the thread comments, >> >No. Wrong. There is no code in a Cobol program that is not in a >> >'paragraph', It may be an implicit unnamed paragraph if the programmer >> >hasn't written a header. >> >> That's what I thought, until I tried it with Micro Focus Server Express 2.2. -- Bill Klein wmklein <at> ix.netcom.com "Richard" <riplin@Azonic.co.nz> wrote in message news:1189409036.404027.305410@y42g2000hsy.googlegroups.com... > On Sep 10, 6:00 pm, "William M. Klein" <wmkl...@nospam.netcom.com> > wrote: >> If a compiler claims to conform to the '02 Standard (at least for this) - or >> has >> such an extension, a "conforming" compiler need not have all procedure >> division >> code within NAMED paragraphs. >> >> See substantive change 90 on page 828 of the '02 Standard. It states, >> >> "90) Paragraph-name. A paragraph-name is not required at the beginning of the >> procedure division or a section." >> >> I believe (but won't swear to it), that MF has had this as an extension for >> many >> releases. > > EXIT PARAGRAPH is an extension prior to '02. > > >   0 Reply wmklein (2605) 9/10/2007 2:11:22 PM >>> On 9/10/2007 at 8:07 AM, in message <nccFi.122047$1J4.66000@fe06.news.easynews.com>, William M.
Klein<wmklein@nospam.netcom.com> wrote:
>"Richard" <riplin@Azonic.co.nz> wrote in message
>>
>> With '74 (and earlier) does 'falling off the end' of an UNcalled
>> program cause a STOP RUN or an ABEND ?
>
> It is my MEMORY (without checking it) that even the '85 and '02 Standards

> do NOT
> define what is "required" to happen when you "fall off the end" of
> source code
> in the "main" (not called/activated) program.
>
> From looking at:
>
> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3MG32/5.1.
> 1.8.3
>
> I think (but haven't tested it) that results are STILL (post-85-standard)

> undefined when there is no STOP RUN (or GOBACK) at the end of source
> code in the
> main program.  I have NOT checked this in the '85 or '02 Standards, so I
> could
> be mistaken on this.

I just happen to still have access to IBM DOS/VS COBOL REL 3.1, which is a
"pre-85 standard" compiler.  I just compiled the following program:

IDENTIFICATION DIVISION.
PROGRAM-ID. STOPIT.
ENVIRONMENT DIVISION.
DATA DIVISION.

PROCEDURE DIVISION.
DISPLAY 'ONE'.

TWO.
DISPLAY 'TWO'.

It actually issued the following warning:
00010  ILA5029I-W     STOP RUN GENERATED AFTER LAST STATEMENT.

Seems to me it would have been better served to generate a GOBACK instead of
a STOP RUN, though...

Dunno how versions prior to 3.1 function with regard to this.

Frank


 0
Reply Frank.Swarbrick (670) 9/10/2007 4:24:43 PM

On Fri, 7 Sep 2007 12:59:30 -0400, "Rick Smith" <ricksmith@mfi.net> wrote:

>
>"Roger While" <simrw@sim-basis.de> wrote in message
>news:fbrnco$hhi$03$1@news.t-online.com... >> Does the per subject terminate current execution >> of this module (possibly the runtime executable) >> when >> a) No section is there , (with EXIT PARAGRAPH) >> b) SECTION is there but no paragraph. > >EXIT SECTION without a section is a syntax error, >as required by 2002, EXIT statement SR(11). > >EXIT PARAGRAPH in an unnamed paragraph >transfers control to the end of the paragraph, as >required by 2002, EXIT statement GR(11). Micro Focus gives a fatal error: procedure division. if 1 = 2 exit paragraph end-if goback 3 exit paragraph * 161-S********************** ** ** Can only be used within a Paragraph cob: error(s) in compilationl   0 Reply Robert 9/10/2007 5:04:47 PM On Fri, 07 Sep 2007 22:45:59 -0500, Robert <no@e.mail> wrote: >Old School Cobol programmers have an almost genetic belief that the last line of a program >must be its exit. I've seen this structure thousands of times: > >procedure division. >main-line. *> non-functional paragraph name > perform beginning-of-program > perform middle-of-program > perform end-of-program. >.... >end-of-program. > goback. >* --- last line in source code --- > >Why don't they say GO TO end-of-program, or just say goback in main-line? Hmmm, I usually have a perform beginning-of-program perform middle-of-program perform end-of-program. goback. The end-of-program paragraphs does the closes, database finishes, and display of counts and such. Housekeeping. I like to see the goback in the main computer. I can see right at the start that there is no drop through to the main body of code.   0 Reply howard (6275) 9/10/2007 5:12:55 PM On Fri, 07 Sep 2007 22:13:34 -0500, Robert <no@e.mail> wrote: >EXIT PERFORM from code that's not under a paragraph header will give a compiler error like >"must appear within a paragraph". I'm curious. My compiler gives warning if we have sections without paragraphs. I haven't worked at a place where that was a style that was used. Does anybody know why that would be a style of coding these days?   0 Reply howard (6275) 9/10/2007 5:19:57 PM Ia a section implied ? Roger "Robert" <no@e.mail> schrieb im Newsbeitrag news:tvl6e394ebogoq92r630h15e11fs8ltlb2@4ax.com... > On Sat, 08 Sep 2007 16:18:14 -0700, Richard <riplin@Azonic.co.nz> wrote: > >>On Sep 8, 3:13 pm, Robert <n...@e.mail> wrote: >>> On Fri, 7 Sep 2007 16:31:51 +0200, "Roger While" <si...@sim-basis.de> >>> wrote: >>> >Does the per subject terminate current execution >>> >of this module (possibly the runtime executable) >>> >when >>> >a) No section is there , (with EXIT PARAGRAPH) >>> >b) SECTION is there but no paragraph. >>> >>> EXIT PARAGRAPH from code that's not under a paragraph header will give a >>> compiler error like >>> "must appear within a paragraph". >> >>No. Wrong. There is no code in a Cobol program that is not in a >>'paragraph', It may be an implicit unnamed paragraph if the programmer >>hasn't written a header. > > That's what I thought, until I tried it with Micro Focus Server Express > 2.2. > >>> EXIT SECTION from code that's not under a section header will give a >>> compiler error like >>> "must appear within a section". >>> >>> If they pass those tests, they go to the end of the paragraph or >>> section, same as if your >>> code fell to the end. If that means falling off the end of the procedure >>> division, most >>> compilers generate a GOBACK there, some throw an exception. >> >>Which ones "throw an exception" ? > > Bill says old mainframe compilers, which sounds right to me.   0 Reply simrw (226) 9/10/2007 5:33:38 PM "Robert" <no@e.mail> wrote in message news:96uae3106tktv1aclfgel7fsg6j7lm0nsq@4ax.com... > On Fri, 7 Sep 2007 12:59:30 -0400, "Rick Smith" <ricksmith@mfi.net> wrote: [snip] > >EXIT PARAGRAPH in an unnamed paragraph > >transfers control to the end of the paragraph, as > >required by 2002, EXIT statement GR(11). > > Micro Focus gives a fatal error: > > procedure division. > if 1 = 2 > exit paragraph > end-if > goback > > > 3 exit paragraph > * 161-S********************** > ** > ** Can only be used within a Paragraph > cob: error(s) in compilationl Does Micro Focus claim the compiler conforms to the COBOL 2002 standard? Or, are you assuming that EXIT PARAGRAPH as an extension to the COBOL 1985 standard has the same behavior as the COBOL 2002 standard? Incidently, the relation "1 = 2" is a syntax error in both the current and previous standards. At least one of the items must be a variable! [This was discussed a year or so ago, in conjunction with PERFORM UNTIL 1 = 0.]   0 Reply ricksmith (875) 9/10/2007 6:22:51 PM While there is a standard for EXIT PARAGRAPTH, the standard for EXIT SECTION seems to be lacking. (Or at least not defined) a) No SECTION No PARAGRAPTH b) SECTION No PARAGRAPTH c) PARAGRAPH No Section d) No SECTION/PARAGRAPH Hmm, I know what MF does and of course OC :(current) -) Roger   0 Reply simrw (226) 9/10/2007 7:15:48 PM I suppose the question is why is a SECTION other than a PARAGRAPH here? (Or not when not definied) Roger "Roger While" <simrw@sim-basis.de> schrieb im Newsbeitrag news:fc455b$4vp$01$1@news.t-online.com...
> While there is a standard for EXIT PARAGRAPTH,
> the standard for EXIT SECTION seems to be lacking.
> (Or at least not defined)
> a)
> No SECTION
> No PARAGRAPTH
>
> b)
> SECTION
> No PARAGRAPTH
>
> c)
> PARAGRAPH
> No Section
>
> d) No SECTION/PARAGRAPH
>
> Hmm, I know what MF does and of course OC :(current) -)
>
> Roger
>


 0
Reply simrw (226) 9/10/2007 7:35:12 PM

Thanks Franc,
Now that you mention it, I remember seeing messages like that in CICS programs
that used EXEC CICS RETURN and didn't have any GOBACK (or STOP RUN).  (Which was
always scary - as you weren't supposed to use STOP RUN under CICS)

--
Bill Klein
wmklein <at> ix.netcom.com
"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:46E51B6B.6F0F.0085.0@efirstbank.com...
>>>> On 9/10/2007 at 8:07 AM, in message
> <nccFi.122047$1J4.66000@fe06.news.easynews.com>, William M. > Klein<wmklein@nospam.netcom.com> wrote: >>"Richard" <riplin@Azonic.co.nz> wrote in message >>news:1189409300.085925.239340@r34g2000hsd.googlegroups.com... >>> >>> With '74 (and earlier) does 'falling off the end' of an UNcalled >>> program cause a STOP RUN or an ABEND ? >> >> It is my MEMORY (without checking it) that even the '85 and '02 Standards > >> do NOT >> define what is "required" to happen when you "fall off the end" of >> source code >> in the "main" (not called/activated) program. >> >> From looking at: >> >> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3MG32/5.1. >> 1.8.3 >> >> I think (but haven't tested it) that results are STILL (post-85-standard) > >> undefined when there is no STOP RUN (or GOBACK) at the end of source >> code in the >> main program. I have NOT checked this in the '85 or '02 Standards, so I >> could >> be mistaken on this. > > I just happen to still have access to IBM DOS/VS COBOL REL 3.1, which is a > "pre-85 standard" compiler. I just compiled the following program: > > IDENTIFICATION DIVISION. > PROGRAM-ID. STOPIT. > ENVIRONMENT DIVISION. > DATA DIVISION. > > PROCEDURE DIVISION. > DISPLAY 'ONE'. > > TWO. > DISPLAY 'TWO'. > > It actually issued the following warning: > 00010 ILA5029I-W STOP RUN GENERATED AFTER LAST STATEMENT. > > Seems to me it would have been better served to generate a GOBACK instead of > a STOP RUN, though... > > Dunno how versions prior to 3.1 function with regard to this. > > Frank >   0 Reply wmklein (2605) 9/10/2007 8:54:22 PM >>> On 9/10/2007 at 11:19 AM, in message <33vae358s4n9oihtbc01s24hvnp8d7jg63@4ax.com>, Howard Brazee<howard@brazee.net> wrote: > On Fri, 07 Sep 2007 22:13:34 -0500, Robert <no@e.mail> wrote: > >>EXIT PERFORM from code that's not under a paragraph header will give a > compiler error like >>"must appear within a paragraph". > > I'm curious. My compiler gives warning if we have sections without > paragraphs. I haven't worked at a place where that was a style that > was used. > > Does anybody know why that would be a style of coding these days? Do you mean something like this? PROCEDURE DIVISION. STARTUP SECTION. PERFORM HOUSEKEEPING PERFORM MAINLINE PERFORM CLEANUP GOBACK. HOUSEKEEPING SECTION. OPEN INPUT FILE1 OPEN OUTPUT FILE2 . MAINLINE SECTION. PERFORM FIRST PERFORM SECOND PERFORM THIRD . FIRST SECTION. * stuff here . SECOND SECTION. * stuff here . THIRD SECTION. * stuff here . HOUSEKEEPING SECTION. CLOSE FILE1 FILE2 . For better of for worse, we have code like this. Generally I'd say there is an additional "EXIT" paragraph at the end of each section, though often if someone ads a section later and there's no "GO TO ...EXIT..." it's often omitted (intentionally or otherwise!). There is no shop standard that requires this style of coding, nor is there one restricting it. It definitely does not cause the compiler to issue any warnings. Once again, speaking for myself, I would not use SECTIONs if it were not for the fact that my compiler does not support EXIT PARAGRAPH. But because it does not I have quite a few, mostly older, programs that are coded this way. Frank   0 Reply Frank.Swarbrick (670) 9/10/2007 8:57:27 PM Interesting ... I just checked the MF 5.0 LRM and they mark EXIT FUNCTION/METHOD with an ISO2002 bubble (and an MF bubble) But they only mark EXIT PARAGRAPH/SECTION/CYCLE with MF bubbles. This means that OFFICIALLY, they only claim it as an extension - not as a part of their PARTIAL implementation of the '02 Standard. My guess (only a guess) is that this is a DOX error and that they really do conform (and think they conform) to the '02 Standard for this feature. Although they do NOT claim full conformance to the entire '02 Standard, their LRM does mark those individual features that they claim are implemented in accordance to that Standard (that were not in the '85 Standard). See their explanation of the ISO2002 bubble in the NOTATION section. -- Bill Klein wmklein <at> ix.netcom.com "Rick Smith" <ricksmith@mfi.net> wrote in message news:13eb33f2np62be7@corp.supernews.com... > > "Robert" <no@e.mail> wrote in message > news:96uae3106tktv1aclfgel7fsg6j7lm0nsq@4ax.com... >> On Fri, 7 Sep 2007 12:59:30 -0400, "Rick Smith" <ricksmith@mfi.net> wrote: > [snip] >> >EXIT PARAGRAPH in an unnamed paragraph >> >transfers control to the end of the paragraph, as >> >required by 2002, EXIT statement GR(11). >> >> Micro Focus gives a fatal error: >> >> procedure division. >> if 1 = 2 >> exit paragraph >> end-if >> goback >> >> >> 3 exit paragraph >> * 161-S********************** >> ** >> ** Can only be used within a Paragraph >> cob: error(s) in compilationl > > Does Micro Focus claim the compiler conforms to the > COBOL 2002 standard? > > Or, are you assuming that EXIT PARAGRAPH as an > extension to the COBOL 1985 standard has the same > behavior as the COBOL 2002 standard? > > Incidently, the relation "1 = 2" is a syntax error in both > the current and previous standards. At least one of the > items must be a variable! [This was discussed a year or > so ago, in conjunction with PERFORM UNTIL 1 = 0.] > > >   0 Reply wmklein (2605) 9/10/2007 9:10:18 PM "William M. Klein" <wmklein@nospam.netcom.com> wrote in message news:ZoiFi.363641$sR4.181094@fe08.news.easynews.com...
> "Rick Smith" <ricksmith@mfi.net> wrote in message
> news:13eb33f2np62be7@corp.supernews.com...
> >
> > "Robert" <no@e.mail> wrote in message
> > news:96uae3106tktv1aclfgel7fsg6j7lm0nsq@4ax.com...
> >> On Fri, 7 Sep 2007 12:59:30 -0400, "Rick Smith" <ricksmith@mfi.net>
wrote:
> > [snip]
> >> >EXIT PARAGRAPH in an unnamed paragraph
> >> >transfers control to the end of the paragraph, as
> >> >required by 2002, EXIT statement GR(11).
> >>
> >> Micro Focus gives a fatal error:
> >>
> >>        procedure division.
> >>            if 1 = 2
> >>                exit paragraph
> >>            end-if
> >>            goback
> >>
> >>
> >>      3         exit paragraph
> >> * 161-S**********************
> >> **
> >> **    Can only be used within a Paragraph
> >> cob: error(s) in compilationl
> >
> > Does Micro Focus claim the compiler conforms to the
> > COBOL 2002 standard?
[snip]
> Interesting ...
>    I just checked the MF 5.0 LRM and they mark EXIT FUNCTION/METHOD with
an
> ISO2002 bubble (and an MF bubble)
>
> But they only mark EXIT PARAGRAPH/SECTION/CYCLE with MF bubbles.
>
> This means that OFFICIALLY, they only claim it as an extension - not as a
part
> of their PARTIAL implementation of the '02 Standard.
>
> My guess (only a guess) is that this is a DOX error and that they really
do
> conform (and think they conform) to the '02 Standard for this feature.

Documentation error or not, there is no syntax rule in
2002 regarding EXIT PARAGRAPH; thus a syntax
error would seem to be non-conforming with respect
to the standard. One unanswered question is: What
does the Micro Focus LRM for 5.0 have as syntax
rules for EXIT PARAGRAPH?

If there are syntax rules for EXIT PARAGRAPH,
then Micro Focus has elected, apparently, to not
conform with the standard for that item. If there is no
syntax rule and a syntax error is given, then it would
seem the LRM does not agree with the compiler.

The following program, using Micro Focus COBOL
3.2.24 (Jun 1994), does not produce a syntax error
and runs as I expect it should, given the rules in 2002
as I understand them.
-----
program-id. exitpara.
data division.
working-storage section.
1 const-1 pic 9 value 1.
procedure division.
if const-1 = 1
exit paragraph
end-if
goback.
-----


 0
Reply ricksmith (875) 9/11/2007 1:32:40 AM

"Roger While" <simrw@sim-basis.de> wrote in message
news:fc469n$sng$02$1@news.t-online.com... > I suppose the question is why is > a SECTION other than a PARAGRAPH here? > > (Or not when not definied) > > Roger > > "Roger While" <simrw@sim-basis.de> schrieb im Newsbeitrag > news:fc455b$4vp$01$1@news.t-online.com...
> > While there is a standard for EXIT PARAGRAPTH,
> > the standard for EXIT SECTION seems to be lacking.
> > (Or at least not defined)
> > a)
> > No SECTION
> > No PARAGRAPTH
> >
> > b)
> > SECTION
> > No PARAGRAPTH
> >
> > c)
> > PARAGRAPH
> > No Section
> >
> > d) No SECTION/PARAGRAPH
> >
> > Hmm, I know what MF does and of course OC :(current) -)

I am not entirely certain what your question is; but
maybe the following programs will help, at least, to
refine the question. Each of these produces the same
results.
-----
program-id. exit-1.
* paragraphs only
data division.
1 cmd-code pic x.
procedure division.
if cmd-code not = "A"
exit paragraph
end-if
display "cmd-code = A"
goback.
1.  if cmd-code not = "B"
exit paragraph
end-if
display "cmd-code = B"
goback.
2.  display "unrecognized cmd-code"
goback.
-----
program-id. exit-2.
* sections only
data division.
1 cmd-code pic x.
procedure division.
0 section.
if cmd-code not = "A"
exit paragraph
end-if
display "cmd-code = A"
goback.
1 section.
if cmd-code not = "B"
exit paragraph
end-if
display "cmd-code = B"
goback.
2 section.
display "unrecognized cmd-code"
goback.
-----
program-id. exit-3.
* sections with paragraphs
data division.
1 cmd-code pic x.
procedure division.
0 section.
begin.
if cmd-code not = "A"
exit paragraph
end-if
display "cmd-code = A"
goback.
1 section.
begin.
if cmd-code not = "B"
exit paragraph
end-if
display "cmd-code = B"
goback.
2 section.
begin.
display "unrecognized cmd-code"
goback.
-----
Each of these was run with Micro Focus COBOL 3.2.24
and I believe are standard conforming programs under 2002.


 0
Reply ricksmith (875) 9/11/2007 2:14:18 AM

On Mon, 10 Sep 2007 14:57:27 -0600, "Frank Swarbrick"
<Frank.Swarbrick@efirstbank.com> wrote:

>Once again, speaking for myself, I would not use SECTIONs if it were not for
>the fact that my compiler does not support EXIT PARAGRAPH.  But because it
>does not I have quite a few, mostly older, programs that are coded this

So there's a compiler that supports EXIT SECTION but not EXIT
PARAGRAPH?

(I understand the GO TO EXIT bit, even if I don't program that way).

 0
Reply howard (6275) 9/11/2007 5:41:21 PM
 comp.lang.cobol 4208 articles. 4 followers.

50 Replies
527 Views

Similar Articles

[PageSpeed] 4

• Email
• Follow

Similar Artilces:

Altering paragraph margins in sections, subsections and paragraphs
Hi, I'm currently typesetting a constitution. I've been able to alter the chapter, sections, subsections etc definitions to get it looking how we need it (definition pasted below). At the moment it's producing clauses as follows: 1.1.1.1 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xx xx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx when I'd love to know how to get it to look like this: 1.1.1.1 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxx xxxx xxxx xxxx xxxx xxxx xxxx...

DECLARATIVES and section/paragraph
Is the following legal ? I thought it was not but now I am not so sure. (Section 14.3 2002) DECLARATIVES. MYSECTION SECTION. USE .... END DECLARATIVES. MYPARAGRAPH. Roger Roger While schrieb: > Is the following legal ? I thought it was not but > now I am not so sure. (Section 14.3 2002) > > DECLARATIVES. > MYSECTION SECTION. > USE .... > END DECLARATIVES. > MYPARAGRAPH. > > Roger Hi, I think its legal, but perhaps you better use instead of MYPARAGRAPH a section: > END DECLARATIVES. > MYSECTION SECTION. Thomas "Roger Whi...

Hi all, Im trying format an article (article document style) to given specifications. The format requires a one line space between each paragraph, but also requires that the space between section heading and the surrounding body text is only one line. When I use: \setlength{\parskip}{\baselineskip} or \usepackage{nccparskip} \SetParskip{\baselineskip} The space between the section heads and surrounding horizontal text changes also (not desirable). Can some one indicate how I can create a one line space between paragraphs without affecting the padding around section headings. I can pro...

Sections, Paragraphs, and related topics
Just as a new thread, I wanted to post my observations and thoughts on this (most previously posted). 1) It is my impression that the use of (all) SECTIONS is more common in Europe and the use of (all) PARAGRAPHS is more common in the US. (I don't know about Asia or Pacific or India or Canada, etc). This observation comes from my time working at Micro Focus (and dealing with customers in both regions.) 2) It is my perception that having ALL "Sections" (possibly with a single paragraph and/or exit paragraph) *OR* having all PARAGRAPHS is each an "equally maintainable...

Section first paragraph not indented
I have: \documentclass{article} \usepackage{lipsum} \begin{document} \lipsum \section{Wibble} \lipsum \end{document} The first line of the first paragraph indents, nice. The first line of the first paragraph after \section does not indent. I'd like it to indent! Suggestions on which documentation I should read to get this to happen will be gratefully received. Justin. -- Justin C, by the sea. Justin C <justin.0805@purestblue.com> writes: > The first line of the first paragraph indents, nice. The first line of > the first paragraph after \section does not indent. > ...

Change the sections subsections and paragraphs
I'd like to change how the \section, \subsection and \paragraph appear in my document. I'd like to add numbers, and change the fonts. What package(s) do I need to use to do that ?. Any howtos out there ?. /Exa On 31-03-2006 13:55, Exa wrote: > I'd like to change how the \section, \subsection and \paragraph appear > in my document. I'd like to add numbers, and change the fonts. > > What package(s) do I need to use to do that ?. > Any howtos out there ?. Sure: the FAQ: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=secthead Best regards, Jose Carlos Santo...

Reset Paragraph count from Section Increment

How to tab paragraphs under a section, subsection, etc..?
Hi all, I don=B4t know how to have the contents under the \section, \subsection, etc.. tabbed (i.e. 3em=B4s to the right)... so that that the paragraphs don=B4t appear alligned below the section/subsection name, and appear to the right. How can I do it? Thank you very much. Jose. On Tue, 07 Feb 2006 16:05:23 +0100, <josesegundo.munoz@gmail.com> wrote: > Hi all, > > I don�t know how to have the contents under the \section, \subsection, > etc.. > tabbed (i.e. 3em�s to the right)... so that that the paragraphs don�t > appear alligned below the section/subsection name...

How to EXIT the while loop in Event response section?
I'm writing a program to grab image using a NI card. The application uses the Event structure. When the GRAB button was pressed,&nbsp;it&nbsp;snaps image continually by putting the SNAP function in a while loop. Is there some way to exit the while loop?(Note :The while loop was put in the GRAB IMAGE event response section.) &nbsp; &nbsp; Hi Zpyang, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; How to stop a while loop...? ... Assuming you mean by operator-intervention, &nbsp;&nbsp; &nbsp;why not test a front-panel control (boolan switch)&nbsp;value? (i...

Vindication of SECTION (was: Infinite Loops and Explicit Exits)
.. On 06.12.04 wrote dashwood@enternet.co.nz (Pete Dashwood) on /COMP/LANG/COBOL in 31gdvsF3asv3pU1@individual.net about Re: Infinite Loops and Explicit Exits Thank you for writing this: PD> Without arguing the value (or otherwise) of paragraphs (more PD> importantly, labels), within SECTIONS, it is certainly true that PD> SECTION can adequately describe (and document as a descriptive PD> header) a piece of related, contiguous code, that implements a given PD> function. If you subsequently add paragraphs or remove paragraphs PD> from it you do NOT h...

How to make the \paragraph heading indent like \section?
I'm using the \paragraph heading and I would like for it to indent just like a \section. I'm using the indentfirst package to make it so that the first paragraph will indent (I know that this is a horrible travesty, but my company requires it), and I would like the text after a \paragraph heading to look exactly the same. I tried doing this: \let\oldparagraph\paragraph \renewcommand{\paragraph}[1]{ \oldparagraph{#1}% \hspace{0pt} \\% \hspace{0pt} \\% \indent } But it seemed to put an extra bit of space in the indentation and would spit out this warning: Underfull \hbox (badne...

Vertical space paragraph ------> section heading
I'm typesetting a book using LaTeX and the memoir class. Quotes are set to \small, as are some catalogue parts set in double columns. Sometimes, LaTeX stretches the vertical space between paragraphs, which looks very ugly in my opinion. I've done \setlength{\parskip}{0pt} which fixes this. (From what I've read the default is 0 pt plus xpt minus xpt, though I don't know what x is.) However, this fix sometimes makes the double columns misaligned, not only at the bottom (I use raggedbottom), but between lines all over the page. It's hard to explain this, but the line in one...

Huge blank spaces between a paragraph and a section title ! What can i do ?
Hi, I'm currently writting my thesis with LaTeX. I use a .sty file from some people, for the layout. The blank space between a paragraph and a section title change depending on the automatic layout done by Latex. Sometimes it's ok, but sometimes latex put some huge blank space. I would like to always have the same size of blank space, or at least to do not have such huge blank spaces between a paragraph and a section title. Anybody experienced that problem, or know how to solve it ? Thanks in advance for any help, Phil philippef wrote: > > The blank space between a paragr...

Entire paragraphs indented to start of text in section headers.
Hi, This is driving me crazy. What I'm trying to do is have the text in my document aligned with the section headers. At the moment, my document looks like this: 2.1 Methods We did this then that then this and that again. And so on and so on and so on. We did this then that then this and that again. And so on and so on and so on. What I really want is: 2.1 Methods We did this then that then this and that again. And so on and so on and so on. We did this then that then this and that again. And so on and so on and so on. I'm using a simple customize...

Recommended HP COBOL way to exit a paragraph or perform early?
I'm a little puzzled what the recommended method here is for this case (see sample code snippet below)... use a goto? Some System call? Embed everything in a deep nesting of Ifs? In this sample, the code is being ran from a performed paragraph. There are three file writes necessary for this transaction to succeed, with this being one of the sequence. If this one fails, the transaction is aborted (rolled back I believe :) and the processing should return to the parent calling process. In a previous life, I would have stuffed a GOBACK in there right after the END-WRITE, or even just bef...

\section and \section*
Using the single switch * on \section has at least three logically separate effects: it suppresses the number, it omits the TOC entry and it fails to set the \sectionmark. Has anyone defined a better \@startsection that allows one to implement any subset of those effects. I guess something like \section*[s] where s is any subset of {ntm} so that, for example \section*[ntm] is the same as section, \section* is the usual and \section[t] adds the TOC entry but suppresses both numbering and \sectionmark. I asked this question, more or less, on TeXhax and got no replies so far. I also could fin...

sections like section*

exit after process exit
Hello, I would like to run a python process and wait until the process exit. How can I do it? For example I would like to run a.exe. and wait until a.exe exit. Sincerely Yours, Pujo os.popen ? Regards, Philippe ajikoe@gmail.com wrote: > Hello, > > I would like to run a python process and wait until the process exit. > How can I do it? > > For example I would like to run a.exe. and wait until a.exe exit. > > Sincerely Yours, > Pujo --6sX45UoQRIJXqkqR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline You might want os.spawnv(os.P_...

help: exit does not exit
Hi, the following program does not terminate for me when I run it. ----snip---- set pid [fork] if {$pid > 0} { puts "waiting for$pid" wait $pid puts "got$pid" return } puts "child (pid=$pid)" #execl "true" exit ----snip---- It prints: waiting for 26550 child (pid=0) When I uncomment the execl line, it works. So why doesn't "exit" work, too? Roland Roland Illig wrote: > Hi, > > the following program does not terminate for me when I run it. > > ----snip---- > set pid [fork] > &g... exit() or sys.exit() What is the difference on exit() and sys.exit() when called in the main body of a script? From the command line they seem to have the same effect. Aside: Just used a python dictionary in which the keys were compiled regular expressions. Provided a very elegant solution. Have to love it. Brendan wrote: > What is the difference on exit() and sys.exit() when called in the > main body of a script? From the command line they seem to have the > same effect. In Python <=2.4 you had to use sys.exit() because __builtins__.exit() griped: tchase@asgix:~$ python2.4 Python 2.4.4 (#2,...

Delete sections defined by particular section delimiters if the sections contain a particular string
Hi all I'd like to process a file (input.txt, see below) with this goal in mind: Delete everything between the strings "section {" and "}" (including those strings!) but only if the section contains the string "pattern=foo". This is the (simplified) content of the file "input.txt": *** Beginning of input.txt *** 111 222 333 section { aaa bbb pattern=foo ccc ddd } section { eee fff pattern=foo ggg hhh } section { iii jjj pattern=bar kkk lll } *** End of input.txt *** Thus, I am looking for results such as *** Beginning of output.txt *** 111 222 ...

Section lines on half section
Hi, I was wondering if there is any way to remove an arrow from a section line. My current half-section line is drawn at a right angle from the origin with an arrow pointing to the left on the vertical line, and the arrow is pointing down on the horizontal line. I am just beginning to study drafting and my instructor would like me to remove the arrow from the horizontal line. I have been looking for a setting for this but cannot find any. I have also talked to my SolidWorks instructor and he does not know of any way to change the arrows. Does anyone have any suggestions? I am using SolidWorks...

how do you return an exit code with out exiting
I wrote a simple python program that scrapes a web page every 30 secons and dumps the result in a data base. I want to use my linux distros build in init tools to run the script in the back ground as a daemon. The problem is when I call the daemon script to background the program I wrote it just hangs, waiting for my program to exit 1 or 0. My program never does exits because its looping every 30 seconds. Is there a way I can pass an exit value with out actualy exiting? or is there are better way to do this? Thanks -- Matthew Thorley On 2005-05-23, Matthew Thorley <ruach@chpc.utah.edu>...

Exit Points and Exit Processing
Can someone explain exit points and exit point processing? I've read the IBM book API System Programming but I still don't understand why I have to register an exit point in one program then attach an exit program rather than simply calling the program directly. Also how is the above done in RPG? Confused Will Hay An exit program is called by a service that is running. For example, the FTP server is running. Registering it tells the FTP server that it should process the exit program specified when commands take place. Will Hay wrote: > Can someone explain exit points and e...