How to change a schema record definition.

Document ID : KB000020334
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

This document describes how to change the definition (structure) of a schema record.

Solution:

Assume that you have a schema called MYSCHEMA version 1 which includes a record called MYRECORD version 1.

In order to change the definition of MYRECORD, perform the following steps:-

  1. Create MYRECORD version 2 with the structure equal to that which you want to change the record.
  2. Perform the following in the schema compiler:-

    MOD SCHEMA NAME IS MYSCHEMA VERSION IS 1.
    MOD RECORD NAME IS MYRECORD
    SHARE STRUCTURE OF RECORD MYRECORD VERSION 2.
    VALIDATE.
    REG ALL SUBSCEMAS.
  3. In IDD, switch the record versions around so that the live one has version 1 and the old one is version 2:-

    MOD REC MYRECORD V 1 NEW V 3.
    MOD REC MYRECORD V 2 NEW V 1.
    MOD REC MYRECORD V 3 NEW V 2.

    Note that this procedure does NOT alter the underlying data. It is only a means for changing the definition of the schema record within the data dictionary.