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



I am assuming that you mean an OPM program compiled with RPG IV, not RPG
III. If yes, just like you would from any other program. Service program
work fine in default activation group but you would be better to run in
named activation group. If you are talking an RPG III you cannot call them
directly. You would have to create a wrapper program to call the service
program.

There is a misconception in the iSeries world that ILE means I compiled my
RPG III program in RPG IV thus I am ILE. My opinion only, but wrong. OPM
means Orginial Program Model. That means writing program using subroutines
and global variables, program calls, etc. Monolith programs. ILE means
writing programs using procedures, modules and service programs. Structured
programs. Compiling an RPG III type program using the RPG IV compiler does
not make it ILE.

My problem with service programs and OPM is that they work but most of the
time the people who are writing them are writing like they are OPM
programs. The company I am working for decided to do some new service
program but the programmer knew nothing about ILE and proceeded to create a
huge monolith procedure that opens a SQL cursor, reads a record, if passed
control closes the cursor and returns a half a dozen data structures. Makes
you want to cry.

On Tue, Oct 20, 2015 at 7:03 PM, <MichaelQuigley@xxxxxxxxxx> wrote:

This has been bothering me since I first read it. How do you call a
service program from an OPM program?

"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 10/16/2015 01:00:02
PM:
----- Message from Vicki Wilson <VWilson@xxxxxxxxxxxxx> on Thu, 15
Oct 2015 23:13:25 +0000 -----

To:

"RPG400-L@xxxxxxxxxxxx" <RPG400-L@xxxxxxxxxxxx>

Subject:

Is the progam OPM or ILE?

Hi all,

I wrote a generic service program for some error handling. It works
as expected if calling program is OPM. It does not behave as
desired if the calling program is ILE - some of us are writing more
programs by declaring MAIN.

One option is to change the behavior if the calling program is ILE.
How would I determine if the calling program is OPM or ILE?

If you are curious - I wrote a CHECK_SQL_STATE which uses QMHSNDPM
to issue a CPF9898 when there is an sql error. Basically folks were
used to seeing a hard-halt on I/O errors and since the CPF9898
wasn't handled we ended up with an inquiry message RNQ0202.

Essentially what I am trying to do is re-create a hard-halt in ILE.
Which is sooo wrong. And definitely not the end game.

Vic

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.