SelfDefining

Data Type Identifier

19

Description

A string of no more than 32767 bytes that is a concatenation of tagged data items; each tagged data item represents a RODM abstract data-type ID followed by its corresponding data. All reserved abstract data types can be used in SelfDefining data strings except the Anonymous(N) data type.

Figure 1 shows the format of SelfDefining data.

Figure 1. SelfDefining Data Type Syntax

Self_Defining

Read syntax diagramSkip visual syntax diagramlength identifiervalue
The following variables are used in the SelfDefining syntax:
length
A 2-byte integer that specifies the total length of the SelfDefining data string excluding the 2-byte length field itself.
identifier
A 2-byte unsigned integer that specifies the RODM data type of the data that immediately follows the identifier in the SelfDefining data string. Data type identifiers are specified in the RODM data type definitions in Abstract Data Type Reference.
value
The value of the data that is specified by identifier. For values that are of data type ObjectName and ShortName, the null terminator is not included in the SelfDefining data string.

When specifying a CharVar inside a SelfDefining data string, you must include the 1-byte null terminator in the length field of the SelfDefining data string, but do not include it in the length field of the CharVar specification within the SelfDefining data string.

Figure 2 shows an example SelfDefining string that contains a Smallint with a 2-byte (short integer) hexadecimal representation of the value 2010, a CharVar with the value RODM, and an 8-byte application ID value of NETV, which is padded on the right with four blanks.
Figure 2. Example SelfDefining Field
This figure shows an example of a SelfDefining string.

Null Value

Length field is zero.

PL/I Declaration

% SelfDefining = 'CHAR(32767) VARYING';  

C Declaration

typedef    _Packed struct {
             Smallint  Data_length;
             Anonymous Data_content;
           } SelfDefining;