MSIR.0919 Object's class ((classname)) not (attribute): Difference between revisions
m (Admin moved page MSIR.0918 Object's class ((classname)) not (attribute) to MSIR.0919 Object's class ((classname)) not (attribute): msg num incorrect (from original pdf)) |
(Automatically generated page update) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
A statement requested an operation that is not enabled for the class on which it was performed. For example, if the indicated '''attribute''' is < | A statement requested an operation that is not enabled for the class on which it was performed. For example, if the indicated '''''attribute''''' is <var>Allow Narrow</var>, it indicates that either a narrowing assignment or class test was performed where the source variables class does not have Allow Narrow in its Public block. [[Narrowing assignments and class tests]] require the Allow Narrow for good reasons — these operations facilitate writing brittle, difficult to maintain, code. | ||
While the obvious solution might seem to be to put an Allow Narrow in the source class's Public block, it is best to first consider whether there might be a way of doing what the program is trying to do without requiring this. It might even be worth asking whether what the program is trying to do is correct. A common cause of this message is accidentally declaring a variable with the base class, when it really should be in the extension class. | While the obvious solution might seem to be to put an Allow Narrow in the source class's Public block, it is best to first consider whether there might be a way of doing what the program is trying to do without requiring this. It might even be worth asking whether what the program is trying to do is correct. A common cause of this message is accidentally declaring a variable with the base class, when it really should be in the extension class. | ||
Of course, if the narrowing assignment or class test is intentional and difficult to avoid, then it makes sense to add the Allow Narrow to the source class's Public block. | Of course, if the narrowing assignment or class test is intentional and difficult to avoid, then it makes sense to add the Allow Narrow to the source class's Public block. | ||
[[Category: | {{Template:MSIR.0919 footer}} | ||
[[Category:MSIR.0800 - MSIR.0999]] |
Latest revision as of 23:36, 3 March 2017
A statement requested an operation that is not enabled for the class on which it was performed. For example, if the indicated attribute is Allow Narrow, it indicates that either a narrowing assignment or class test was performed where the source variables class does not have Allow Narrow in its Public block. Narrowing assignments and class tests require the Allow Narrow for good reasons — these operations facilitate writing brittle, difficult to maintain, code.
While the obvious solution might seem to be to put an Allow Narrow in the source class's Public block, it is best to first consider whether there might be a way of doing what the program is trying to do without requiring this. It might even be worth asking whether what the program is trying to do is correct. A common cause of this message is accidentally declaring a variable with the base class, when it really should be in the extension class.
Of course, if the narrowing assignment or class test is intentional and difficult to avoid, then it makes sense to add the Allow Narrow to the source class's Public block.
Message attributes:
RETCODEO=0 | Sets online return code |
---|---|
RETCODEB=4 | Sets batch (single user) return code |
CLASS=E | Error class; the message can be suppressed with the X'04' bit setting of the MSGCTL parameter |
AUDITER | Writes the message with line type ER to the audit trail |
COUNT | Increments the error count (ERCNT) parameter |
ECHO | Displays the line that caused the error |