#### EXIT SECTION/PARAGRAPH

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
simrw (226)
9/7/2007 2:31:51 PM
comp.lang.cobol 4237 articles. 0 followers.

50 Replies
916 Views

Similar Articles

[PageSpeed] 19
"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 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 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 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 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 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 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 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 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 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 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 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 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 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
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
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
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
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
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
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
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
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
Robert
9/9/2007 12:58:42 AM
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
Robert
9/9/2007 2:01:54 AM
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
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
Robert
9/9/2007 2:22:49 AM
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 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 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 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 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 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 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 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 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 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 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 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
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 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 howard (6282) 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 howard (6282) 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 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 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 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
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 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 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 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
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
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
howard (6282)
9/11/2007 5:41:21 PM
Similar Artilces:

bibliographies at section level, not chapter level
This must surely have a simple solution, but I haven't yet found it: how does one make bibliography headings appear as a new section, rather than as a new chapter? The reason for this is that the "Bibliography" chapter head is often followed by lists of abbreviations and notes before the bibliography itself, which may be divided into sections e.g. primary vs secondary, or manuscript vs print. ...

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 GUI I have a GUI made with GUIDE that contains some buttons, labels, two axes. I also have a menu. One of the menu items is 'Exit' which is supposed to terminate the GUI. I've tried to put in the Exit call back, delete(hObject), but this does not work. The only way I can exit the program is to click on the X button in the top right hand corner. Does anyone how know to do this? thanks, shirley Have you tried: close(gcf); instead of delete? Hope that is it ;) Cheddad Malaysia =========================================== s2hui wrote: > > > I have a GUI made with GUIDE that ... 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>... What does "exit the block or routine with a loop control operator" mean? Hello, Page 789 of Programming Perl says that the block or routine used for sorting cannot be exited "with a loop control operator". What does this mean? Specifically, is the following OK or not-OK? sub the_sorter { my$rv = 0; for my $i(1..10) { # some code involving$a and $b # an assignment to$rv $rv and last; # exitting the loop inside a sort subroutine. } return$rv; # explicit return statement; not a loop-control operator } I suspect the preceding is indeed OK; please give an example of exitting a "block or routine with a loop control op...

Hi, I am trying to write some code that creates threads to run data load jobs. There is also an extra thread created that watches for a specific file to be created. When this file is found, the watcher thread sends stop signals to all currently running threads. My code appears to exit correctly, but I cannot seem to get the subroutine of the SIG command to exit correctly. We are running HP-UX and the version of Perl we have is 5.8.8 (with thread support obviously). A cut down version of my code is below. Thanks in advance for any help :) Cheers Tim #!/opt/perl_5.8.8cu/bin/perl use stric...

how can I combine the parenthesis of a reference and a link to a section?
Hi, I would like to combine the parenthesis created by a bibliographic reference with a reference to a section like this: .... blah blah (Smith et al. 2008, see Section 4.1) which would currently look like this: .... blah blah (Smith et al. 2008) (see Section 4.1) .... with this code: .... blah blah \shortcite{JAB+07} (see Section \ref{sec:mysec}) How can I do that? I am using the chicago bibliographic style avilella wrote: > Hi, > > I would like to combine the parenthesis created by a bibliographic > reference with a reference to a section like this: > > ... blah ...

Run Script on Exit
Hi, is it possible to cause some script to execute when the scilab application is closed? I'm using Scilab to interact with another application, that writes some data to a file, then runs a scilab script to a) read the the from files b) process the data c) save the results to a file. Now I'd like to add a "debug more", where I run a), then drop into the command line to do b) manually, and run c) on exit. TIA Peter On Tue, 11 Nov 2003 02:14:34 -0800, Peter Hauptmann wrote: > Hi, > > is it possible to cause some script to execute when the scila...

