IBM Support

RPG Cafe: Temporary environment variables

News


Abstract

Information about environment variables used by the compiler to temporarily introduce new behavior

Content

You are in: RPG Cafe Temporary environment variables

Short URL: https://ibm.biz/rpgcafe_temp_envvars

 

When the RPG compiler introduces a fix through a PTF, an environment variable may be needed to obtain the new behavior.

When the RPG compiler introduces a new error message through a PTF, an environment variable may be needed to cause the compiler to issue the error message.

This happens when the old behavior might be seen as beneficial by some RPG programmers, or when RPG programmers might have coded a work-around for the problem.

These environment variables must be present at compile time. They are not needed after the module or program is compiled.

For a later release or target release, the RPG compiler changes so that the new behavior is the default. Now, the environment variable is needed if RPG programmers still need the old behavior.

Usually, the default behavior for a particular environment variable is tied to a target release.

In the following information, the PTFs listed are the first PTF to check for the environment variable. In most cases, the PTFs have been superseded but the superseding PTFs provide the same behavior.

Environment variableBrief description of the problemWhen addedType
QIBM_RPG_ALLOW_DATA_GEN_HEX_OUTPUT_VAR_OPTSThe compiler allows the first operand of %DATA for the DATA-INTO operation to have CCSID(*HEX). This might cause RNX9998 at runtime if the "doc=file" option is not specified.2025Issue future error
QIBM_RPG_ALLOW_LITERAL_FOR_LIKE_EXACT_PARMThe compiler does not allow a literal to be passed to a parameter defined with LIKE and OPTIONS(*EXACT).2025Enable future fix
QIBM_RPG_FIX_DS_CCSID_EXACT_EXTFLDThe compiler did not always set the correct CCSID for a subfield in a data structure defined with CCSID(*EXACT) when the external subfield was explicitly specified with the EXTFLD keyword.2024Enable future fix
QIBM_RPG_CORRECT_INZ_EXTDFT_CHARThe compiler did not handle INZ(*EXTDFT) correctly when the CCSID of the initialization value in the database file was different from either the compile-time CCSID or the CCSID of the subfield.2024Enable future fix
QIBM_RPG_CHK_ALL_CONST_IN_SUBPROCThe compiler sometimes allowed a global CONST parameter to be changed in a subprocedure2023Issue future error
QIBM_RPG_CORRECT_OBJECT_LOOKUPThe compiler always returned zero when using %LOOKUP with an object array.2023Enable future fix
QIBM_RPG_CHK_TRIM_CCSIDSThe compiler assumed that the CCSID of the second operand of %TRIMx was the same as the first operand. Note: This environment variable is no longer relevant starting with TGTRLS(V7R5M0) since the compiler now automatically converts the second operand to the CCSID of the first operand, if necessary.2022N/A
QIBM_RPG_ALLOW_SCAN_ZERO_LEN%SCAN could not search a zero length string2022Enable future fix
QIBM_RPG_HANDLE_CCSID_LIKEFILEWhen a file is defined with the LIKEFILE keyword some required CCSID conversions might not be done when a data structure is used with the file for an I/O operation.2022Enable future fix
QIBM_RPG_HANDLE_CCSID_ALL_DS_IOWhen a data structure is defined with LIKEREC(*ALL) or EXTNAME(*ALL), some required CCSID conversions might not be done when the data structure is used as the result field for an I/O operation.2022Enable future fix
QIBM_RPG_INTO_OPS_INCREASE_DIM_AUTOXML-INTO and DATA-INTO do not increase DIM(*AUTO) dimension2021Enable future fix

QIBM_RPG_ALLOW_DATA_GEN_HEX_OUTPUT_VAR_OPTS

By default, the compiler allows the first operand of %DATA for the DATA-INTO operation to have CCSID(*HEX) when the options are specified by a variable.

With the following PTFs, if compile-time environment variable QIBM_RPG_ALLOW_DATA_GEN_HEX_OUTPUT_VAR_OPTS is present with value 'N', the compiler does not allow the first operand of %DATA for the DATA-INTO operation to have CCSID(*HEX) when the options are specified by a variable.

  • 7.4 TGTRLS(*CURRENT): 5770WDS SJ06910
  • 7.5 TGTRLS(*CURRENT): 5770WDS SJ06911
  • 7.5 TGTRLS(V7R4M0): PTF not available yet
  • 7.6 TGTRLS(*CURRENT): 5770WDS SJ06913
  • 7.6 TGTRLS(V7R5M0): 5770WDS SJ08092
  • 7.6 TGTRLS(V7R4M0): PTF not available yet

 

ADDENVVAR QIBM_RPG_ALLOW_DATA_GEN_HEX_OUTPUT_VAR_OPTS VALUE('N')

