Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

QbnEndPreProcessor

8 views
Skip to first unread message

Steve Richter

unread,
Jun 12, 2006, 12:23:43 AM6/12/06
to
What is the purpose of the input and output source member parms of the
QbnEndPreProcessor api?

Here is how the preprocessor apis are used:
callprc prc('QbnStartPreProcessor') parm( &errcod )
callprc prc('QbnAddBindtimeExit') parm( &btExitPgm ... )
callprc prc('QbnEndPreProcessor') parm( &insrcf &insrcmbr +
&outsrcf &outsrcmbr &exitpgm ... )

crtrpgmod module( abc ) /* preprocessor exitpgm is called here.
the exit pgm can use the qbnAddAssociatedSpaceEntry api to store pre
processor specific info in the module. */

crtpgm abc /* bindtime exit program is called here. */

I can guess what the bind time and module create time exit programs do.
What are the source file parms of the QbnEndPreProcessor api for?

thanks,

-Steve

Steve Richter

unread,
Jun 26, 2006, 4:42:42 PM6/26/06
to

I asked IBM support about this. here is the response ( scrubbed of all
the inflammatory statements of the IBMers complaining about the job
performance of the IBM user community )

-------- begin

The idea is that the customer-written preprocessor copies the "input
source member" into a temporary "output source member" as part of its
operation. While the customer-written preprocessor is copying, it
changes preprocessor statements into compileable source code (for
example, plain RPG code). The example is the SQL preprocessor.

The idea is that "output source member" is only temporary and is
deleted immediately after the compile finishes. Because of this, API
QbnEndPreProcessor stores the original file name (the "input source
member") along with whatever other preprocessor data was given (such as
from API QbnAddBindtimeEdit). All the preprocessor-related data is
stored in a place associated with the "output source member" for use by
the compile step (e.g., CRTRPGMOD).

The work flow is:
programmer creates source code in file A
programmer invokes the (customer-written) preprocessor, specifying
file A
the preprocessor then:
calls API QbnStartPreProcessor
calls API QbnAddBindtimeExit (or whatever, as needed)
creates temporary file B (recommend creating B into QTEMP)
copies the content of file A into B, changing preprocessor
statements into plain source code
calls API QbnEndPreProcessor, specifying inpout file A, and output
file B
invokes the compiler, e.g., CRTRPGMOD specifying file B, and then
optionally CRTPGM or CRTSRVPGM
(or) invokes CRTBNDRPG, again specifying file B
(recommended) delete file B
the preprocessor then returns to the caller
programmer then examines the joblog and objects created

We recommend that API qbnAddAssociatedSpaceEntry not be used. Instead,
when the customer-written preprocessor is copying source statements
from A to B, we recommend that it add whatever data it needs directly
into the source code.

--------------- end

-Steve

Thomas Raddatz

unread,
Jun 27, 2006, 12:59:07 PM6/27/06
to Steve Richter
Thanks for having shared this information with us. I probably can use it well.

Thomas Raddatz.


Steve Richter schrieb:

Steve Richter

unread,
Jun 27, 2006, 1:45:46 PM6/27/06
to

Thomas Raddatz wrote:
> Thanks for having shared this information with us. I probably can use it well.
>

glad it helps.

> >
> > We recommend that API qbnAddAssociatedSpaceEntry not be used. Instead,
> > when the customer-written preprocessor is copying source statements
> > from A to B, we recommend that it add whatever data it needs directly
> > into the source code.
> >


I did not follow up with IBM on why they dont recommend the
qbnAddAssociatedSpaceEntry api. I do hope to use that api soon however.
For example as a way to store the source code of the module in the
module and srvpgm object itself. also, possibly store the list of
exports of the srvpgm before it was recreated. The previous export list
would be used to calc if export numbers of individual exports have
changed when the srvpgm was created.

-Steve

Steve Richter

unread,
Jul 10, 2006, 12:27:09 PM7/10/06
to

the input and output source members are used to establish a link
between the source member the user specified on whatever CRTxxxMOD
command the preprocessor supplies and the source member specified on
the actual CRTRPGMOD command the preprocessor runs. The idea is when
you DSPMOD the resulting module the source member is the one supplied
by the user. Not the one the preprocessor specified on the CRTRPGMOD
command.

What is a bit interesting is how the system stores this linkage of
source members. Apparently the system uses an associated space of the
source member for this purpose. Where each srcmbr specified as the
"output source member name" on the QbnEndPreProcessor api is marked in
its associated space with the name of the "input source member name"

-Steve

0 new messages