IBM Support

How Can Null-Capable Variables be Defined in an RPGLE Program?

Troubleshooting


Problem

The following document will explain how you can define null-capable variables in an ILE RPG program.

Resolving The Problem

ALWNULL(*USRCTL) must be specified on the H-Spec or the command parameter to process or define null capable fields.

Aside from parameters defined with OPTIONS(*NULLIND), null-capable fields can be implicitly defined from null-capable fields in externally-described files or data structures. Prior to 7.3, there is no RPG support for defining program-described fields as being null-capable. Starting in 7.3, you can also define program-described fields as being null-capable by using the NULLIND keyword.



Here are the ways that an RPG program can make use of null-capable fields from database files:

1.When the file is defined on an F spec, the null-capable fields from the file will be null-capable fields or subfields in the RPG program.
2.When a data structure is defined using the LIKEREC keyword with a record from the file, the null-capable fields from the file will be null-capable subfields of that data structure.
3.When an externally-described data structure is defined from the file, the null-capable fields from the file will be null-capable subfields of that data structure.
4.When a data structure is defined LIKEDS of a data structure containing null-capable subfields, the new data structure will have corresponding null-capable subfields.

A comprehensive discussion of this topic is available in this presentation:- Working_with_null_capable_fields_v2.pdf

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number

499433341

Document Information

Modified date:
11 November 2019

UID

nas8N1013467