I know you did not intend it as such, but that's a trick question depending
on how you define MI and RPGLE :)
MI, like RPG, comes in different flavors. There's the Original Program
Model (OPM) MI and there's the Bound (ILE) MI. Now one nice thing about
RPGLE is that it can directly run Bound MI instructions using the procedure
call interface (extproc) so you could say (and I would) that there's
nothing I can do in the Bound MI arena that I can't do in RPGLE as I can
run Bound ILE instructions inside my RPGLE instruction stream -- others
however may not agree with calling this RPGLE. This intermixing of ILE
languages within a program is one reason why there is no API to create a
bound MI program while there is an API to create an OPM MI program. With
ILE you just use MI instructions within your RPGLE source and CRTBNDRPG,
CRTSQLRPGI, CRTRPGMOD, etc. figure it all out for you.
Now are there Bound MI instructions that I can run within my RPGLE program
that 1) do not have an equivalent system API that could be called from
RPGLE and 2) do not have a RPG reference manual documented operation code
or built-in? The answer is Yes. One example would be the Compare and Swap
(CMPSWP) MI instruction (which I find very handy in some applications).
Beyond learning about new capabilities/functions within the system (like
CMPSWP) you can, in performance sensitive code paths, also use Bound MI
instructions to avoid having to take a more round about (a nice way of
saying slower) approach to solving a problem. Quite often I find a MI
Materialize instruction to be just the ticket when all I want is one very
specific piece of information (like the serial number of the system I'm
running on to distinguish between development and production).
Knowledge of bound MI can never hurt (well, other than perhaps a slight
headache until you get comfortable with the documentation style used).
I would NOT encourage you to learn OPM MI and, to keep this note short, I'm
not going to go into the details of why.
Bruce
On Fri, Jul 18, 2014 at 8:11 PM, John Smith <smith5646@xxxxxxxxx> wrote:
I was wondering why I should learn to program in MI. Is there stuff
that can be done with MI that can't be done with RPGLE?
John
--
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L)
mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
As an Amazon Associate we earn from qualifying purchases.