If you look at that API definition in V5R3, you will find that they have added at least one field to the format you are using. I didn’t dig, but SPLA0200 has added a 10 character field at the end of that format. That would push your error code parameter left by 10 characters, making it an invalid length.
Change your code to determine if the program is running on V5R3 or above and pass a different structure.
Home of iS/ODBC – MSSQL Access FROM iSeries