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



That was my late in the day not-proof-read email, sorry about that.
I actually meant to include a link to the help as well.
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzasd/dkwchar.htm?lang=en

Thanks for the correction, Chuck, on it being a Named Constant.

Sorry about the appearance of the code being commented out. I was creating a test scenario to submit in a service request - only to find out our SWMA lapsed. Ugh. (It just occurred to me, that might mean I can't even get a PTF. Anyway, management is working on resolving this.)

The error message I'm getting is:
RNF3320: The keyword parameter is not defined; keyword is ignored.

Looks like we don't have PTF SI52846, however I think I'd like to get that one. Thanks again, Chuck.

Kurt Anderson
Sr. Programmer/Analyst - Application Development, Service Delivery Platform

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Monday, May 19, 2014 9:33 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Using a literal in the CHAR keyword.

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

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.