Ending sections/paragraphs 
Author Message
 Ending sections/paragraphs

I have a little comment regarding inline-performs and ending
sections/paragrafhs with a single period. In our shop I've been member of a
project which had it's own standard for using VS Cobol II. Following
shows how we ended sections (we did'nt use paragrafhs) i.e.:

        anyname section.
           perform
              :
           end-perform.

So we encapsulated the statements in the section in a
cobolII-sequence, which:
a) gave the period
b) ensured that all conditional-statements within had to
   be ended be a scope-terminator (this can even prevent logical
errors)
c) we could easily spot the use of a goto (only used in special
cases),
   because it is'nt possible to have a label within the sequence.

Hope this is of some use

Elo Simonsen  :)



Mon, 12 Jul 1999 03:00:00 GMT  
 Ending sections/paragraphs

Quote:

>I have a little comment regarding inline-performs and ending
>sections/paragrafhs with a single period. In our shop I've been member of a
>project which had it's own standard for using VS Cobol II. Following
>shows how we ended sections (we did'nt use paragrafhs) i.e.:

>    anyname section.
>       perform
>          :
>       end-perform.

>So we encapsulated the statements in the section in a
>cobolII-sequence, which:
>a) gave the period
>b) ensured that all conditional-statements within had to
>   be ended be a scope-terminator (this can even prevent logical
>errors)
>c) we could easily spot the use of a goto (only used in special
>cases),
>   because it is'nt possible to have a label within the sequence.

>Hope this is of some use

>Elo Simonsen  :)

Why would you do this? It seems an awfully unnatural way of coding.

Doug Miller

views expressed are mine and not those of
Hospital Health Plan Corp.  "all health care is local"



Mon, 12 Jul 1999 03:00:00 GMT  
 Ending sections/paragraphs


Quote:

> > anyname section.
> >    perform
> >       :
> >    end-perform.

> >a) gave the period
> >b) ensured that all conditional-statements within had to
> >   be ended be a scope-terminator (this can even prevent logical
> >errors)
> >c) we could easily spot the use of a goto (only used in special
> >cases),
> >   because it is'nt possible to have a label within the sequence.

> Why would you do this? It seems an awfully unnatural way of coding.

He had given 3 reasons.  I think that a) is trivial, a period
can be on a line by itself.

The other two reasons are actually worthwhile because they should
be getting the compiler to do the counting of the END-IFs and
complaing on missing ones, or if an attempt to break the sequence
by inserting a label.

It is possible to increase productivity by getting the computer
to do some of the grunt checking for you.  Having a style that
allows the compiler (or other automatic software) do the checking
for you reduces mistakes and reduces the time required to get
a correctly working program.



Wed, 14 Jul 1999 03:00:00 GMT  
 Ending sections/paragraphs



Quote:

>writes:

>> > anyname section.
>> >    perform
>> >       :
>> >    end-perform.

>> >a) gave the period
>> >b) ensured that all conditional-statements within had to
>> >   be ended be a scope-terminator (this can even prevent logical
>> >errors)
>> >c) we could easily spot the use of a goto (only used in special
>> >cases),
>> >   because it is'nt possible to have a label within the sequence.

>> Why would you do this? It seems an awfully unnatural way of coding.

>He had given 3 reasons.  I think that a) is trivial, a period
>can be on a line by itself.

>The other two reasons are actually worthwhile because they should
>be getting the compiler to do the counting of the END-IFs and
>complaing on missing ones, or if an attempt to break the sequence
>by inserting a label.

This is not completely true. We use microfocus cobol and it does not
complain about missing end-ifs in perform..end-perform loops.

The end-perform is like a full stop it will terminate 'open' ifs.

perform
        if condition
                action
end-perform.

this is quite valid but I would prefer the end-if to be forced.

Quote:

>It is possible to increase productivity by getting the computer
>to do some of the grunt checking for you.  Having a style that
>allows the compiler (or other automatic software) do the checking
>for you reduces mistakes and reduces the time required to get
>a correctly working program.

This I agree with and if anyone knows hoe to force the scope delimiter
check please post.
--
                                              __
Regards                            /\_/\      \ \
                                 =(^ * ^)=     ) }
Rob Swindells                     ( |v|  ~~~~~~  }
                                  ( | | |..../ / }
                                   ~~ ~~     ~~ ~~  


Fri, 23 Jul 1999 03:00:00 GMT  
 Ending sections/paragraphs

Quote:

> >> > anyname section.
> >> >    perform
> >> >       :
> >> >    end-perform.

> >> >b) ensured that all conditional-statements within had to
> >> >   be ended be a scope-terminator (this can even prevent logical

> This is not completely true. We use microfocus cobol and it does not
> complain about missing end-ifs in perform..end-perform loops.

> The end-perform is like a full stop it will terminate 'open' ifs.

> perform
>         if condition
>                 action
> end-perform.

> this is quite valid but I would prefer the end-if to be forced.

> >It is possible to increase productivity by getting the computer
> >to do some of the grunt checking for you.  Having a style that
> >allows the compiler (or other automatic software) do the checking
> >for you reduces mistakes and reduces the time required to get
> >a correctly working program.

> This I agree with and if anyone knows hoe to force the scope delimiter
> check please post.
> --
>                                               __
> Regards                            /\_/\      \ \
>                                  =(^ * ^)=     ) }
> Rob Swindells                     ( |v|  ~~~~~~  }
>                                   ( | | |..../ / }
>                                    ~~ ~~     ~~ ~~

This is'nt the case with VS Cobol II, it has in fact exactly the
function you demand for. Look at this compiling-list:

IBM VS COBOL II Release 4.0 09/15/92 9445            ELO       Date
 SL  ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6--
            IDENTIFICATION DIVISION.                              
            PROGRAM-ID. ELO.                                      
            PROCEDURE DIVISION.                                    
            boss SECTION.                                          
                perform                                            
  1             if tally = 1                                      

IGYPS2112-E The "IF" verb did not have a matching scope terminator.
            terminator was inserted on line 8.  The execution resul
            correct.                                              

  2                display 'tally is 1 ?'                          
                end-perform.        

Regards Elo Simonsen



Mon, 26 Jul 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Second paragraph of section 6 of IEEE standard

2. useless discussions (was: sections vs. paragraphs)

3. Sections vs Paragraphs

4. Paragraphs vs Sections

5. (dis)advantages of sections /paragraphs in procedure division?

6. L S 5 $ W K M C Re: Paragraphs or Sections

7. sections and paragraphs ???

8. Sections as Paragraphs

9. Sections vs. Paragraphs

10. Sections vs. Paragraphs - Challenge - Results

11. Sections vs Paragraphs - a CICS programmers perspective.

12. Sections Vs. Paragraphs

 

 
Powered by phpBB® Forum Software