Indenting a paragraph's last line
Hallo! I've got to set verse for a book. My problem is that if a verse is to long an wrapped to the next line the second line has to be aligned to the right with and indent of 25% of \linewidth from the right. The problem with my solution below is that I need to measure the length of the second line, which I'm not able to. So I just created a workaround which does not really do the correct 25% indent (just around 25%). Example (visual and in LaTeX): ******************** ******* -------------------- ------- \kronosVerse{*** *** *** ***}\par \kronosVerse{...

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_...

exit zone console
"Zonehost console login:" is occupying the original terminal after "zlogin -C testzone" and "exit". How do you get the control of terminal back? Thank you, Victor victorfeng1973@yahoo.com wrote: > "Zonehost console login:" is occupying the original terminal after > "zlogin -C testzone" and "exit". How do you get the control of terminal > back? > > Thank you, > Victor > from man zlogin. .... ~. Disconnects from the zone. This is not the same as a logout, because the local host br...

"/usr/local/nagios/etc" directory doe not exits
The /usr/local/nagios/etc does not exist even after setting the httpd.conf file for nagios up. Thus i cannot configure the nagios.cfg file Bye JZZ jzz wrote: > The /usr/local/nagios/etc does not exist even after setting the > httpd.conf file for nagios up. Thus i cannot configure the nagios.cfg > file So change the path to wherever nagios.cfg is. You should have the file somewhere. In my system is installed in /etc/nagios > Bye > JZZ Regards. -- Jose Maria Lopez Hernandez Director Tecnico de bgSEC jkerouac@bgsec.com bgSEC Seguridad y Consultoria de Sistemas http://www.b...

Problem: Terminal window exits immediately on opening. & Solution. #2
I recently ran into this problem using Terminal and found the solution. I thought those who use the Terminal in OS X might be interested. The problem appeared suddenly. Whenever I tried to open a new window in Terminal I would get the message that Terminal tried to execute a certain file (way down in the /var directory), but the file didn't exist. And the process would Exit. Very frustrating since you can't use the Terminal to help find the problem. E.g error message: /var/tmp/folders.501/Cleanup\ At\ Startup/drvrSDWB_2-258580497.358.py.command; exit -bash: /var/tmp/folder...

exit if ssh did not successfully connect?
Hi, If I have a procedure where I run some tasks on a remote system and on a local system, e.g.: ssh user@host.name "command1"; exit # here if the above call did not connect cd /some/dir Is there a way to 'exit' the procedure before the cd command if the ssh call before it failed to complete due to a network failure? Many thanks, Tuxedo On Fri, 7 Jan 2011 20:19:09 +0100 Tuxedo <tuxedo@mailinator.com> wrote: > Hi, >=20 > If I have a procedure where I run some tasks on a remote system and on a= =20 > local system, e.g.: >=20 > ssh user@host.nam...

[ace-bugs] Linux and sockets: Service handler shutdown not causing socket read to exit
ACE VERSION: 5.4.1 HOST MACHINE and OPERATING SYSTEM: Redhat AS 3 on a 4 CPU Dell uname output: Linux gimli 2.4.21-15.0.4.ELsmp #1 SMP Sat Jul 31 01:25:25 EDT 2004 i686 i686 i386 GNU/Linux TARGET MACHINE and OPERATING SYSTEM, if different from HOST: COMPILER NAME AND VERSION (AND PATCHLEVEL): gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-39) THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform- specific file, simply state which one]: config-linux.h THE$ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you...

When closing/exiting Eudora (6.2.5.6) whilst checking mail (which I sometimes do when my hand is faster than my brain), I normally get a dialogwindow that tells me that so many tasks are running and do I really want to close down. I now accidentally checked the box in that dialog-window that asks whether I want to have this dialog or whether I can do without or words to that effect. Where can I get Eudora to bring back this dialog to life? Somewhere in the eudora.ini file? Thanks for your help. Menno Nykerk ...

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,...

exit() or abort()???
Is there some way in Javascript to abort a script...not just a function, but the entire script? Most languages I've used have something like an exit or abort function. I want to be able to alert the user with a message, and then just have the script stop dead where it's at. Is this possible? Thx, Julia In article <eda25927.0406071038.3220125b@posting.google.com>, julia@scripteasy.com enlightened us with... > Is there some way in Javascript to abort a script...not just a > function, but the entire script? Most languages I've used have > something like an exit o...

Re: looking for SUGI papers and list of best papers by section
Hi Dave, SAS sent the list out to the section chairs for review late last week, so I'd expect it will be posted on their Tech Support site shortly. Hope this helps, Nancy Nancy Brucken brucken@provide.net On Fri, 7 Apr 2006 22:17:05 -0700, David Fickbohm <davefickbohm@YAHOO.COM> wrote: >People, > Can someone please tell me where to find a list of the best papers from SUGI31? > Thanks > Dave > > >Dave Fickbohm > >Use Technology to the Fullest >1250 45th st suite 200 >Emeryville, CA, 94608 >510 594 4151 voice ...

program exits prematurely - added echos to help trace
Hello. I am having some problems with chttpd not running on my computer. I have added some echo statements to locate the fault. I have located a section of code that I believe may be of help in solving the problem: #else printf("daemon chk\n"); /* debug!! - this echos */ if (daemon( 0, 0)==-1){ printf("daemon perror\n"); /* debug!! - this does not echo */ perror("daemon:"); exit(1); } printf("eochk daemon\n"); /* debug!! - this does not echo */ #endif user_id = UID; group_id = GID;...

I didn't know this could be done (rename the Detail section of a Form)
I had a Sproc which returned a field called Details. I had the Form Wizard create a continuous form with the Sproc as the RecordSource (as a shell for me to modify). I renamed the Details textbox to txtDetails. Except I didn't. I grabbed DETAIL from the pulldown and renamed it to TxtDetail. Arrgggggggggghhhhh! Although the form showed the Detail section, it was now called TxtDetail. So code like Me.InsideHeight = Me.Detail.Height * 10 failed and the object browser showed no Detail member for the form. Well it's solved now. Perhaps this has happened to you. Perhaps it's a ...

How to trace memory corruption on exit?
I am debugging a heap error in my MSVC 6 DLL. I have gflags running with the -full option, monitoring the EXE that is the client to my DLL. The EXE is a MSVC Win32 console application I wrote to test the DLL. It loads my DLL dynamically using LoadLibrary. When I exit the software, I get the message: HEAP[test_vserver_dll.exe]: Heap block at 0156AB58 modified at 0156AC90 past requested size of 130 The MSVC IDE call stack shows the error coming from NTDLL, with a free() call near the top of the stack. Two questions - - What's a good strategy to find out what caused ...

Can someone give me some practical suggestion on Section 508 compliant?
Can someone give me some practical suggestion on how to make your softare Section 508 compliant? thanks in advance. ...

Exiting a Class Without Exiting Java
I have a class that is sometimes called from the command line and sometimes from another class. When the user clicks "Quit" on the panel it opens, if it is running from the command line, it quits. The problem is that I need a way to terminate the class and the object without using quit, so it doesn't kill other classes. The QUIT button calls an actionListener, so if I have "return" in the listener, it closes the window, but the class is still active. How can I return from the class (does that makes sense) and get the object made from this class to "se...

FAQ 8.42 How do I make a system() exit on control-C? #12
This is an excerpt from the latest version perlfaq8.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 8.42: How do I make a system() exit on control-C? You can't. You need to imitate the system() call (see perlipc for sample code) and then have a signal handler for the INT signal that passes the signal on to...