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



This is a real pain in the a$$ problem. The C language has the exit()
procedure, but it doesn't work for RPG IV. 

The "only" things you can do are:

A) Back out of the procs until you return, perhaps setting a global flag and
then checking it once you return to the main proc.

B) Call the OS/400 ILE API CEETREC. This ends the program. HOWEVER!!! What
CEETREC really does is end the activation group in which a program is
running. So all other programs running in that activation group are also
ended. 

C) Send a program message to the main body of the program after setting on
LR and then normal exception error handling would occur. But this can be
tricky as well.

It is VERY disappointing that we have "ten ways" to do an ADD operation in
RPG but zero ways to exit a program from within a subprocedure. 

-Bob Cozzi
www.RPGxTools.com
If everything is under control, you are going too slow.
- Mario Andretti


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of rob@xxxxxxxxx
Sent: Monday, July 25, 2005 10:21 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Ending a program from within a procedure

Bloody good question.  I find that's the one time that I use subroutines. 
I'd love to know the answer also.

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.