How can a factor 2 on a CALL be changed?

90 pts.
Tags:
Call
iSeries
RPG
I have the following code: C CALL 'UTWIPT' C PARM P0Part P1PART 20 C PARM P0Seq# P1SEQ# 3 0 C PARM P0Lot# P1LOT# 15 Before it excutes the value of P0SEQ# is 035... after the call I am getting different value... that is later causing a data dec error (such as hex F0F1). I didn't think a call could change a factor 2 value... what is happening?

Answer Wiki

Thanks. We'll let you know when a new response is added.

If P0SEQ# is one value prior to the call and a different value immediately (and I stress the word immediately) following the call, then you have a bug in the parameter list.

Carefully examine the definitions of your CALL result field definitions (size and type) and compare them to the *ENTRY PLIST PARM list of UTWIPT. There is most likely a discrepancy which is causing UTWIPT to think there is more storage associated with one of the fields being passed then the calling program has allocated. UTWIPT is most likely setting one of this mis-defined field to a new value and this new value is overflowing into the allocation of P0SEQ# in the caller. Note that it could be ANY of the fields associated with the PLIST.

The actual bug may be something more subtle than what I describe above, but the vast majority of the time it’s an inconsistent parameter field defintion between the caller and called program.

Bruce Vining
<a href=”http://www.brucevining.com/”>http://www.brucevining.com/</a>
Providing integrated solutions for the System i user community

In such a case, using Protyped call may be the ultimate safe solution to secure Call consistency at compile time.

And this case, also doucle-check that P0Seq# does not overlay any parameter of the current call.

TSchmitz

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following