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



> From: Scott Mildenberger
> 
> Exactly, this is how my dynamic calls look because I do
> prototype them with EXTPGM.  I actually use the prototype in the
> program itself by using conditional compilation directives.
> Then if you want to dynamic call a program using prototype you
> just do the following to get the prototype:
> 
>       /define PROTOTYPE_ONLY
>       /copy qrpglesrc,frselcomp
>       /copy qrpglesrc,frselmfg
>       /copy qrpglesrc,frselwork
>       /copy qrpglesrc,frwrkexcl
>       /copy qrpglesrc,frwrkmodl
>       /copy qrpglesrc,frwrksegs
>       /undefine PROTOTYPE_ONLY

Scott, I thought I ought to point out a little caveat I found with the
whole IF DEFINED thing.  I am at V5R1, I don't know if it is fixed with
V5R2.  And it's actually because I did something "clever".

I set up my included modules like this:

    /IF NOT DEFINED(PROTOTYPE)
   H NOMAIN
    /ENDIF

    * Prototypes for procedures in this module
   D myProc
   (...)

    /IF DEFINED(PROTOTYPE)
    /EOF
    /ENDIF

    * Rest of module source
   (...)

And then in my including modules, I just do this:

    /DEFINE PROTOTYPE
    /COPY qmodsrc,mymodule
    /UNDEFINE PROTOTYPE

This technique works GREAT!  I don't have to go all the way to the
bottom of the source member and stick in an ENDIF.  But if you know me,
when I use the word "clever" that means something bad is going to
happen, kind of like the Jaws music tells you the shark is coming.
Well, here's the catch:

The RPG compiler understands the concept of nested source, so when it
encounters /EOF, it simply stops processing the /COPY member and goes on
with the rest of the code.  The catch is that the SQL preprocessor does
NOT understand nesting.  Thus, the first time it hits an /EOF statement,
it thinks that's the end of the source, and you're done.  Thus, if I
include anything, the source won't compile.

My only workaround to date is to go back to those modules that are
included in SQLRPGLE modules and put the /ENDIF at the end of the code.
Not pretty.

So, anyway, this long missive is simply intended to tell you that /EOF
is not compatible with the SQL preprocessor.

Joe


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.