There is no equivalent to Auto Increment Field in DDS – you may however be able to implement something which will give the same result if you create a trigger program for your file which updates a newly added record with the next available number.
Hi from PGMBOB,
In an RPG program we setgt with the key including the data you want to increment,
readp the file (you might not want to lock that record for update).
Increment your result of the READP.
Fill in all your data fields. MAke sure you do this completely, the data from the READP is in the buffer.
Any other data you thought you put in the record is gone.
For safety you might rename the fields in the record you accessed to get the increment.
Write your new record.
It is possible for a trigger program to update the same record that caused the trigger.
Trigger programs seem better at maintaining other files as a result the record that caused the trigger.