× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Dan.

Yes, you can make terrible(unreadable) nested if-statements without any 
'END-IF's, only with a single period at the end.  With a lot of testing, 
you can make it work.  And this has been done a lot before the 'END-IF' 
came along(sigh...).  The 'END-IF' delimit the scope of each single IF, 
and therefore gives you a possibility to let other persons(and yourself 
after a while...) understand what's going on in complex IF-combinations. 
Another thing is that IF-combinations should not have complex coding. Make 
it simple and readable!


Mvh.

Geir Kildal

 




Dan <dbcerpg@xxxxxxxxx>
Sent by: cobol400-l-bounces@xxxxxxxxxxxx
17.06.2003 21:19
Please respond to COBOL Programming on the iSeries/AS400

 
        To:     COBOL Programming on the iSeries/AS400 <cobol400-l@xxxxxxxxxxxx>
        cc: 
        Fax to: 
        Subject:        RE: Testing for valid numeric in an alpha field


--- geir.kildal@xxxxxxxxxxxxxx wrote:
> Just an example on IF's in COBOL:
>
>
> IF A                    = X
>      IF B                       = Y
>           IF C          = Z
>         DO SOMETHING
>          END-IF
>      END-IF
> END-IF.
>
> The END-IF's just make the code easier to read....

But it appears that this is possible:

IF  A = X
  IF  B = Y
    IF  C = Z
      DO THIS
    END-IF
    IF  D = Q
      DO THAT
    END-IF
  ELSE   (this is B NOT = Y)
    IF  K = M
      do the dew
    END-IF
  END-IF
END-IF.

Can you do this kind of nesting without using the END-IF?  If so, how?

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
_______________________________________________
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing 
list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.