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



Joe,

Below is an excerpt of a program that is called from another
program showing the conditional compilation directives.  What it
essentially does is only /copy the prototype defintion if
PROTOTYPE_ONLY is defined.  By using the same condition in all
called programs it is easy to remember how to get the prototype.
 

You may also notice that the prototype defines a name of
SelCompCode although the actual program name is FRSELCOMP.  I
have done this to make the code in the calling program more
readable, I do sometimes wonder whether this makes it a little
confusing because the link between the procedure name and actual
program isn't readily apparent.

As I'm typing here I was thinking you could possibly create a
/copy member that only gets all the called programs prototypes
(similar to the original e-mail excerpt showing the /copy's). 
Then any program that wants to call another program would just
/copy this member and wouldn't have to worry about the /define
statement.  In fact, this idea would make using called programs
look very much like using procedures in a service program for
the using program.

Scott Mildenberger

      /IF NOT DEFINED(PROTOTYPE_ONLY)
     h dftactgrp(*no)
     h actgrp(*new)
     h bnddir('FRBIND')
     h option(*srcstmt : *noshowcpy : *nodebugio)
      //////////////////////////////////////////////////////////
     //  Program        FRSELCOMP
      //  Date           09/24/03
      //  Programmer     sjm
      //  Description    Select Component Code
      //  Compilation
      //  Modifications
MMYY  //  MM/DD/YY - sjm
MMYY  //    Description of modification.
      //////////////////////////////////////////////////////////

     ...f spec's...

     ...Global d spec's...

      /ENDIF
      //  This programs prototype/interface.
     d SelCompCode     pr                  extpgm('FRSELCOMP')
     d   SelMfg                            like(Mfg_t)
     d   SelModel                          like(Model_t)
     d   Selected                          like(CompCode_t)

      /IF DEFINED(PROTOTYPE_ONLY)
      /EOF
      /ENDIF

     d SelCompCode     pi
     d   SelMfg                            like(Mfg_t)
     d   SelModel                          like(Model_t)
     d   Selected                          like(CompCode_t)

     ... The rest of the program.



--- Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx> wrote:
> > 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
> 
> Shazzam!  I have to learn this little technique.  What does
> the
> corresponding IFDEF look like in the copybook, Scott?
> 
> Joe
> 



__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

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.