VisualAge Generator to Enterprise Generation Language Migration Guide


Records

The records section is organized into the following tables:


Figure 67. Records - general syntax, record type, properties, and prolog

VisualAge Generator 4.5
EGL produced by the migration tool Migration tool considerations
VAGen record part:
  • recordName
  • Basic information
    • Record type
    • Record structure (item list)
  • Properties (vary based on record type)
  • Prolog

The record structure can be given by specifying an alternate specification record or by including the item list.

EGL record example:
//*** Record=recordName***
// prolog
//******************* 
Record recordName 
type  recordType
  { [ recordProperties ] }
  recordStructure
end  // end recordName
Note:
The record structure can be given by specifying an embed statement or by including the item list.
No special considerations.
Record types:
  • Working Storage
  • Redefined
  • Serial
  • Indexed
  • Relative
  • Message Queue
  • SQL Row
  • User Interface
  • DL/I Segment
EGL Record types:
  • basicRecord
  • basicRecord
  • serialRecord
  • indexedRecord
  • relativeRecord
  • mqRecord
  • sqlRecord
  • Not supported in this release.
  • Not supported in this release.
The migration tool migrates a redefined record to a basicRecord. The tool includes a comment with the record definition to provide the name of the record that was redefined. Special considerations apply for redefined records. See the information in Redefined records for details and potential problems.
Working storage record properties:
  • Alternate specification
basicRecord properties:
  • embed statement
The migration tool migrates an alternate specification to the embed statement.
Redefined record properties:
  • Redefinition
Note:
The Redefinition property specifies the name of another record that provides the physical storage. The current record provides a different data item layout of the same physical storage.
basicRecord properties:
  • Not applicable. Redefinition information is only specified in programs that use the record. The same record can be used as a redefinition of another record or as a normal record.

The migration tool includes a comment with the record definition to provide the name of the record that was redefined.

The migration tool also includes the redefines property on the declaration statement for the record in programs that use the record.

Special considerations apply depending on how the record is used in the program and on whether the record is available during migration. See the information in Redefined records for details and potential problems.

Serial record properties:
  • File name
  • Alternate specification
  • Variable length item
  • Occurrences item
serialRecord properties:
  • fileName
  • embed statement
  • lengthItem
  • numElementsItem
The migration tool migrates an alternate specification to the embed statement.
Indexed record properties:
  • File name
  • Record ID
  • Alternate specification
  • Variable length item
  • Occurrences item
indexedRecord properties:
  • fileName
  • keyItem
  • embed statement
  • lengthItem
  • numElementsItem
The migration tool migrates an alternate specification to the embed statement.
Relative record properties:
  • File name
  • Record ID
  • Alternate specification
relativeRecord properties:
  • fileName
  • keyItem
  • embed statement
The migration tool migrates an alternate specification to the embed statement.
Message Queue record properties:
  • File name
  • Alternate specification
  • Include message in transaction
  • Open queue for exclusive use on input
  • Record length item
  • Occurrences item
  • Queue descriptor record
  • Open options record
  • Message descriptor record
  • Get options record
  • Put options record
mqRecord properties:
  • fileName
  • embed statement
  • includeMsgInTransaction
  • openQueueExclusive
  • lengthItem
  • numElementsItem
  • queueDescriptor
  • openOptions
  • msgDescriptor
  • getOptions
  • putOptions
The migration tool migrates an alternate specification to the embed statement.
SQL row record properties: SQL row record properties: No special considerations.
Prolog Not applicable. The migration tool converts the prolog to a comment that precedes the record definition.

Figure 68. Records - record structure for most record types

VisualAge Generator 4.5
EGL produced by the migration tool Migration tool considerations

Record structure - variation 1: Alternate specification. If RecordA specifies an alternate specification of RecordB, RecordB provides all the items for RecordA. There is no item structure in RecordA.

If RecordB contains level 77 items, RecordA only contains the non-level 77 items from RecordB.

Record structure - variation 1: The EGL embed statement specifies the record that provides the item structure for the current record. RecordA embeds RecordB. For example:

embed RecordB;

The migration tool migrates an alternate specification to the embed statement.

Special considerations apply for level 77 items in working storage records. See information in Level 77 items in records for details and potential problems.

Record structure - variation 2 with Shared Items:

  • itemName
  • Occurs
  • Shared
  • levelNumber
    Note:
    levelNumber is hidden, but it is based on the data item hierarchy within the record.
Note:
Type, Length, Decimals and Description are visible in the record editor, but are not stored in the record.
Record structure - variation 2 with EGL type definitions example:
levelNumber itemname
    itemname [occurs];
