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



The following seems to work for me.  First the program that uses the APIs:

             PGM
             DCL        VAR(&ERRCOD) TYPE(*INT) VALUE(0)
             DCL        VAR(&SRCIN) TYPE(*CHAR) LEN(20) +
                          VALUE('QCLSRC    VINING    ')
             DCL        VAR(&SRCINMBR) TYPE(*CHAR) LEN(10) +
                          VALUE('TESTPGM   ')
             DCL        VAR(&SRCOUT) TYPE(*CHAR) LEN(20) +
                          VALUE('QCLSRC    QTEMP     ')
             DCL        VAR(&EXITPGM) TYPE(*CHAR) LEN(20) +
                          VALUE('*NONE')
             DCL        VAR(&EXITPGMDTA) TYPE(*CHAR) LEN(10)
             DCL        VAR(&EXITDTALEN) TYPE(*INT) LEN(4) VALUE(0)
             DCL        VAR(&BINDEXIT) TYPE(*CHAR) LEN(20) +
                          VALUE('EXITPGM   VINING    ')
             DCL        VAR(&BINDDTA) TYPE(*CHAR) LEN(10)
             DCL        VAR(&BINDDTALEN) TYPE(*INT) VALUE(0)
             CRTSRCPF   FILE(QTEMP/QCLSRC)
             MONMSG     MSGID(CPF0000)
             RMVM       FILE(QTEMP/QCLSRC) MBR(&SRCINMBR)
             MONMSG     MSGID(CPF0000)
             ADDPFM     FILE(QTEMP/QCLSRC) MBR(&SRCINMBR)
             CPYF       FROMFILE(VINING/QCLSRC) TOFILE(QTEMP/QCLSRC) +
                          FROMMBR(&SRCINMBR) TOMBR(&SRCINMBR) +
                          MBROPT(*REPLACE)
             CALLPRC    PRC('QbnStartPreProcessor') PARM((&ERRCOD))
             CALLPRC    PRC('QbnAddBindtimeExit') PARM((&BINDEXIT) +
                          (&BINDDTA) (&BINDDTALEN) (&ERRCOD))
             CALLPRC    PRC('QbnEndPreProcessor') PARM((&SRCIN) +
                          (&SRCINMBR) (&SRCOUT) (&SRCINMBR) +
                          (&EXITPGM) (&EXITPGMDTA) (&EXITDTALEN) +
                          (&ERRCOD))
             CRTBNDCL   PGM(TESTPGM) SRCFILE(QTEMP/QCLSRC)
             ENDPGM

EXITPGM is:

             PGM        PARM(&P1 &P2)
             DCL        VAR(&P1) TYPE(*CHAR) LEN(10)
             DCL        VAR(&P2) TYPE(*INT)
             SNDPGMMSG  MSG('In the exit program') TOPGMQ(*EXT)
             ENDPGM

and TESTPGM:

PGM
ENDPGM

when I hit the CRTBNDCL statement in the first example EXITPGM is run.

I suspect the problem you encountered was that while you didn't seem to be
changing the source file the APIs you call are (though you may not be able
to "see" the change)...  I added a copy of the source so that the source
and output member control information (written by the APIs) wouldn't step
on each other.   This is hardly a robust example, and I haven't used these
APIs previously, but hopefully this will help get you on your way.

Bruce Vining


                                                                           
             "Hewitt, Rory"                                                
             <rory.hewitt@xxxx                                             
             om>                                                        To 
             Sent by:                  <midrange-l@xxxxxxxxxxxx>           
             midrange-l-bounce                                          cc 
             s@xxxxxxxxxxxx                                                
                                                                   Subject 
                                       IBM Precompiler API help            
             06/27/2005 06:46                                              
             PM                                                            
                                                                           
                                                                           
             Please respond to                                             
             Midrange Systems                                              
                 Technical                                                 
                Discussion                                                 
                                                                           
                                                                           




Hi all,

Has anyone had any experience using any of the IBM precompiler API's:
QbnStartPreProcessor, QbnAddBindtimeExit and QbnEndPreProcessor?

I'm trying to 'pause' the compilation process (for a bound program using
the CRTBND* commands) between temporary module creation and the binding
phase.
According to the API documentation
(http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/QB3AMV00/CCONTENTS
is the V4R5 version, but the API's don't seem to have changed) I need to
call the QbnStartPreProcessor API at the begining of my precompiler,
then call the QbnAddBindtimeExit API to define a preprocessor program to
be called after module creation but before binding, and finally call the
QbnEndPreProcessor API at the end of my preprocessor.

The calls to QbnStartPreProcessor and QbnAddBindtimeExit work fine (at
least no errors are returned in the QUSEC structure), but
QbnEndPreProcessor always throws a CPF5D23 ("Source file member has been
changed.") error. Now frankly maybe I'm in over my head here (no-one
responded to my request for information on the iSeries forum, so perhaps
no-one has used these API's?) but since I don't actually change the
contents of the source member being used for the compilation in any way,
so I don't understand the error message.

Thanks for any help,

Rory

p.s. I cross-posted this to the RPG-L list as well, but got no useful
replies (sorry Alan - your reply wasn't useful enough :-) It just seems
like no-one has used these API's.....ever.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.