For a future target release, the compiler will default to not allowing the first operand of %DATA for the DATA-INTO operation to have CCSID(*HEX).

If you need time to change the CCSID of the variable specified as the first parameter of %DATA, you can specify the same environment variable with value 'Y' to cause the compiler to behave the old way.

QIBM_RPG_ALLOW_LITERAL_FOR_LIKE_EXACT_PARM

By default, the compiler does not allow a literal to be passed to a parameter defined with LIKE and OPTIONS(*EXACT).

With the following PTFs, if compile-time environment variable QIBM_RPG_ALLOW_LITERAL_FOR_LIKE_EXACT_PARM is present with value 'Y', the compiler allows a literal to be passed to a parameter defined with LIKE and OPTIONS(*EXACT).

  • 7.4 TGTRLS(*CURRENT): 5770WDS SJ06284
  • 7.5 TGTRLS(*CURRENT): 5770WDS SJ06525
  • 7.5 TGTRLS(V7R4M0): PTF not available yet
  • 7.6 TGTRLS(*CURRENT): 5770WDS SJ06913
  • 7.6 TGTRLS(V7R5M0): 5770WDS SJ08092
  • 7.6 TGTRLS(V7R4M0): PTF not available yet

 

Note: Allowing this might cause the compiler to now disallow a call to a prototype defined with the OVERLOAD keyword if more than one candidate prototype is now valid for the call.

ADDENVVAR QIBM_RPG_ALLOW_LITERAL_FOR_LIKE_EXACT_PARM VALUE('Y')

For a future target release, the compiler will default to allowing a literal to be passed to a parameter defined with LIKE and OPTIONS(*EXACT).

If you have a new error related to a prototype defined with the OVERLOAD keyword, you can specify the same environment variable with value 'N' to cause the compiler to behave the old way.

QIBM_RPG_FIX_DS_CCSID_EXACT_EXTFLD

Prior to TGTRLS(V7R6M0), the compiler did not always set the correct CCSID for a subfield in a data structure defined with CCSID(*EXACT) when the external subfield was explicitly specified with the EXTFLD keyword.

With the following PTFs, if compile-time environment variable QIBM_RPG_FIX_DS_CCSID_EXACT_EXTFLD is present with value 'Y', the compiler handles CCSID correctly for subfields in a data structure defined with CCSID(*EXACT).

  • 7.3 TGTRLS(*CURRENT): 5770WDS SJ00678
  • 7.4 TGTRLS(*CURRENT): 5770WDS SJ00635
  • 7.4 TGTRLS(V7R3M0): 5770WDS SJ00684
  • 7.5 TGTRLS(*CURRENT): 5770WDS SJ00650
  • 7.5 TGTRLS(V7R4M0): 5770WDS SJ00653
  • 7.5 TGTRLS(V7R3M0): 5770WDS SJ00685
  • 7.6 TGTRLS(V7R5M0): No PTF is required
  • 7.6 TGTRLS(V7R4M0): No PTF is required

 

ADDENVVAR QIBM_RPG_FIX_DS_CCSID_EXACT_EXTFLD VALUE('Y')

Starting with TGTRLS(V7R6M0), the compiler defaults to handling INZ(*EXTDFT) correctly.

If you had coded a work-around for the problem and your program is now behaving incorrectly, you can specify the same environment variable with value 'N' to cause the compiler to behave the old way.

QIBM_RPG_CORRECT_INZ_EXTDFT_CHAR

Prior to TGTRLS(V7R6M0), the compiler did not handle INZ(*EXTDFT) correctly when the CCSID of the initialization value in the database file was different from either the compile-time CCSID or the CCSID of the subfield.

With the following PTFs, if compile-time environment variable QIBM_RPG_CORRECT_INZ_EXTDFT_CHAR is present with value 'Y', the compiler handles INZ(*EXTDFT) correctly.

  • 7.4 TGTRLS(*CURRENT): 5770WDS SJ02501
  • 7.5 TGTRLS(*CURRENT): 5770WDS SJ02922
  • 7.5 TGTRLS(V7R4M0): 5770WDS SJ02923
  • 7.6 TGTRLS(V7R5M0): No PTF is required
  • 7.6 TGTRLS(V7R4M0): No PTF is required

 

ADDENVVAR QIBM_RPG_CORRECT_INZ_EXTDFT_CHAR VALUE('Y')

Starting with TGTRLS(V7R6M0), the compiler defaults to handling INZ(*EXTDFT) correctly.

If you had coded a work-around for the problem and your program is now behaving incorrectly, you can specify the same environment variable with value 'N' to cause the compiler to behave the old way.

QIBM_RPG_CHK_ALL_CONST_IN_SUBPROC

