× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Charles,

I think you were lucky that it worked. In the caller you have field P@ERR defined as 1 byte. When you call CADATE you are passing a pointer to this field. Now when CADATE puts '123' in the memory that the pointer points at, the '1' ends up in field P@ERR, but '23' ends up in whatever variable happens to sit next to P@ERR. It is quite possible that in the memory layout that the RPG III compiler generated this did no harm, while in the RPG IV layout it did.

Joep Beckeringh


CWilt@xxxxxxxxxxxx wrote:


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 thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.