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




Hi Doug,

As you have noted, the SQL precompiler only recognizes /COPY when it starts
in column 7. This behavior is explained within the Embedded SQL
programming documentation in the section entitled "Using directives in ILE
RPG applications that use SQL".

** start documentation excerpt **
Using directives in ILE RPG applications that use SQL

RPG directives are handled by the SQL precompiler according to the value of
the RPG preprocessor options parameter (RPGPPOPT). If the RPG preprocessor
is used, the SQL precompile will run using the expanded preprocessed
source.
o When the value is *NONE, the RPG preprocessor is not called to preprocess
the RPG source. When a source stream file is precompiled, no directives are
recognized by SQL. When a source member is precompiled, the only directive
that is handled by the SQL precompiler is /COPY. Nested /COPY statements
are not handled. The /COPY statement in a free-form calculation block is
not handled by the SQL precompiler. All other directives are ignored until
the RPG compiler is called. This means that all RPG and SQL statements
within conditional logic blocks are processed unconditionally by the SQL
precompiler.
o When the value is *LVL1, the RPG preprocessor will be called to
preprocess the RPG source. All /COPY statements are expanded, even
nested /COPY statements, and the conditional compilation directives will be
handled.
o When the value is *LVL2, the RPG preprocessor will be called to
preprocess the RPG source. All /COPY and /INCLUDE statements are expanded
and the conditional compilation directives will be handled.
o When *LVL1 or *LVL2 is used, there is a possibility that the expanded
source generated by the RPG preprocessor will become very large and reach a
resource limit due to the expansion of the /COPY and /INCLUDE statements.
If this happens you must either break up your source into smaller pieces,
or not use the RPG preprocessor.
** end documentation excerpt **

The compilation default is RPGPPOPT(*NONE). This documentation has not
been updated for free-form support, but a /COPY directive in column 7 is
considered to be 'fixed-form' and a /COPY directive in any other column is
considered to be 'free-form' by the SQL precompiler. If you want /COPY
information to be seen by the SQL precompiler when the /COPY is coded in a
column other than column 7, you will need to use the RPGPPOPT(*LVL1) or
RPGPPOPT(*LVL2) compilation option.

I hope this helps. Thanks.

Scott Hanson

message: 1
date: Mon, 18 Aug 2014 11:05:13 -0500
from: "Englander, Douglas" <Douglas_Englander@xxxxxxxxxxxxx>
subject: Free format and /COPY


With free format H, F, and D specs, there is also the capability to
have the /COPY statement not be restricted to beginning in column 7.
That works fine for a normal RPGLE type program. However, when I
move a /COPY statement to begin in column 9, and my source is type
SQLRPGLE, the SQL Precompiler does not always seem to recognize the
/COPY statement.

I have one program with 3 /COPY statements. One is by itself in one
section of my D specs, and the other two are together in a
subsequent section of D specs. The two begin in column 9 and there
is no problem with the SQL compiler. However, when the first one is
in column 9, the SQL precompiler does not recognize it, and it looks
like it treats it as a comment. When I move that one back to begin
in column 7, the precompiler recognizes the /COPY.

Has anyone else experienced this or know if there a PTF for this?

Thank you,

Doug

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.