Creating a Primary Key

Declare a primary key in the following circumstances:

  • For VIRTUAL data sets that you want DATABridge to update. Declaring the primary key allows DATABridge to update the records in the VIRTUAL data set.
  • For data sets where DATABridge requires a unique key set, but the unique key set does not exist in the DMSII DASDL. Declaring the primary key satisfies the DATABridge requirements, without any DASDL modifications.

If you omit the PRIMARY KEY declaration, GenFormat ensures that the primary key (returned by DBPRIMARYKEY) is from a set that does not allow key changes. If there is no such set, the dataset will not have a primary key.

To create a primary key, GenFormat allows you to specify the data items for a data set that form a primary key.

Caution: DATABridge does not check the validity of the primary key you define. It is your responsibility to choose a primary key that is unique for all records in the data set. Failure to do so could result in duplicate or lost records.