Note:
Note: Type, Length, Decimals and Description are not visible in the editor.

The migration tool migrates shared items to an EGL variable that is defined using a type definition. For migration, the type definition is always the same as the item name.

The migration tool omits the occurs information if occurs is 1.

Special considerations apply for level 77 items in working storage records. See information in Level 77 items in records for details and potential problems.

Record structure - variation 2 with Nonshared Items:

  • itemName
  • Occurs
  • Type
  • Length
  • Decimals
  • Nonshared
  • Description
  • levelNumber is hidden, but is based on the data item hierarchy within the record
Note:
Type, Length, Decimals and Description are stored with the item in the record.
Record structure - variation 2 with EGL primitive types example:
levelNumber itemName
  dataType(lengthInformation)
  [occurs];
  // Description 
Note:
Type, Length, Decimals and Description are visible in the editor.

The migration tool migrates nonshared items to an EGL variable that is defined using a primitive type. Migration of type, length, and decimals information is the same as described in Figure 61, Data items - general syntax, data type, length, decimals, and description.

The migration tool omits the occurs information if occurs is 1.

Special considerations apply for level 77 items in working storage records. See information in Level 77 items in records for details and potential problems.


Figure 69. Records - SQL properties and SQL record structure

VisualAge Generator 4.5
EGL produced by the migration tool Migration tool considerations
SQL record properties:
  • Default key item
  • Alternate specification
  • SQL tables:
    • Label
    • Name
Note:
  • If a record does not specify an alternate specification, the key items are the items in the record structure that specify key=yes. The Default key item is ignored.
  • If a record specifies an alternate specification, the key items are the Default key item in the current record merged with the items in the alternate specification record that specify key=yes. The keys are merged in the order in which the items appear in the record structure. If the Default key item in the current record is also specified as key=yes in the alternate specification record, the item is only included once in the merged list of keys.
  • SQL table names can be an actual table name (normal situation) or a table name host variable that will be substituted at run time. Table name host variables start with a semicolon (:).
sqlRecord properties:
  • keyItems
  • embed statement
  • tableNames and / or tableNameVariables
Note:
  • keyItems is a list of all keys for the record. key=yes is not specified for items in the record structure.
  • The tableNames property is a list of the table names and table labels when the table name is not a host variable. The tableNameVariables property is a list of the table names and table labels when the table name is a host variable that will be substituted at run time. The table names in the tableNameVariables property do not start with a semicolon. tableNames and tableNameVariables can both be used in the same record definition.
The migration tool builds the keyItems property as follows:
  • If the VAGen alternate specification is not included, the tool uses any items from the record structure that specify key=yes, but does not include the VAGen default key item.
  • If the VAGen alternate specification is included, the tool merges any items from the alternate specification record that specify key=yes and the default key item from the current record. The keys are listed in the same order as the items appear in the record structure. If the default key item from the current record is the same as one of the key items from the alternate specification record, the item is only included once in the keyItems list.

The migration tool builds the lists for tableNames and tableNameVariables as follows:

  • tableNames is built from the table names and table labels when the table name is not a host variable.
  • tableNameVariables is built from the table names and table labels when the table name is a host variable.

Special considerations apply. See information about SQL alternate specification in Alternate specification records for details and potential problems.

SQL Default Conditions:
  • whereClauseText
Note:
  • The SQL default conditions enable you to specify a where clause, most typically for join conditions when multiple tables are used in the SQL row record. The syntax is SQL syntax.
  • !itemColumnName variables are permitted. These variables specify the name of an item in the SQL row record. At test or generation time, VisualAge Generator substitutes the corresponding SQL column name.
Example of default selection conditions:
defaultSelectCondition =
    #sql{ 
       whereClauseText
    }
Note:
  • The defaultSelectCondition is used for the same purpose as in VisualAge Generator.
  • !itemColumnName variables are not supported. Actual SQL column names must be used.
The migration tool converts any !itemColumnName variables to their corresponding SQL column name.

Special considerations apply. See information about SQL alternate specification in Alternate specification records for details and potential problems.

Record structure - variation 1: Alternate specification. If RecordA specifies an alternate specification of RecordB, RecordB provides all the items for RecordA. There is no item structure in RecordA.

Record structure - variation 1: The EGL embed statement specifies the record that provides the item structure for the current record. RecordA embeds RecordB. For example:

