Re: calling RPG ILE with parameter list from MI

"Rich Hart" <[email protected]> Sat, 8 Dec 2007 11:20:06 -0600
Newsgroups gmane.comp.lang.as400.mi
Message-ID <000501c839be$9491c610$030fa8c0@NORIHART>
> From SC41-5800 System API Programming:

> "Because DCL statements are actually instructions to the QPRCRTPG API and 
> not MI instructions, they are defined in the QPRCRTPG API."
> This means that the order of DCLs and DDs does not matter, but it sure 
> makes the source more readable to us humans.
>
> Denes.

Generally speaking, I think the order of DCLs does not matter, but sometimes 
it does.  For example,

            DCL    DD  Main-Variable  CHAR(10);
                   DCL    DD  Sub-Variable    CHAR( 2)  DEF(Main-Variable) 
POS(1);

is a legal declaration, but

                   DCL    DD  Sub-Variable    CHAR( 2)  DEF(Main-Variable) 
POS(1);
                   DCL    DD  Main-Variable  CHAR(10);

is not.  Try it!

That's a good point about the readability of source.  Compiler designers can 
make the generated MI code as ugly as they like, I guess.   Doesn't matter 
to the machine.  But for a human trying to decipher it, it matters a great 
deal.  The all-time prize for ugly goes to the CL compiler.  Try compiling 
an OPM CL program sometime with GENOPT(*LIST) and look at the generated MI 
output.  Que horror!

Rich 

_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.