Prior to TGTRLS(V7R6M0), the compiler allowed an operation in a sub-procedure that modified a global constant parameter in the following scenarios:

  • The first operand of DATA-INTO
  • The first operand of DEALLOC
  • The first operand of EVAL-CORR
  • The first operand of ON-EXIT
  • The first operand of XML-INTO
  • The result field of DSPLY

 

With the following PTFs, if compile-time environment variable QIBM_RPG_CHK_ALL_CONST_IN_SUBPROC is present with value 'Y', the compiler issues an error message in those scenarios.

  • 7.3 TGTRLS(*CURRENT): 5770WDS SJ00678
  • 7.4 TGTRLS(*CURRENT): 5770WDS SJ00635
  • 7.4 TGTRLS(V7R3M0): 5770WDS SJ00684
  • 7.5 TGTRLS(*CURRENT): 5770WDS SJ00650
  • 7.5 TGTRLS(V7R4M0): 5770WDS SJ00653
  • 7.5 TGTRLS(V7R3M0): 5770WDS SJ00685
  • 7.6 TGTRLS(V7R5M0): No PTF is required
  • 7.6 TGTRLS(V7R4M0): No PTF is required

 

ADDENVVAR QIBM_RPG_CHK_ALL_CONST_IN_SUBPROC VALUE('Y')

Starting with TGTRLS(V7R6M0), the compiler always issues an error message in those scenarios.

QIBM_RPG_CORRECT_OBJECT_LOOKUP

Prior to TGTRLS(V7R6M0), the compiler always returned zero when using %LOOKUP with an object array and it always returned *OFF when using the IN operator with an object array.

With the following PTFs, if compile-time environment variable QIBM_RPG_CORRECT_OBJECT_LOOKUP is present with value 'Y', the compiler handles %LOOKUP and the IN operator correctly.

  • 7.4 TGTRLS(*CURRENT): 5770WDS SI83497
  • 7.5 TGTRLS(*CURRENT): 5770WDS SI83480
  • 7.5 TGTRLS(V7R4M0): 5770WDS SI83496
  • 7.6 TGTRLS(V7R5M0): No PTF is required
  • 7.6 TGTRLS(V7R4M0): No PTF is required

 

ADDENVVAR QIBM_RPG_CORRECT_OBJECT_LOOKUP VALUE('Y')

Starting with TGTRLS(V7R6M0), the compiler searches object arrays correctly.

QIBM_RPG_CHK_TRIM_CCSIDS

Prior to TGTRLS(V7R6M0), the compiler assumed that the CCSID of the second operand of %TRIM (and %TRIML and %TRIMR) was the same as the first operand. This could result in incorrect characters being trimmed.

With the following PTFs, if compile-time environment variable QIBM_RPG_CHK_TRIM_CCSIDS is present with value 'Y', the compiler issues an error message if the CCSID of the second operand is different from the first operand.

  • 7.4 TGTRLS(*CURRENT): 5770WDS SI81749
  • 7.5 TGTRLS(V7R4M0): 5770WDS SI81819

 

ADDENVVAR QIBM_RPG_CHK_TRIM_CCSIDS VALUE('Y')

Starting with TGTRLS(V7R5M0), with the following PTFs, the compiler automatically converts the second operand to the CCSID of the first operand if necessary. No environment variable is necessary.

  • 7.5 TGTRLS(*CURRENT): 5770WDS SJ08064
  • 7.6 TGTRLS(*CURRENT): 5770WDS SJ08065
  • 7.6 TGTRLS(V7R5M0): 5770WDS SJ08092

 

QIBM_RPG_ALLOW_SCAN_ZERO_LEN

Prior to TGTRLS(V7R6M0), the compiler did not allow allow a zero-length string as the search argument for %SCAN and %SCANR.

With the following PTFs, if compile-time environment variable QIBM_RPG_ALLOW_SCAN_ZERO_LEN is present with value 'Y', the compiler allows %SCAN and %SCANR to search for a zero-length string at runtime. In that case, %SCAN and %SCANR and return 0 indicating that the string is not found.

  • 7.4 TGTRLS(*CURRENT): 5770WDS SI82711
  • 7.5 TGTRLS(*CURRENT): 5770WDS SI82727
  • 7.5 TGTRLS(V7R4M0): 5770WDS SI83496
  • 7.6 TGTRLS(V7R5M0): No PTF is required
  • 7.6 TGTRLS(V7R4M0): No PTF is required

 

ADDENVVAR QIBM_RPG_ALLOW_SCAN_ZERO_LEN VALUE('Y')

