Does anyone has an example to share of how to work with SQL in a Cobol
program? All the program from Select, FD, Working to Procedure division,
I'll really appreciate the help



-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx
[mailto:cobol400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Sent: Thursday, April 21, 2005 12:08 PM
To: cobol400-l@xxxxxxxxxxxx
Subject: Re: [COBOL400-L] "leave" keyword for cobol400

There is no COBOL statement equivalent to the RPG operation code (opcode) 
LEAVExx in the current implementations of COBOL for OS/400.  The last 
draft I saw of the next COBOL standard has an "EXIT PERFORM" statement for 
an inline PERFORM.  This has the same basic function as the RPG LEAVExx 
opcode.  However, I don't know if the Toronto COBOL compiler folks plan to 
implement it or not.  I've often wanted something like it.  Currently, the 
only method is to code an out-of-line perform such as:

    perform Another-paragraph thru Another-paragraph-exit
            until Normal-loop-termination
         .         .         .
         .         .         .
         .         .         .
    set Normal-loop-termination to true

    do something
    if Exit-condition = true
        goto Another-paragraph-exit
         .         .         .
         .         .         .
         .         .         .


         .         .         .
         .         .         .
         .         .         .
         .         .         .

I generally avoid using a GOTO statement.  To code it without the GOTO, 
you have to nest an IF statement in the middle of your perform. Such as:

            until Exit-condition
            or Normal-loop-termination
        do something
        if Exit-condition not = true
            do some other work

Hope this helps.

Michael Quigley
AS/400 Programming Coordinator
The Way International

Original message:

date: Tue, 19 Apr 2005 16:35:08 +0800
from: cobol400-l@xxxxxxxxxxxx
subject: [COBOL400-L] "leave" keyword for cobol400

hello all!!!

     in rpg400 and rpgile there is an opcode "LEAVEXX" which is used to
leave a subroutine, loop etc..
What i want to do in my perform until -----, is i want to leave every now
and then. What keyword is used in cobol400 to leave a perform until loop,
just like a "LEAVE" in rpg.


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,
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

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-2022 by 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.