embed RecordB;
The migration tool migrates an alternate specification to the embed statement.
Record structure - variation 2 with Shared Items:
  • itemName
  • Read Only
  • Key
  • SQL Column Name
  • SQL Code
  • Shared
Note:
  • Type, Length, Decimals and Description are visible in the record editor, but are not stored in the record.
  • VisualAge Generator always includes the null indicator variable for SQL items.
  • The SQL Code is not included in the External Source Format for pack and binary fields. If the SQL Code is not included in the External Source Format for char, dbchar, or unicode fields, the field is treated as a fixed length field. This only occurs for records that were migrated from earlier releases of VisualAge Generator and never modified using VisualAge Generator 4.5.
Record structure - variation 2 with EGL type definitions example:
itemName itemName 
  { [sqlDataCode=sqlCodeNumber]
     column="SQLColumnName"
     [ isReadOnly=yes ]
     isNullable = yes 
    [ sqlVar = yes ]  };
Note:
  • Type, Length, Decimals and Description are not visible in the editor.
  • isNullable = no is supported.

If you selected the Migration Syntax Preference Convert shared data items to primitive item definitions and the data item part is available, the migration tool does the following:

  • Converts the shared item to an EGL variable that is defined using a primitive definition based on the type, length, and decimals specified for the data item part.
  • Includes the sqlDataCode property for hex items.
  • Sets the sqlVar=yes property for char, dbchar, or unicode fields if the VAGen SQL data code indicates the item is variable length. The migration tool omits the sqlVar property if the VAGen SQL data code indicates the item is fixed length.

If you did not select the Migration Syntax Preference to Convert shared data items to primitive item definitions or the data item part is not available, the migration tool does the following:

  • Converts the shared item to an EGL variable that is defined using a type definition. For migration, the type definition is always the same as the item name.
  • Includes the sqlDataCode property if it is included in the External Source Format and is not one of the values for VAGen binary or packed fields.
  • Sets the sqlVar=yes property if the VAGen SQL data code indicates the item is variable length. The migration tool omits the sqlVar property if the VAGen SQL data code indicates the item is fixed length.

The migration tool always does the following:

  • Includes any key=yes items in the EGL keyItems property for the sqlRecord.
  • Always sets isNullable=yes because VisualAge Generator always includes the null indicator variable.
  • Only Includes isReadOnly if the value is yes.

Record structure - variation 2 with Nonshared Items:
  • itemName
  • Type
  • Length
  • Decimals
  • Read Only
  • Key
  • SQL Column Name
  • SQL Code
  • Nonshared
  • Description
Note:
  • Type, Length, Decimals and Description are stored with the item in the record.
  • VisualAge Generator always includes the null indicator variable for SQL items.
  • The SQL Code is not included in the External Source Format for pack and binary fields. If the SQL Code is not included in the External Source Format for char, dbchar, or unicode fields, the field is treated as a fixed length field. This only occurs for records that were migrated from earlier releases of VisualAge Generator and never modified using VisualAge Generator 4.5.
Record structure - variation 2 with EGL primitive types example:
itemName
 dataType(lengthInformation)
 // Description
  { [sqlDataCode=sqlCodeNumber]
    column="SQLColumnName"
    [ isReadOnly=yes ]
    isNullable = yes 
    [ sqlVar = yes ] };
 
Note:
  • Type, Length, Decimals and Description are visible in the editor.
  • isNullable = no is supported.

The migration tool migrates nonshared items to an EGL variable that is defined using a primitive type. Migration of type, length, and decimals information is the similar to what is described in Figure 61 .

The migration tool includes the sqlDataCode property only for hex items.

The migration tool sets sqlVar=yes for char, dbchar, and unicode data items if the VAGen SQL data code indicates the item is variable length. The migration tool omits the sqlVar property if the VAGen SQL data code indicates that the item is fixed length.

The migration tool includes any key=yes items in the EGL keyItems property for the sqlRecord.

The migration tool always sets isNullable=yes because VisualAge Generator always includes the null indicator variable.

The migration tool only includes isReadOnly if the value is yes.

VAGen data type - Char
  • data code - 453
  • data code - 449 or 457
EGL data type:
  • char; omit sqlVar
  • varchar, sqlVar = yes
No special considerations.
VAGen data type - DBCS
  • data code - 469
  • data code - 465 or 473
EGL data type:
  • dbchar; omit sqlVar
  • vardbchar, sqlVar = yes
No special considerations.
VAGen data type - Unicode
  • data code - 469
  • data code - 465 or 473
EGL data type:
  • unicode; omit sqlVar
  • varunicode, sqlVar = yes
No special considerations.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]