Relative record part in EGL source format

You declare a fixed record part of type relativeRecord in an EGL source file, which is described in EGL source format.

An example of a relative record part is as follows:
  Record myRelativeRecordPart type relativeRecord
    {
      fileName = "myFile", 
      keyItem  = "myKeyItem"
    }
    10 myKeyItem NUM(4);
    10 myContent CHAR(76);
  end
The syntax diagram of a relative record part is as follows:

Syntax diagram for a relative record part
Record recordPartName relativeRecord
Identifies the part being of type relativeRecord and specifies the name. For the rules of naming, see Naming conventions.
fileName = "logicalFileName"
The logical file name. For details on the meaning of your input, see Resource associations (overview). For rules, see Naming conventions.
keyItem = "keyField"
The key field, which can be any of these areas of memory:
  • A field in the same fixed record
  • A variable or field that is global to the program or is local to the function that accesses the fixed record

You must use an unqualified reference to name the key field. For example, use myField rather than myRecord.myField. (In a function, however, you can reference the key field as you would reference any field.) The key field must be unique in the local scope of the function that accesses the record or must be absent from local scope and unique in global scope.

The key field has these characteristics:
  • Has a primitive type of NUM, BIN, DECIMAL, INT, or SMALLINT
  • Contains no decimal place
  • Allows for 9 digits at most

Only the get and add statements use the relative record key field, but the key field must be available to any function that uses the fixed record for file access.

structureField
A structure field, as described in Structure field in EGL source format.

Related concepts
EGL projects, packages, and files
References to parts
Parts
Record parts
References to variables in EGL
Typedef

Related tasks
Syntax diagram for EGL statements and commands

Related reference
Arrays
DataItem part in EGL source format
EGL source format
Function part in EGL source format
Indexed record part in EGL source format
MQ record part in EGL source format
Naming conventions
Primitive types
Program part in EGL source format
Resource associations and file types
Serial record part in EGL source format
SQL record part in EGL source format
Structure field in EGL source format

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.