Starting with TGTRLS(V7R6M0), the compiler defaults to allowing %SCAN and %SCANR to have a zero-length search argument. If you want the compiler to continue to disallow a zero-length search argument for %SCAN at runtime, you can add the environment variable at compile-time with a value of 'N'.

You can specify the same environment variable with value 'N' to cause the compiler to behave the old way.

QIBM_RPG_HANDLE_CCSID_LIKEFILE

Prior to TGTRLS(V7R6M0), when a file was defined with the LIKEFILE keyword, some required CCSID conversions might not be done when a data structure was used as the result field for an I/O operation.

With the following PTFs, if compile-time environment variable QIBM_RPG_HANDLE_CCSID_ALL_DS_IO is present with value 'Y', the compiler handles any necessary CCSID conversions when a data structure is used with the file in an I/O operation.

  • 7.3 TGTRLS(*CURRENT): 5770WDS SI83429
  • 7.4 TGTRLS(*CURRENT): 5770WDS SI81749
  • 7.4 TGTRLS(V7R3M0): 5770WDS SI83483
  • 7.5 TGTRLS(*CURRENT): 5770WDS SI81801
  • 7.5 TGTRLS(V7R4M0): 5770WDS SI81819
  • 7.5 TGTRLS(V7R3M0): 5770WDS SI83494
  • 7.6 TGTRLS(V7R5M0): No PTF is required
  • 7.6 TGTRLS(V7R4M0): No PTF is required

 

ADDENVVAR QIBM_RPG_HANDLE_CCSID_LIKEFILE VALUE('Y')

Starting with TGTRLS(V7R6M0), the compiler defaults to handling any necessary CCSID conversions when the a data structure is used with the file in an I/O operation.

If you had coded a work-around for the problem and your program is now behaving incorrectly, you can specify the same environment variable with value 'N' to cause the compiler to behave the old way.

QIBM_RPG_HANDLE_CCSID_ALL_DS_IO

Prior to TGTRLS(V7R6M0), when a data structure was defined with LIKEREC(*ALL) or EXTNAME(*ALL), some required CCSID conversions might not be done when the data structure was used as the result field for an I/O operation.

With the following PTFs, if compile-time environment variable QIBM_RPG_HANDLE_CCSID_ALL_DS_IO is present with value 'Y', the compiler handles any necessary CCSID conversions when the data structure is used in an I/O operation.

  • 7.3 TGTRLS(*CURRENT): 5770WDS SI83429
  • 7.4 TGTRLS(*CURRENT): 5770WDS SI81749
  • 7.4 TGTRLS(V7R3M0): 5770WDS SI83483
  • 7.5 TGTRLS(*CURRENT): 5770WDS SI81801
  • 7.5 TGTRLS(V7R4M0): 5770WDS SI81819
  • 7.5 TGTRLS(V7R3M0): 5770WDS SI83494
  • 7.6 TGTRLS(V7R5M0): No PTF is required
  • 7.6 TGTRLS(V7R4M0): No PTF is required

 

ADDENVVAR QIBM_RPG_HANDLE_CCSID_ALL_DS_IO VALUE('Y')

Starting with TGTRLS(V7R6M0), the compiler defaults to handling any necessary CCSID conversions when the data structure is used in an I/O operation.

If you had coded a work-around for the problem and your program is now behaving incorrectly, you can specify the same environment variable with value 'N' to cause the compiler to behave the old way.

QIBM_RPG_INTO_OPS_INCREASE_DIM_AUTO

Prior to release 7.5, the dimension of a DIM(*AUTO) array was not incremented by the XML-INTO and DATA-INTO operations.

Note: This environment variable is tied to the compiler release, not the target release.

With the following PTFs, if compile-time environment variable QIBM_RPG_INTO_OPS_INCREASE_DIM_AUTO is present with value 'Y', the XML-INTO and DATA-INTO operations increase the dimension of a DIM(*AUTO) array at runtime.

  • 7.4 TGTRLS(*CURRENT): 5770WDS SI75817
  • 7.5, all target releases: No PTF is required

 

ADDENVVAR QIBM_RPG_INTO_OPS_INCREASE_DIM_AUTO VALUE('Y')

Starting with programs compiled for all target releases on release 7.5, the XML-INTO and DATA-INTO operations increase the dimension of a DIM(*AUTO) array at runtime.

If you had coded a work-around for the problem and your program is now behaving incorrectly, you can specify the same environment variable with value 'N' to cause the compiler to behave the old way.

[{"Type":"MASTER","Line of Business":{"code":"LOB73","label":"Power TPS"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS69QP","label":"Rational Development Studio for i"},"ARM Category":[],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0;7.2.0;7.3.0;7.4.0;7.5.0;7.6.0"}]

Document Information

Modified date:
27 May 2026

UID

ibm17271860