The subfields of the name-value structure describing one field

The name-value structure describing one field is QrnNameValue_T.

Table 1. Subfields of QrnNameValue_T
Subfield Type Set by Used by
externalName CHAR(10) RPG Handler
datatype UINT1 RPG Handler
numericDefinedLen UINT1 RPG Handler
decimals UINT1 RPG Handler
dtzFormat UINT1 RPG Handler
dtSeparator CHAR(1) RPG Handler
input Indicator RPG Handler
output Indicator RPG Handler
isNullCapable Indicator RPG Handler
hasNullValue Indicator RPG and Handler RPG and Handler
valueLenBytes UINT4 RPG and Handler RPG and Handler
valueMaxLenBytes UINT4 RPG Handler
valueCcsid INT4 RPG Handler
value Pointer 1,2 RPG and Handler Handler

Additional notes on the table

  1. The "Set by" and "Used by" columns refer to the data that the pointer is pointing to.
  2. The pointer is set by RPG. The handler works with the data pointed to by the pointer, usually with a variable or data structure based on the pointer.

Descriptions of the subfields

datatype
The data type of the field. For more information see Data types used in name-value information.
decimals
The number of decimal places for a decimal field. It is only meaningful for decimal fields.
dtzFormat
The format of a date, time, or timestamp field. It is only meaningful for date, time, or timestamp fields. For more information see Constants QrnDtzFormat_* defining date, time, and timestamp formats.
dtSeparator
The separator for a date or time field. It is only meaningful for date or time fields.
externalName
The name of the field in the externally-described file.
hasNullValue
'1' indicates that the field has a null value, '0' indicates that the field does not have a null value. Set by RPG to indicate whether an output field or key field has a null value. Set by the handler to indicate whether an input field has a null value. Meaningful only when isNullCapable has a value of '1'.
input
A value of '1' indicates that the field is input capable. This subfield is mainly useful for the EXFMT operation.
isNullCapable
A value of '1' indicates that the field is null capable in the RPG program.
numericDefinedLen
The defined length of a numeric field. For a decimal type, packed, zoned, or binary, it is the total number of digits. For a float or integer type, it is the number of bytes. It is only meaningful for numeric fields.
output
A value of '1' indicates that the field is output capable. This subfield is mainly useful for the EXFMT operation.
value
A pointer to the value of the field in human-readable form. The length, in bytes, of the value is given by the valueLenBytes subfield. For numeric values, this is the same value that is provided by the %CHAR built-in function. For date, time, and timestamp values, this is the same value that is provided by the %CHAR built-in function in the same format used by the field in the file. Start of change
  • UCS-2 data is in the CCSID of the field in the file.
  • Alphanumeric data is either in the CCSID of the field in the file or in the job CCSID.
  • DBCS data is in the CCSID of the field in the file.
  • The data for all other types is in the job CCSID.
End of change

When providing an input value, the handler must set the value in a similar form, and the handler must set the valueLenBytes subfield to reflect the length, in bytes, of the data provided. The length of the data must not exceed the number of bytes indicated by the valueMaxLenBytes subfield.

For more information, see Data types used in name-value information.

valueCcsid
The CCSID of the data in the value pointer. A value of zero indicates that the data is in the job CCSID.
valueLenBytes
Indicates the number of bytes in the data pointed to by the value pointer. Set by RPG for an output field or a key field. Set by the handler for an input field. It must not be greater than the valueMaxLenBytes subfield.
valueMaxLenBytes
Indicates the number of bytes in the buffer pointed to by the value pointer.