Despite the range name, most of these are ordinary source errors, not compiler faults. The two genuine compiler faults are TRN3003 and TRN3004.
| Code | Message | Cause | Resolution |
|---|---|---|---|
| TRN3001 | MOVEL between source and result type combination (target={t}, type={t}) is not supported | A MOVEL between a type pair the compiler does not support (e.g. character to date/time without format conversion). |
Convert explicitly with a BIF (%CHAR, %DATE, %TIME, …) and assign with EVAL. |
| TRN3001 | Zone-move source type not supported: {type} · Zone-move target type not supported: {type} | MHHZO / MHLZO / MLHZO / MLLZO on a field that is not packed, zoned, or integer. Character fields in zone-move operations are not supported. |
Apply zone moves to packed, zoned, or integer fields. |
| TRN3001 | MOVEA target array '{name}' is not a supported type | See TRN3023. | See TRN3023. |
| TRN3001 | Built-in function '%{bif}' is not supported | A built-in function Triton RPG does not support. Normally reported as TRN2001. | Use a supported BIF. |
| TRN3001 | %SIZE second argument must be *ALL | The two-argument %SIZE form was written with something other than *ALL as its second argument. |
*ALL is the only second argument %SIZE accepts. Use %SIZE(name) for one element, %SIZE(name : *ALL) for the whole allocation. |
| TRN3001 | %SIZE requires a known variable / scalar variable or data structure; argument is not resolvable | %SIZE was applied to something that is not a resolvable variable or data structure. |
Apply %SIZE to a declared variable, subfield, or data structure. |
| TRN3001 | %ADDR of the {variable / data-structure subfield} '{name}' is not supported … | %ADDR of an item with no addressable byte storage. It is rejected rather than given an invented address. |
Take the address of a module-level variable, a byte-backed data-structure subfield, a by-reference parameter, or a standalone array element. |
| TRN3001 | %HIVAL / %LOVAL is not supported for operand type {type} … | See TRN2003. | See TRN2003. |
| TRN3002 | Special value *{name} is not supported. Supported: *ON, *OFF, *YES, *NO, *ZERO, *BLANK, *NULL, *HIVAL, *LOVAL, *ALL | A figurative constant Triton RPG does not support. | Use one of the supported special values. |
| TRN3002 | Duration BIF must be on the right side of date/time arithmetic (e.g. myDate + %DAYS(n), not %DAYS(n) + myDate) | The expression puts the duration first, which has no defined result. | Write the date or timestamp operand first. |
| TRN3002 | %XFOOT operand '{name}' is not a resolved array | %XFOOT was given something that is not a declared array. |
Pass a DIM array. |
| TRN3005 | OPTIONS(*TRIM) on '{param}' requires a character parameter passed by CONST or VALUE | *TRIM on a non-character parameter, or on one passed by reference. Varying-length character is allowed, as is a pointer that also specifies OPTIONS(*STRING). |
Restrict OPTIONS(*TRIM) to character parameters - or *STRING pointers - passed by CONST or VALUE. |
| TRN3006 | OPTIONS(*RIGHTADJ) on '{param}' requires a non-varying character parameter passed by CONST or VALUE | *RIGHTADJ on a non-character, varying-length, or by-reference parameter. |
Restrict OPTIONS(*RIGHTADJ) to fixed-length character parameters passed by CONST or VALUE. |
| TRN3007 | OPTIONS(*STRING) on '{param}' requires a basing-pointer parameter passed by CONST or VALUE | *STRING on a parameter that is not a basing pointer, or on a pointer passed by reference. |
Declare the parameter POINTER CONST or POINTER VALUE. |
| TRN3008 | Parameter {n} of procedure '{proc}' is passed {mode} in the interface but {mode} in the prototype; the passing mode must match | DCL-PI and DCL-PR disagree on a parameter's passing mode (by reference vs VALUE vs CONST). Mirrors IBM i RNF3774/RNF3907. |
Make the passing mode identical on the corresponding PR and PI parameters. |
| TRN3009 | Parameter {n} of procedure '{proc}' specifies OPTIONS({flags}) differently from the prototype; the OPTIONS keyword must match | DCL-PI and DCL-PR disagree on a parameter's OPTIONS(...). Mirrors IBM i RNF3773. |
Specify the same OPTIONS(...) on both. |
| TRN3010 | A {kind} value cannot be used where a character value is required - convert it explicitly with %CHAR, %EDITC or %EDITW | A date, time, timestamp, float or zoned operand is used where a character value is required: the argument of a character built-in such as %TRIM, %SUBST or %XLATE, or an operand of a concatenation. IBM i rejects the same source (RNF0371, RNF0361, RNF0577, RNF7421). |
Convert the value explicitly - %CHAR(field), or %EDITC/%EDITW for a numeric you want formatted. A packed value and an indicator are accepted directly. |
| TRN3011 | Call to '{proc}' passes {n} argument(s) but the prototype requires at least {m} - a mandatory parameter is missing | The call omits a mandatory parameter. Only a trailing run of OPTIONS(*NOPASS) parameters may be omitted. |
Pass every mandatory parameter. An OPTIONS(*OMIT) parameter must still be supplied, as *OMIT. |
| TRN3012 | Call to '{proc}' passes {n} argument(s) but the prototype declares only {m} parameter(s) | The call passes more arguments than the prototype declares. | Remove the extra arguments. |
| TRN3013 | Parameter '{param}' must specify OPTIONS(*NOPASS) because it follows an OPTIONS(*NOPASS) parameter | A mandatory parameter follows an optional one. *NOPASS parameters must form a trailing run. Mirrors IBM i RNF3756. |
Add OPTIONS(*NOPASS) to every parameter after the first one, or reorder so mandatory parameters come first. |
| TRN3014 | XML-INTO %HANDLER requires a handler procedure name · names undefined procedure '{name}' · must declare three parameters (commArea, array, count) · the second parameter must be an array (DIM) | The XML-INTO %HANDLER procedure is missing, undeclared, or does not match the required interface. |
Declare the handler with exactly three parameters - communication area, a DIM array of mapped elements, and a count - returning a 4-byte integer. |
| TRN3016 | XML-INTO %HANDLER requires the 'path' option to identify the repeated element | The %HANDLER form was used with no path= option, so there is no repeated element to batch. |
Add path=... to the %XML options, e.g. %xml(doc : 'path=Customers/Company case=any'). |
| TRN3017 | The loop index '{name}' used in a FOR operation is not valid; the index must be a numeric field with zero decimal positions | A FOR index is a float, character, date/time, indicator, pointer, or a packed/zoned field with a non-zero scale. |
Declare the index as INT(10), UNS(10), or a zero-scale packed/zoned field. |
| TRN3018 | Undefined operand '{name}' - resolves to no variable, parameter, data-structure subfield, named constant, or field | An expression names something not in scope. Mirrors IBM i RNF7030. | Declare the name, or correct the reference. |
| TRN3019 | Unsupported GET DIAGNOSTICS item '{item}' | GET DIAGNOSTICS requested an item that cannot be faithfully sourced from JDBC. Supported items: ROW_COUNT, DB2_NUMBER_ROWS, DB2_RETURNED_SQLCODE, RETURNED_SQLSTATE, MESSAGE_TEXT, MESSAGE_LENGTH, NUMBER, MORE, DB2_RETURN_STATUS, CONDITION_NUMBER, CONNECTION_NAME, DB2_SQL_NESTING_LEVEL. IBM-specific items with no JDBC equivalent (DB2_MESSAGE_ID, DB2_MESSAGE_KEY, DB2_ORDINAL_TOKEN_n, DB2_TOKEN_COUNT) are permanently unsourceable on non-Db2-for-i backends. |
Request a supported item, or read SQLCODE / SQLSTATE directly. |
| TRN3020 | XML-SAX requires a %HANDLER handler procedure name · names undefined procedure '{name}' · must declare five parameters (commArea, event, string, stringLen, exceptionId) | The XML-SAX handler is missing, undeclared, or does not match the required interface. |
Declare the handler with exactly five parameters - communication area, event, string pointer, string length, exception id - returning a 4-byte integer. |
| TRN3021 | XML-SAX %HANDLER procedure '{name}': the third parameter (string) must be a pointer | The handler's third parameter is not a pointer. The event data is read through a BASED variable over that pointer. |
Declare it POINTER VALUE and read the data with a BASED variable, e.g. dcl-s data char(200) based(string);. |
| TRN3022 | Unsupported {value} on character field '{name}' | A character field declares a CCSID the compiler cannot collate faithfully. Supported SBCS EBCDIC pages: 37, 273, 277, 278, 280, 284, 285, 297, 500, 871, 1047 plus Euro variants 1140 - 1147. SBCS ASCII: 819, 850. Unicode: 1208 (*UTF8). Permanently unsupported: CCSID(*HEX)/65535 (raw byte-identity storage has no JVM equivalent - Unicode round-tripping does not preserve EBCDIC byte order), CCSID(*JOBRUNMIX) (mixed-byte DBCS requires shift-in/shift-out state tracking with no JVM equivalent). UCS-2 CCSIDs (13488, 1200) on a character field are rejected matching IBM i's RNF3818. |
Declare the field with a supported CCSID: CCSID(37), one of the European pages 273, 277, 278, 280, 284, 285, 297 or 871, any Euro variant (1140 - 1147), CCSID(500), CCSID(1047), CCSID(819), CCSID(850), or CCSID(*UTF8). |
| TRN3023 | MOVEA target array '{name}' must be character or zoned type · MOVEA to non-character scalar '{name}' is not valid | MOVEA operates character-by-character across array boundaries. Packed, integer, unsigned, float, and binary arrays are rejected (IBM reports RNF7262 at severity 30). Scalar targets must be character. | Use a character or zoned array, or use a loop with individual element assignment for other types. |
| TRN3023 | %SIZE: invalid INT size {n} / invalid UNS size {n} | %SIZE of an INT/UNS at a width outside 3, 5, 10, 20. Only these four widths are defined - any other is a source error. |
Use INT(3), INT(5), INT(10), or INT(20). |
| TRN3023 | %SIZE: type {type} has no defined byte size | %SIZE of a type with no storage size (e.g. an OBJECT field). |
Apply %SIZE to a type with defined storage (character, numeric, pointer, etc.). |
| TRN3023 | MOVE to target type {type} is not valid | MOVE to a target whose type has no defined conversion (pointer, graphic, object, binary). |
Convert explicitly with a BIF and assign with EVAL. |
| TRN3024 | Output field '{name}' is not defined | An O-spec output field names something not in scope and not a reserved word (*DATE, PAGE, …). Rather than print a blank field where data was intended, it is rejected. Mirrors IBM i RNF7030. |
Declare the field, or correct the O-spec. |
| TRN3025 | FROMFILE is not supported for an array of this type ('{name}'); a pre-runtime array must be character, packed, zoned, integer, unsigned, or float | A pre-runtime array (FROMFILE) was declared with an element type that has no load path - for example a date, time, timestamp, or data-structure array. It is rejected rather than loaded incorrectly. |
Declare the pre-runtime array with a character or numeric element type, or populate the array in code instead of with FROMFILE. |
| TRN3026 | FROMFILE is not allowed in a free-form declaration ('{name}'); a pre-runtime array must be declared on a fixed-format D-spec | FROMFILE or TOFILE was used on a free-form DCL-S. A pre-runtime array is a fixed-format construct: IBM i rejects the keyword there too (RNF3558), and ignoring it would leave a plain run-time array with no data loaded. |
Declare the pre-runtime array on a fixed-format D-spec, or load the array in code (for example by reading the file into it). |
| TRN3028 | FROMFILE names '{file}', which is not a declared file ('{name}'); a pre-runtime array's table file must also be declared on an F-spec | The file a pre-runtime array reads from was never declared. IBM i rejects this too (RNF7030, plus RNF3443 against the keyword). Without the declaration there is nothing to read the array from, and it would simply stay at zero. | Declare the table file on an F-spec, e.g. FRATETBL IT F 5 DISK. |
| TRN3029 | Generated method '{method}' exceeds the JVM 64KB method-size limit ({n} bytes); break the oversized routine into smaller procedures or subroutines | A single generated JVM method exceeded the 64KB bytecode limit the JVM imposes on one method. IBM i has no such per-method limit, so a very large monolithic routine that compiles there fails here. This diagnostic names the oversized routine - a run() body or a subprocedure body. |
Move blocks of logic out of the oversized routine into separate subprocedures (DCL-PROC) or subroutines (BEGSR), so each generated method stays under the limit. |
| TRN3030 | Output field '{name}' has a type that cannot be rendered on an output specification | An O-spec output field has a type with no character external form - for example a pointer. Character, numeric (packed/zoned/integer/unsigned), float, and date/time/timestamp fields all render; anything else is rejected rather than printed as blanks. | Remove the field from the output specification, or output a renderable field derived from it. |
| TRN3031 | CTL-OPT NOMAIN requires --lib mode: a NOMAIN module has no main procedure to run. Compile it with --lib to build a service module. | A CTL-OPT NOMAIN (or fixed-format H-spec NOMAIN) source was compiled in program mode. A NOMAIN module has no main procedure, so it cannot be built as a runnable program - only as a service module. |
Add --lib to build the source as a service module. |
| TRN3032 | MOVE / MOVEL Factor 2 must be '0' or '1' when the result is an indicator; '{value}' is not a valid indicator literal | A MOVE or MOVEL targets an indicator - numbered (*INxx), *INLR, control level (*INL1-*INL9), external (*INU1-*INU8), or halt (*INH1-*INH9) - with a character literal Factor 2 that is not exactly '0' or '1'. An indicator is one byte, and IBM i rejects any other literal at compile time (RNF5184) rather than aligning it. A variable or expression source is allowed - only its aligned character reaches the indicator (rightmost for MOVE, leftmost for MOVEL), ON iff '1'. |
Move '0' or '1', or move a character variable whose aligned character carries the intended state. |
| TRN3034 | The SQL statement could not be interpreted - its shape is not recognized: {statement} | An embedded SQL statement whose structure Triton RPG must resolve - a SELECT ... INTO, a cursor DECLARE / OPEN / FETCH / CLOSE, ASSOCIATE LOCATORS, ALLOCATE CURSOR, or GET DIAGNOSTICS - uses syntax Triton RPG does not recognize, so where its clauses begin and end cannot be determined. The statement is rejected rather than compiled from a guess at its shape, which would emit SQL that differs from what you wrote. This code is raised only for the statement forms listed above; other statements are not affected. |
Rewrite the statement in a form the compiler models - most often by simplifying the clause the message points at. For a SELECT ... INTO, moving the query into a cursor DECLARE and fetching from it is usually enough. |
| TRN3035 | The type or attributes of argument {n} do not meet the OPTIONS(*EXACT) requirements of parameter '{name}' in procedure '{proc}' | The procedure declares a parameter with OPTIONS(*EXACT), which requires the caller to pass an argument of exactly the same type, length, precision, and scale. The argument you passed has a different size or type. IBM i issues RNF3249 for this error. |
Declare or cast the argument to exactly match the parameter's type and length. For example, if the parameter is CHAR(10), pass a CHAR(10) variable - not a CHAR(20). |
| TRN3033 | FETCH {orientation} is not valid on Db2 for i / FETCH {BEFORE|AFTER} takes no INTO clause | Either the FETCH names ABSOLUTE, which does not exist on Db2 for i at all - it is rejected (SQL0104), so accepting it would invent a construct the platform does not have - or a FETCH BEFORE / FETCH AFTER carries an INTO clause. Those two position the cursor without returning a row, so there is nothing to assign; IBM i rejects the clause with SQL0104 severity 30 ("Token INTO was not valid. Valid tokens: <end-of-statement> FOR USING"). |
For ABSOLUTE, use FETCH RELATIVE n, or FETCH FIRST followed by FETCH RELATIVE n. For BEFORE/AFTER, drop the INTO and follow the positioning FETCH with a FETCH NEXT or FETCH PRIOR to read the adjacent row. |
| TRN3036 | Host variable ':{name}' in an EXEC SQL statement is not a defined field or local variable | An embedded SQL statement binds a host variable - a :name reference in an INTO, VALUES, SET, WHERE, or USING position - that no field or local variable defines. The reference is rejected rather than bound as SQL NULL: silently substituting NULL for an unresolved name would store NULL where the program named a value, corrupting data with no error. |
Declare the host variable, or correct the name to match a declared field or local variable. |
| TRN3037 | Multi-row FETCH target '{name}' is not a data structure | A FETCH cursor FOR n ROWS INTO :target names a host variable that is not a DIM data structure array. A multi-row FETCH target must be a host-structure array so the fetched rows can be stored element by element. |
Declare the target as a DCL-DS ... QUALIFIED DIM(n) data structure array whose subfields match the cursor's select list. |
| TRN3038 | Cannot resolve subfield layout for '{ds}.{subfield}' in multi-row FETCH | The compiler could not determine the byte layout of a subfield in the data structure array used as a multi-row FETCH target. Each fetched column must be decoded into the subfield's declared type; without a resolved layout the store would corrupt data. | Verify that the data structure and its subfields are declared with supported types and that the subfield name matches the cursor's select list column. |
| TRN3039 | Row-count host variable '{name}' must be a numeric type | A FETCH FOR :n ROWS, GET DIAGNOSTICS :n = ROW_COUNT, or similar SQL statement names a host variable for a row count that is not a numeric type (INT, PACKED, ZONED, or FLOAT). IBM i's SQL precompiler rejects non-numeric row-count targets at compile time. |
Declare the host variable as a numeric type - INT(5), INT(10), PACKED(n:0), or UNS(5) are typical choices. |