Return value on AS400


Can anybody tell me the limit of error value returned on AS/400 system.
For MVS the limit is 0 - 4096.


Who is Participating?

Error value returned for what? errno? SQL error values returned? Error values returned from an application program?

errno on V5R1 generally ranges 3001-3536, but those are the basic values #defined in errno.h. In V5R3, the range is 3001-3546.

Of course, the #defined values don't limit it. If the #defined range goes 3546, I would expect at least values to 4095.


You need to know the application, eg. SQL, RPG, CPF etc.

In general error messages are in the format

where AAA is actualy 1 alpha and two alphanumerics and identifies the application, and sometimes a clue to the message file containing the message
and 9999 is a four digit number...  in hex: digits 0-9 and characters A-F

I would have said the limit is 0000-FFFF,  although generally 0001-9999    (although not all numbers are used)

Error messages are stored in MESSAGE FILES  (*MSGF).

You can create your own message file(s), and create your own message id's but the message id has to follow the above convention.

examples of IBM supplied message files (assuming you have the applications loaded) are
the list goes on and on and on......

try the command WRKMSGF   *LIBL/*ALL  
and choos option 12 to view messages....
eg. QSQLMSG has the following messages  
QMR0A1A - QMR2204
QMX0001 - QMX0191
SQL0004 - SQL9108
SQT0100 - SQT6842
SQ20054 - SQ20268
SQ30000 - SQ30107

NOTE that not all numbers in a range are used !! eg. QSQLMSG has the following extract
Message ID  Severity  Message Text                              
 QMR0A1A       10       Field value must be in the range 1 to 255.
 QMR0A1B       10       Field value must be in the range 22 to 378.
 QMR0A10       10       Field value must be in the range 1 to 4.  
 QMR0A11       10       Field value must be in the range 0 to 99.  
 QMR0A12       10       Field value must be in the range 0 to 999.
 QMR0A15       10       Field value must be in the range 0 to 15.  

notice messages QMR0A13 or QMR0A14 don't exist.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.