|
1) You have a variable named ErrCode that is 16A and has been left at the default value of blanks.
However, APIs use a data structure for the error code, not a character field. The first 4 bytes of the data structure are the length, in bytes, of the structure. Since yours are blanks, the API thinks you've provided more than 1 gb (more than one billion bytes) in which it can return error information.
2) Your 'MsgFile' variable will have GENERICMSG at the *end* of the string rather than the start because you're doing a MOVE rather than a MOVEL.
This is why the API is sending an error to begin with, it's looking for a file named BLANK (because the first 10 posiitons of MsgFile are blank) in a library named GENERICMSG.
That's as much as I had time to look into.
Also, you say you have to code this for V4R5, but... you are actually coding it for RPG/400 (RPG III) -- just using the RPG IV line spacing.
Even at V3R1 (which is several releases earlier than V4R5) you could've coded this in a nicer way by using RPG IV features such as EVAL and IF/ELSE/WHEN with expressions that would've made it much easier to see the mistakes you're making and much easier to fix. Your coding style is over 26 years out of date, and is making it harder to write and maintain your programs.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.