Try this link…
Library QSYSINC file QRPGLESRC member QUSEC is source for a /COPY member for the error code data structures. (Library QSYSINC is installed when the System Openness Includes option is installed as part of the operating system.)
Copy the member into your source file and choose which error code format is appropriate for you; delete the lines for the other format.
The fields at the ends of the formats are left as comments rather than being described because you will decide what lengths to assign and how to do it. You can make them fixed length and part of the defined data structure, or you can base another definition over the address at the end of the structures.
Those definitions will depend on what values you tell the API for bytes provided and how you want to handle exceptions returned from the API.