Basically there are two types of error codes and especially messages associated with them: NATURAL and USER Error messages
When assigning a value to *ERROR-NR NATURAL will always trigger a SYSTEM error, even if a message with that number is defined for the respective user library in SYSERR.
As there are no defined ranges for “user initiated errors” you will need to make sure you are preferably picking an error code NOT associated with an error (currently) used by NATURAL.
Like Eugene said, you can do this using the SYSERR utility which is there for viewing and manipulating message texts, both NATURAL and USER messages.
Current list of used error numbers from OpenSystems NATURAL for the range starting 1200, for example
There is no number or range reserved for user-initiated messages. In any case, I would strongly recommend not to use just any ‘free’ number. Many which looks free, are reserved for specific tools or on other platforms and can be used at any new version. Best is if you open an Aha request for User-defined system messages. Then we can reserve (and maybe initialize) a range of messages for users.
For now (temporary), you may use the number 2007. This is in a range which we want to release anyway. But if the range of user-defined system messages is finally implemented elsewhere (or nowhere), it can happen that you have to move you message to another number.