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



On Tue, 14 Aug 2001, Buck Calabro wrote:

> >CRTSQLRPGI does not have a DEFINE keyword.
> >How can I tell the preprocessor to define BMP
> >when using CRTSQLRPGI?
>
> It's a pain, isn't it?  The precompiler is simply too primitive to support
> all the things that the RPG compiler can do.  Don't blame Toronto; the
> precompiler is apparently owned by somebody else (the database folks?)
> Enough griping...

So you mean I'm not just missing some compiler key word?  Is there some
reason the regular RPG preprocessor can't be run before the SQL
preprocessor - or the SQL preprocessor be taught about preprocessor
macros?!?!?!?!

> David Morris made a suggestion some time ago that I am just starting to
> implement (as my code becomes more sophisticated <cough>.)  Isolate all the
> SQL stuff in a separate service program.  Make it so generic that you don't
> need precompiler/compiler directives, etc.  Bind that service program to
> your mainline (is there a better name for "the program that uses the
> services of a service program?) and then the RPG-only mainline can use all
> the tools available without being hampered by the SQL precompiler.

The problem is that I need to chose between two different SQL statements.
The idea here is that our code should be portable across different
customers.  I've had it with our shop keeping a unique copy of the same
program for every customer's little unique quirk of their database.  I
want one copy only that is portable to all our customers.  One of our
customers has a numeric field in their customer master file that is alpha
in our other customers' customer master file.  We have a customer lookup
written in SQL that selects on this field.  I need different select
statements depending on whose machine I am compiling on.  So I have:

C/if defined(USE_NUM_COLOC)

<use numeric comparison in select>

C/else

<use alpha comparison in select>

C/endif

Other than that little select statement the rest of the program is
identical to all our other customers' versions.  I don't want another copy
laying around that I have to maintain.  But how can I tell the
preprocessor to define USE_NUM_COLOC?  Or is there another way to
accomplish this without preprocessor variables?

James Rich
james@eaerich.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.