Step 3. Assign the System Variable as a Default Value

REP004 - System and Multilingual Variables

In this step, you will assign the system variable you created as the default value of the iiiEmployNumber field. By using this system variable, the value of the field will be incremented by 1 each time the field is used.

1.  Open the iiiEmployNumber field in the Editor.

2.  Change the Default value to use the new system variable you created, *AUTOALP02iiiNUM. You can do this by entering *AUTO and using the ellipsis button to open the Find dialog.

     The find dialog will display objects with names like AUTO.

3.  Select your *AUTOALP02iiiNUM system variable and press OK.

4.  Save and close the field.

5.  This type of system variable stores the "next number" in a data area (in this case a data area named IIINUM, which is defined by the last part of the system variable name).

     The system variable reads the data area with a lock, increments it, returns the value to your form and then updates the data area (and releases the lock).

     If the data area does not already exist, it is created when first referenced. The data area is stored in the partition module library on the IBM i and in a special database table in Windows.