|
Had the following p-list in an RPG III program:
C PL@DAT PLIST C PARM P@DAT1 10
C PARM P@FMT1 4
C PARM P@DAT2 10
C PARM P@FMT2 4
C PARM P@OPER 1
C PARM P@UNIT 1
C PARM P@DURT 3
C PARM P@ERR 1
C PARM P@DUR 5
The above p-list was used in a call to an RPG IV program.
C CALL 'CADATE' PL@DAT
* C P@ERR IFEQ '0'
We converted this program to RPG IV using CVTRPGSRC. During the first use, it went into an endless loop. While debugging, we realized that the P@ERR parameter in the called program was 3 chars long and not 1. All zeros meant no error, while anything else ( '001', '002', '003',...'006') would be an error.
Now the question: we know that the RPG III program has worked in the past when invalid data was passed to CADATE, we don't understand why it would have failed as an RPG IV program; particularly when the fix was to change P@ERR to 3 chars and the comparison to '000'. Unless the mismatch in the parameters had a different effect with an RPG III <--> RPG IV call than they did with a RPG IV <--> RPG IV call. It almost seems as if the RPG III P@ERR ended up with the rightmost char and the RPG IV P@ERR ended up with the leftmost (as I would expect).
I put together a small RPG III program to test, and it works as you would expect the 1 char P@ERR ends up with the leftmost char.
So what the heck was going on? Thoughts?
Thanks in advance, Charles
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.