The SQL RPG/400® precompiler only recognizes a subset of RPG/400 declarations as valid host variable declarations.
Most variables defined in RPG/400 can be used in SQL statements. A partial listing of variables that are not supported includes the following:
Fields used as host variables are passed to SQL, using the CALL/PARM functions of RPG/400. If a field cannot be used in the result field of the PARM, it cannot be used as a host variable.