Record types and properties

Several EGL record types are available:

For details on what target systems support what record types, see Record and file-type cross-reference. For details on how record parts are initialized, see Data initialization.

ALT_PCBRecord

This predefined record part describes the layout of a program control block (PCB) that lets a COBOL program change the destination for an outgoing message. Rather than read or write a record of this type, you include a reference to the PCB record when you perform read or write operations in DL/I. The layout of the record is as follows:
Record ALT_PCBRecord
	10 terminalName char(8);
	10 * char(2);
	10 statusCode char(2);
end

The ALT_PCBRecord type features a number of properties and property fields, described in PCB record part properties.

BasicRecord

A basic record or fixed basic record is used for internal processing and cannot access data storage.

The part is a non-fixed record part by default; but is a fixed record part if the field definitions are preceded by level numbers.

In a fixed record part of type basicRecord, the following properties are available:

In a main program, the following program property is available:
inputRecord
This property identifies a record that is initialized automatically, as described in Data initialization.

DB_PCBRecord

This predefined record part describes the layout of a program control block (PCB) that determines a COBOL program's access to a DL/I database. Rather than read or write a record of this type, you include a reference to the PCB record when you perform read or write operations in DL/I. The layout of the record is as follows; you can define your own record layout based on this one:
Record DB_PCBRecord
	10 dbName char(8);
	10 segmentLevel num(2);
	10 statusCode char(2);
	10 procOptions char(4)
	10 * char(4);
	10 segmentName char(8);
	10 keyAreaLen int;
	10 numSensitiveSegs int;
	10 keyArea char(32767);
end
The DB_PCBRecord type features a number of properties and property fields, described in PCB record part properties.

DLISegment

This record type may be either fixed length or non-fixed length. If it is non-fixed length, you must specify the lengthItem property (explained later in this section) in a set-value block.

The DLISegment record type holds the data you will read or write from a DL/I database segment. You can read a segment by invoking one of several possible get statements; you can write a segment by invoking an add or replace statement; and you can remove a segment from the file by invoking a delete statement.

Fields within the record must exactly match the fields in the database segment in length and type. For purposes of clarity or to aid migration, the names of the fields in the record definition do not need to match the field names in the DL/I segment. If any field name in the record does not match, however, you must use a set-value block to specify the eight-character dliFieldName property for that field. All names will be folded (converted to upper case) at generation time.

Use a set-value block to specify any or all of the following properties of the DLISegment record type:
segmentName char(8)
The name of the runtime DL/I segment. Complete this field if the name of your DLISegment record does not match the name of the related DL/I segment.
hostVarQualifier String
If you specify a host variable qualifier name, the code generator will use that name rather than the record name to qualify keyItems referenced in the default qualified segment search argument (SSA). If your DL/I segment record name does not match a program variable identifier, make sure this field does.
lengthItem FieldReference
If you use variable length segments in your DL/I database, you must, at run time, store the total length of your DLISegment record within that record. lengthItem contains the name of the field where you store that record length.
keyItem FieldReference
If you have an index or sequence key field for the record, specify the name of that field here.
In addition, you can define the following property for any of the fields in a DLISegment record:
dliFieldName char(8)
If you assigned a name to a fields in your DLISegment record that does not match the name of the equivalent field in the DL/I database segment, you must provide the name of that equivalent field here. Case is not an issue; all field names will be folded (converted to upper case) during generation.
The following example shows a set value block that uses these properties:
Record CustomerRecord type DLISegment { 
	segmentName = "STSCCST", 
	hostVarQualifier = "STSCCST",
	lengthItem = "mySegementLength",
	keyItem = "customerNo" }

	10 customerNo char(6)      { dliFieldName = "STQCCNO" };
	10 mySegementLength int;
	...
end

GSAM_PCBRecord

This predefined record part describes the layout of a program control block (PCB) that determines a COBOL program's access to a simple sequential data set such as a tape file or SYSIN. Rather than read or write a record of this type, you include a reference to the PCB record when you perform read or write operations in DL/I. The layout of the record is as follows:
Record GSAM_PCBRecord
	10 dbName char(8);
	10 * num(2);
	10 statusCode char(2);
	10 procOptions char(4)
	10 * char(20);
	10 recordSearchArg bigint;
	10 undefinedRecordLen int;
end
The GSAM_PCBRecord type features a number of properties and property fields, described in PCB record part properties.

IndexedRecord

An indexed record is a fixed record that lets you to work with a file that is accessed by a key value, which identifies the logical position of a record in the file. You can read the file by invoking a get, get next, or get previous statement. Also, you can write to the file by invoking an add or replace statement; and you can remove a record from the file by invoking a delete statement.

The properties of a part of type indexedRecord include these:
fileName
This property is required. For details on the meaning of your input, see Resource associations (overview). For details on the valid characters, see Naming conventions.
keyItem
This required property can only be a structure field that is unique in the same record. You must use an unqualified reference to specify the key field; for example, use myItem rather than myRecord.myItem. (In an EGL statement, however, you can reference the key field as you would reference any field.)

See also Properties that support variable-length records.

IO_PCBRecord

This predefined record part describes the layout of a program control block (PCB) that lets a COBOL program communicate with a user through a terminal. Rather than read or write a record of this type, you include a reference to the PCB record when you perform read or write operations in DL/I. The layout of the record is as follows:
Record IO_PCBRecord
	10 terminalName char(8);
	10 * char(2);
	10 statusCode char(2);
	10 * char(8);
	  12 localDate decimal(7);
	  12 localTime decimal(7);
	10 inputMsgSegNum int;
	10 userid char(8);
	10 groupName char(8);
	10 * char(12);
	  12 currentDate decimal(7);
	  12 currentTime decimal(11);
	  12 utcOffset hex(4);
	10 userIdIndicator char(1);
