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":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHtAAM","label":"Programming ILE Languages"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

499433341

Document Information

More support for:
IBM i

Component:
Programming ILE Languages

Software version:
All Versions

Operating system(s):
IBM i

Document number:
635347

Modified date:
07 November 2024

UID

nas8N1013467

Manage My Notification Subscriptions