A screen has one input field called number. whenever the number is inputted, the value gets stored in a file. The file has 2 fields, Value and Sequence. So, if any user has inputted '10', the files will store 10 as value and 1 as sequence. If any user inputs a value, which is already present in the file, a message in the screen appears that 'Duplicate value'.
There are 10 users who have opened the same screen in 10 different AS/400 sessions. All 10 of them are about to input '50' from the screen at the same time. Since '50' is not in the file, so error message should not appear. But they do not know that others users are also giving '50'. How can we code this scenario so that file will store 50 from all 10 users with sequence number from 1 to 10 without giving error message 'Duplicate value'?