end
The IO_PCBRecord type features a number of properties and property fields, described in PCB record part properties.

MQRecord

An MQ record is a fixed record that lets you access an MQSeries® message queue. For details, see MQSeries support.

PSBDataRecord

As used for DL/I processing or on IMS™, a record of type PSBDataRecord is a fixed record that is organized as follows:
  Record PSBDataRecord
    psbName char(8);
    psbRef int;
  end

You can use the record to interact with the system variable DLILib.psbData, which contains both the name of the runtime PSB and an address with which that PSB is accessed. The record is also useful if you need to pass the PSB (really, a name and address) to another program or to receive the PSB from another program.

PSBRecord

This record part defines the structure of the runtime program specification block (PSB) and includes a series of PCB records. When you develop a PCB record for a database, for example (record type DB_PCBRecord), you represent a segment hierarchy by assigning values to the complex property@PCB. As shown in a later example, that property identifies the PCB name and type and includes a hierarchy field, which in turn contains a sequence of @Relationship properties.

If you use the CBLTDLI interface, you must declare the following PCBs first, in order, to provide the proper offset for the "access by index" that CBLTDLI requires:
  1. iopcb for an IO PCB
  2. ELAALT for an alternate index PCB
  3. ELAEXP for an alternate express PCB
The following is an example PSB record for a customer database:
Record CustomerPSB type PSBRecord { defaultPSBName="STBICLG" }
	// three PCBs required for call interface CBLTDLI
	iopcb IO_PCBRecord { @PCB { pcbType = TP } };
	ELAALT ALT_PCBRecord { @PCB { pcbType = TP } };
	ELAEXP ALT_PCBRecord { @PCB { pcbType = TP } };
	
	// database PCB
	customerPCB DB_PCBRecord { @PCB {
		pcbType = DB,
		pcbName = "STDCDBL",
		hierarchy = [
			@Relationship { segmentRecord = "CustomerRecord" },
			@Relationship { 
				segmentRecord = "LocationRecord", parentRecord = "CustomerRecord" },
			@Relationship { 
				segmentRecord = "CreditRecord", parentRecord = "CustomerRecord" },
			@Relationship { 
				segmentRecord = "HistoryRecord", parentRecord = "CustomerRecord" },
			@Relationship { 
				segmentRecord = "OrderRecord", parentRecord = "LocationRecord" },
			@Relationship { 
				segmentRecord = "ItemRecord", parentRecord = "OrderRecord" }]}};
end
For more information on the properties of a PCB record, see PCB record type properties.

RelativeRecord

A relative record is a fixed record that lets you work with a data set whose records have these properties:
  • The records are fixed length.
  • The records can be accessed by an integer that represents the sequential position of the record in the file.
The properties of a part of type relativeRecord are as follows:
fileName
The contents of this field depend on context. For details, see Resource associations and file types. For details on the valid characters, see Naming conventions. This is a required field.
keyItem
The key field can refer to any of these areas of memory:
  • A structure field in the same record
  • A structure field in a record that is global to the program or is local to the function that accesses the record
  • A primitive variable that is global to the program or is local to the function that accesses the record
You must use an unqualified reference to specify the key field. For example, use myItem rather than myRecord.myItem. (In an EGL statement, 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 BIN, DECIMAL, INT, or NUM
  • Contains no decimal places
  • Allows for 9 digits at most

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

SerialRecord

A serial record is a fixed record that lets you access a sequentially accessed file or data set. You can read from the file by invoking a get statement, and a series of get next statements reads the file records sequentially, from the first to the last. You can write to the file by invoking an add statement, which places a new record at the end of the file.

Serial record properties include the following:
fileName
The contents of this field depend on context. For details, see Resource associations and file types. For details on the valid characters, see Naming conventions. This is a required field.

See also Properties that support variable-length records.

SQLRecord

An SQL record is a record that provides special services when you access a relational database.

The part is a non-fixed record part by default; but is a fixed record part if the field definitions are preceded with level numbers.

Each part has the following optional properties:
tableNames
An entry in tableNames identifies an SQL table associated with the part. You may reference multiple tables in a join, but restrictions ensure that you do not write to multiple tables with a single EGL statement. You may associate a given table name with a label, which is an optional, short name used to reference the table in an SQL statement.
defaultSelectCondition
The property specifies conditions that become part of the WHERE clause in default SQL statements. The WHERE clause is meaningful when an SQL record is used in an EGL open or get statement or in statements like get next or get previous.

In most cases, the SQL default select condition supplements a second condition, which is based on an association between the key-field values in the SQL record and the key columns of the SQL table.

tableNameVariables
You can specify one or more variables whose content at run time determines what database tables to access, as described in Dynamic SQL.
keyItems
Each key field can only be a structure field that is unique in the same record. You must use an unqualified reference to specify each of those fields; for example, use myItem rather than myRecord.myItem. (In an EGL statement, however, you can reference a key field as you would reference any field.)

For details, see SQL support.

VGUIRecord

A VGUIRecord part is a generatable part and is the basis of a VGUI record, which is a VGWebTransaction program or function variable that makes communication possible between the program and a specific Web page.

The properties of a part of type VGUIRecord include these:
validatorFunction
Specifies the EGL function validator function, which is invoked after all the field validators are invoked, as described in Validation in Web applications built with EGL
runValidatorFromProgram
Specifies whether the validator function is in the VGUI record bean or is in the program that receives data from the VGUI record bean.
commandValueItem
Identifies the VGUI record field that contains the value of the SUBMIT button clicked by the user.
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.