Values of Glb.Unique

The value of Glb.Unique is held in the following file on your Dictionary pack, with a duplicate file on your Audit pack. (If your Dictionary and Audit packs are the same, only one copy of the file is held.)

          system/UNIQUE/SAVE

If the Audit pack location is changed, the file is automatically copied to the new Audit pack, unless it is the same as the Dictionary pack.

During normal processing, the current value of Glb.Unique is maintained and allocated from a table within the LINCSUPPORT library. After every thousand increments of Glb.Unique, the current value of Glb.Unique and a date time stamp are stored on both the Dictionary pack and Audit pack copies of the Glb.Unique file. The date/time stamp is used to resolve any conflicts between the two files when recovery is performed. When your application closes down normally, as well as storing the current Glb.Unique value and the date/time stamp, a normal closedown indicator is set within the Glb.Unique files.

When your application is initiated, both Glb.Unique files are opened, and the starting point for Glb.Unique allocation is from the file with the largest date/time stamp value. If only one file exists, then this file is used. Once the file to be used has been chosen, the normal closedown indicator is checked. If this is not set (meaning that this is abnormal restart), the application adds 2,500 to the value of Glb.Unique before allocating any new Glb.Unique values. This provides a buffer to ensure that duplicate Glb.Unique values are not allocated.

Changing Glb.Unique

When changing the value of Glb.Unique, consider the following points: