× 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, 4 Dec 2018 at 17:55, <dlclark@xxxxxxxxxxxxxxxx> wrote:

"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 12/04/2018 05:44:41
PM:
Well. *duh* Now isn't that obvious. Thank you Charles; I'd have never
seen that solution. That saved me a LOT of wasted time.


The SET OPTION statement is not executable so it doesn't have to
be in a procedure -- even with NOMAIN. I put it before all executable
code and it works just fine.

This was the Aha! for me when I got started.

To add to Dave's answer, the RPG compiler doesn't know anything at all
about SQL.

When I change the source type to SQLRPGLE, the RPG compiler sends the
source to a different program - the SQL pre-compiler - which reads the
SQL bits, turns them into RPG source, and then comments the original
SQL out, putting the lot into an intermediate source PF which the RPG
compiler then reads to actually create the module / program. The SQL
pre-compiler is a one-pass compiler; it reads the source once, from
top to bottom. This is why SET OPTION needs to be physically ahead of
all the other SQL 'stuff'. We want the pre-compiler to set our options
first :-)

I have a standard set of options I use for my programs, so I put them
into a /COPY statement and then I don't have to remember what they are
:-/ An alternative might be to put them into an RDi Snippet. Similar
to what Dave does, I put the /COPY as the first 'calculation spec'.

--buck

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.