Parm Value Changed on Dynamic Call in free

235 pts.
Tags:
IBMi RPGLE
iSeries V6R1
Parameter Stored Procedures
I have a prototype in my free program to call an external program. The parms on my prototype include two fields that are defined as 2S 0. The value of these two fields are 00 and 01 at the time of the call tothe prototype. Using debug, I step into the program being called and the value of these two variables have changed when I look at the entry list in that program. The called program is not written in free. I have tried this call with and without the CONST keyword. How can I keep this from happening?



Software/Hardware used:
IBMi Version V6R1
ASKED: October 4, 2011  3:08 PM
UPDATED: March 31, 2012  12:42 AM

Answer Wiki

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

From the called program:
<pre> *
C *Entry PList
C Parm pAction
C Parm PCallIdnt
C Parm PFrmDoc
C Parm PFrmSfx
C Parm PNewDoc
C Parm PNewSfx
C Parm pBlindKey
C Parm pCustPrfx
C Parm pCustNmbr
* </pre>

<pre>
** Parm Entry Fields
D pAction s 1a
D pCallIdnt s Like(SO0IDNT)
D pFrmDoc s Like(SO0NBR)
D pFrmSfx s Like(SO0VSN)
D pNewDoc s Like(SO0NBR)
D pNewSfx s Like(SO0VSN)
D pBlindKey s Like(SO0CKEY)
D pCustPrfx s Like(SO0PRFX)
D pCustNmbr s Like(SO0NMBR)
* </pre>

Here are the file definitions for the SO310 files used in the program:
<pre>
* SQ,SO,MCA Certificate Header File
FSO310L1 UF A E K Disk Rename(SO310RF:SO310RF1)
*
* SQ,SO,MCA Certificate Header File
FSO310L2 UF A E K Disk Rename(SO310RF:SO310RF2)
*
* SQ,SO,MCA Certificate Header File
FSO310L3 IF E K Disk Rename(SO310RF:SO310RF3)
*
</pre>
From the DDS for this file:
<pre>
A REF(WISEFLDREF)
A R SO310RF TEXT(‘SQ,SO,MCA Certificate Header’)
A SO0IDNT R REFFLD(RFXXREFTYP)
A COLHDG(‘SOE/SOQ/MCA’ ‘Identifier’)
A SO0NBR R REFFLD(RFXXORDREF)
A COLHDG(‘Order/Quote/MCA’ ‘number’)
A SO0VSN R REFFLD(RFSUFX)
A COLHDG(‘Revision Number’)
A SO0CKEY R REFFLD(RFXXBKEY)
A COLHDG(‘Cert Key(Blind)’)
A SO0STAT R REFFLD(RFVXCRTSTS)
A COLHDG(‘Cert Status(A,D)’)
A SO0PRFX R REFFLD(PFX01A)
A COLHDG(‘Customer’ ‘Prefix’)
A SO0NMBR R REFFLD(CST06A)
A COLHDG(‘Customer Number’)
</pre>

Here is the corresponding entry from the wisefldref:
<pre>
M025 * A/R Invoice Suffix
A RFSUFX 2S 0 TEXT(‘Invoice Suffix’)
A COLHDG(‘Invoice’ ‘Suffix’)
</pre>
There is no move or eval of the values into the entry list. Via debug, I step (shift F10) from the managecert prototype call and hit F10 twice and I am at the *Entry Plist in the *inzsr subroutine and that’s where I check the values and they are incorrect.

Discuss This Question: 4  Replies

 
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
  • Canuhp
    Here is the prototype from the calling program (written in free):
        D  ManageCert     PR                  ExtPgm('SO311R')
         D    pAction                     1A   Const
         D    pCallIdNt                   1A   Const
         D    pFrmDoc                    20A   Const
         D    pInvSufx                    2S 0 Const
         D    pNewDoc                    20A   Const
         D    pMcaSufx                    2S 0 Const
         D    pBlindKey                   9P 0 Const
         D    pPrefix                     1A   Const
         D    pCust                       6A   Const
    
    Here are the entry fields (pFrmSfx and pNewSfx) from the called program (not written in free):
           ** Parm Entry Fields                                
          D pAction         s              1a                  
          D pCallIdnt       s                   Like(SO0IDNT)  
          D pFrmDoc         s                   Like(SO0NBR)   
          D pFrmSfx         s                   Like(SO0VSN)   
          D pNewDoc         s                   Like(SO0NBR)   
          D pNewSfx         s                   Like(SO0VSN)   
          D pBlindKey       s                   Like(SO0CKEY)  
          D pCustPrfx       s                   Like(SO0PRFX)  
          D pCustNmbr       s                   Like(SO0NMBR)  
    
    The LIKEs reference file field:
    
         A            SO0VSN    R               REFFLD(RFSUFX)                  
         A                                                 COLHDG('Revision Number')     
    
    Here is the reference field definition:
         A            RFSUFX         2S 0       TEXT('Invoice Suffix')      
         A                                                    COLHDG('Invoice' 'Suffix')    
    
    235 pointsBadges:
    report
  • TomLiotta
    ...the value of these two variables have changed when I look at the entry list in that program. The values have changed to what? How are you calling the program? The fields that you list as entry fields (pFrmSfx and pNewSfx) from the called program get values in them from where? Tom
    125,585 pointsBadges:
    report
  • Canuhp
    The values in the variable have changed to 0 and a null character. The call looks like:
             ManageCert(pAction:pCallIdNt:pFrmDoc:pInvSufx:pNewDoc:pMcaSufx:
                        pBlindKey:pPrefix:pCust);
    
    The pInvSuf and the pMcaSufx populate the pFrmSuf and the pNewSuf. ThepInvSuf is the suffix to an exisiting invoice in our database and the pMcaSuf is the next available suffix number for that same invoice number.
    235 pointsBadges:
    report
  • TomLiotta
    The pInvSuf and the pMcaSufx populate the pFrmSuf and the pNewSuf. Yes, but how? Are they referenced through an *ENTRY PLIST? If so, what does the PLIST look like? Are they EVALed from prototyped parameters in the called program? (Or is it MOVE instead of EVAL?) If so, what does that prototype look like? Show how those fields receive their values. Note that it is irrelevant whether the code is /FREE or not. The values won't change based on coding format, but only by the definitions of the data and the op-codes used. Tom
    125,585 pointsBadges:
    report

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