| TRN1528 |
No prototype is specified for exported procedure '{name}', and REQPREXP(*REQUIRE) is specified |
CTL-OPT REQPREXP(*REQUIRE) is in effect and an EXPORTed procedure has no matching DCL-PR. |
Declare a prototype for the procedure, or relax REQPREXP. |
| TRN1530 |
Variable '{name}' is declared CONST and cannot be modified |
An assignment targets a CONST variable. |
Assign to a non-CONST variable, or drop the CONST keyword if the value is meant to change. |
| TRN1531 |
Enumeration '{name}' has more than one DFT constant; at most one constant may be marked as the default |
A DCL-ENUM marks two or more constants DFT. |
Mark at most one constant DFT. |
| TRN1532 |
Variable '{name}' is typed to enumeration '{enum}'; assign an enum constant, not a literal |
A numeric literal was assigned to an enumeration-typed variable. |
Assign one of the enumeration's constants. |
| TRN1533 |
The types of the left- and right-hand side do not match on the assignment; numeric and character are not assignment-compatible |
An assignment has a numeric operand on one side and a character operand on the other. RPG does not convert implicitly across an assignment. Mirrors IBM i RNF7416. |
Convert explicitly: %CHAR, %EDITC, or %EDITW to render a number as character; %DEC, %INT, or %UNS to parse character as numeric. |
| TRN1534 |
Implicit string conversion between graphic (DBCS) and character or UCS-2 data is not supported … |
An assignment or comparison mixes a graphic (G / GRAPH / VARGRAPH) operand with character or UCS-2 data. Graphic data has no assumed CCSID under the module default CCSID(*GRAPH:*IGNORE), so no implicit conversion exists in either direction. UCS-2 (C / UCS2) is different: it has a real CCSID, and character-to-UCS-2 converts implicitly. Mirrors IBM i RNF0659. |
Convert explicitly: %CHAR to render graphic data as character, %GRAPH or %UCS2 to convert in the other direction - or declare the field UCS2 if Unicode character data is what it actually holds. |
| TRN1535 |
Procedure '{name}' does not return a value and cannot be used in an expression |
A call to a procedure declared with no return value (a DCL-PI *N; with no type, LIKE, or LIKEDS) is used where a value is required - the right-hand side of an assignment, an operand, or a condition. Its result does not exist. Calling it as a standalone statement (CALLP) remains valid. Mirrors IBM i RNF5403. |
Give the procedure a return type if it should produce a value, or call it as a statement rather than reading a result from it. |
| TRN1536 |
Subfield '{name}' has no defined type; a data structure subfield must specify a type, a length, or LIKEDS |
A named data-structure subfield was declared with no data type, length, LIKE, or LIKEDS - so it has no definition. Mirrors IBM i RNF7030 ("The name … is not defined"). |
Give the subfield a data type or length, or define it with LIKE(field) to inherit another field's type or LIKEDS for a nested data structure. |
| TRN1537 |
LIKE references undefined field '{name}' |
A LIKE(name) keyword - on a standalone field (DCL-S or a fixed-format D-spec), a data-structure subfield, or a prototype parameter - names a field that is not defined anywhere in the program. The LIKE target may be another standalone field or a data-structure subfield (referenced bare for a non-qualified structure, or as dsName.subfield for a qualified one), but it must exist. The new field is not given a fallback type. Mirrors IBM i RNF7030 ("The name … is not defined"). |
Define the referenced field, or correct the name (check spelling and, for a qualified data structure, the dsName. qualifier). |
| TRN1538 |
A character operand is not compatible with the arithmetic negation operator; convert it to numeric first (%DEC, %INT, or %UNS) |
A unary minus is applied to a character value (e.g. -charField). Arithmetic operators require numeric operands; RPG does not implicitly parse a character field as a number. Mirrors IBM i RNF7421 ("Operands are not compatible with the type of operation"). A character-valued expression assigned into a numeric field is reported separately as TRN1533. |
Convert the character value to numeric explicitly with %DEC, %INT, or %UNS before negating. |
| TRN1539 (warning) |
The array index is character; an array index must be numeric. The index is not valid, so the reference is not evaluated and the statement does not run |
An array is subscripted with a character value (e.g. arr(charField)). This is a warning, not an error, because IBM i also accepts the program: IBM reports RNF0530 at severity 20. The compiled program therefore skips the whole statement, leaving its target at its previous value - it is not set to blanks and not taken from element 1. |
Use a numeric index, or convert the character value with %DEC, %INT, or %UNS. Note the statement silently does nothing until you do. |
| TRN1540 |
The operand of {bif} is character / is an indicator; {bif} requires a numeric operand |
A numeric-only built-in function (%ABS, %SQRT, %DIV, %REM) is given a character or indicator operand. RPG does not implicitly convert these to numbers. An indicator is boolean, not numeric - %ABS of an indicator is rejected by IBM at severity 30 (RNF0336). |
For a character operand, convert explicitly with %DEC, %INT, or %UNS. For an indicator, use the numeric field the indicator represents. |
| TRN1541 |
The Factor 2 operand *SYS is not valid for the {MOVE/MOVEL} operation - *SYS initializes a field with INZ, it is not a value that can be moved |
*SYS was used as the Factor 2 of a MOVE or MOVEL. It is an INZ keyword value (INZ(*SYS) gives a date, time, or timestamp field the current system value), not a data operand, so it is rejected for every result type - character as well as date. Mirrors IBM i RNF7260. |
Use INZ(*SYS) on the declaration, or assign the current value with %DATE(), %TIME(), or %TIMESTAMP(). |
| TRN1542 |
Factor 2 entry {*BLANKS/*ZEROS} is not valid for the {MOVE/MOVEL} operation into date/time/timestamp field '{name}' |
A blank or zero figurative constant was moved into a date, time, or timestamp result. Those constants carry no date or time value. They remain valid for a character or numeric result. Mirrors IBM i RNF7507. |
Move *LOVAL for the type's lowest value (0001-01-01 / 00.00.00), *HIVAL for its highest, or a date literal. |
| TRN1543 |
DSPLY factor 1 must be a field, named constant, literal, array element, indicator or reserved word - '{operand}' is none of those (fixed-format factor 1 holds a single operand, not an expression; use the free-format DSPLY form for an expression) |
A built-in function, an operator expression, or a figurative constant was written in the factor 1 of a fixed-format DSPLY. Factor 1 holds a single operand, not an expression. IBM i diagnoses the same source (RNF0372, RNF0289, or RNF5261, all severity 20) and then drops the operand, so the program displays a blank message - accepting it would display a value where IBM i displays nothing. |
Assign the expression to a field first and name that field in factor 1, or use the free-format DSPLY form, whose operand is an expression. |
| TRN1544 |
%EDITC requires a numeric operand; a relational or logical expression is an indicator value, which cannot be edited (convert it first with %DEC or %INT if a 1/0 is wanted) |
%EDITC was applied to a comparison or a logical expression. Such an expression yields an indicator value, and an indicator cannot be edited. IBM i rejects the same source with RNF7059 ("Editing is not valid with a field that is not numeric"). Triton RPG accepts the same operand for %CHAR, %DEC, %INT and %FLOAT, which convert it as the indicator 1 or 0. |
Convert first - %EDITC(%DEC(a > b : 1 : 0) : '1') - or edit a numeric field instead. |
| TRN1546 |
The separator on '{format}' is not valid for {format}; {format} accepts only '{sep}' (or 0 for none) |
A date or time format word carries a separator suffix the format does not admit - for example *ISO/, when *ISO renders yyyy-mm-dd and takes only -. The two-digit-year formats (*MDY, *DMY, *YMD, *JUL) accept / - . , &; a four-digit-year format accepts only the separator it already uses. 0 (no separator) is accepted by all of them. Mirrors IBM i RNF5290 ("The Date Separator is not valid"), which IBM issues at severity 20 - enough to stop program creation at the default GENLVL. |
Use a separator the format admits, or drop the suffix and let the format use its own. |
| TRN1547 |
The date/time format followed by a zero is not allowed on a declaration - {format} with its default separator takes effect |
A date or time field declaration carries the 0 (no-separator) suffix - for example DATE(*MDY0) or TIME(*HMS0). The zero suffix is valid in a conversion context like %CHAR(d : *MDY0), where it controls the output, but a field declaration always stores the date with its format's default separator. The zero suffix is stripped and the base format applies. Mirrors IBM i RNF0619 ("The Date Format followed by a zero is not allowed"), severity 20. |
Drop the 0 suffix from the declaration: DATE(*MDY). To produce a no-separator string, use %CHAR(d : *MDY0) at the point of conversion. |
| TRN1548 |
'{bif}' cannot be used as an assignment target |
A built-in function that does not designate storage appears on the left-hand side of an assignment - for example %TRIM(x) = 'a'. Only %SUBST, %STR, %SUBARR, %LEN, %NULLIND, %OCCUR, and %ELEM can be assigned to. |
Assign to the underlying field, or use one of the built-in functions that is valid as an assignment target. |
| TRN1545 |
A nested DCL-DS is valid only inside a QUALIFIED data structure; add QUALIFIED to '{name}' or declare the group's subfields directly |
A DCL-DS was written inside another DCL-DS that is not QUALIFIED. A nested group's leaves are reached only by the dotted path parent.group.leaf, which an unqualified structure has no way to express. Mirrors IBM i RNF3221 ("A nested data structure subfield cannot be defined when the parent data structure is not qualified"), which IBM issues at severity 30. |
Add QUALIFIED to the enclosing DCL-DS, or drop the nesting and declare the group's subfields directly in the parent. |