× 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 19-May-2014 17:24 -0500, Kurt Anderson wrote:
I have a global constant:
//dcl-c MAX_ELEMENTS 50;

Not commented, presumably.?

In a procedure, I have a variable:
dcl-s Weight char( MAX_ELEMENTS );

FWiW: That is a "named constant" rather than a literal.

Looks good, given the declaration of the constant is indeed global, and not commented-out. From the docs:

"CHAR(length)

The CHAR keyword is used in a free-form definition to indicate that the item is fixed-length character.
...
The parameter can be a literal or a named constant. If it is a named constant, the constant must be defined prior to the definition statement.
..."

The program will not compile like that.

Noted... But the compiler error was ¿what? Difficult to search on a condition whereby a compiler error is issued unexpectedly, not knowing what was diagnosed by the compiler as the unexpected error condition.

If I copy the constant into the procedure that uses it, it will
compile. (The example is simple, but in reality there are about ten
procedures that use the constant and I'm not eager to copy the one
constant into each of those procedures.)

Does anyone know if there is a PTF available for this issue? I'm at
7.1.


The v7r1m0 (r710) PTF SI52846 appears to be the latest for the ILE RPG compiler [i.e. RPGLE-CMPL for APAR title kwds; a generic search, not limited to the unexpected error message in the compiler listing]. Of the APARs listed, none conspicuously note anything about either of scope or named constant: <www.ibm.com/support/docview.wss?uid=nas3f4a2d47fe68b6dc486257ca900476b55>


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.