Question

  Asked: Apr 23 2008   7:22 PM GMT
  Asked by: JamesR


How can a factor 2 on a CALL be changed?


iSeries, RPG, Call

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?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



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
http://www.brucevining.com/
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
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register