CPF511D error message in second ReadE while passing parameter

2,410 pts.
Tags:
AS/400
AS/400 programming
READE
I have an external DS defined on my program. I am doing a READE operation on this file and am passing it as parameter to another program. After returning from the called program, my program again does a READE where it is failing with CPF511D error. Joblog says Parameter integrity error occurred with reason code . Some code for reference...below is the code from calling program

D GetXXX PR ExtPgm('Pgm1') D pMvt LikeDs(FileDS) D wType 35A D wNarr 150A D FileDS E DS ExtName(FileA) C Key ReadE FileA C CallP GetTrnTyp(FileDS:wType:wNarr) *********some code here C Key ReadE FileA --->


Here it fails...below is the declaration part of called program:

Pgm1 D FileDS E DS ExtName(FileA) D Main PR ExtPgm(''PGM1') D pMVT LikeDS(FileDS) D pNarr 150A D pType 35A


Please give some input to understand the reason of error.

Software/Hardware used:
AS400
ASKED: May 10, 2013  12:51 PM
UPDATED: May 10, 2013  12:58 PM

Answer Wiki

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

Discuss This Question: 7  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
  • CharlieBrowne
    HAve the values of KEY changed? Did you do IO to the same file in the CALLP program that would reset the pointer?
    39,780 pointsBadges:
    report
  • philpl1jb
    Very odd .. a pointer error .. Very odd that the fields of Key have addresses when the first Reade occurs and don't have addresses when the second Reade occurs. Odd enough that I have to ask .. are you certain that this error is associated with this statement? Here is one thing -- if GetTrnTyp calls the "Pgm1" Passing FileDS:wType:wNarr Pgm1 receives them as FileDS: pNarr: pType Isn't one of these in the wrong order ? GetTrnTyp() Pgm1 D FileDS E DS ExtName(FileA) D Main PR ExtPgm(''PGM1') D pMVT LikeDS(FileDS) D pNarr 150A D pType 35A Hope this is formatted well enough for you to read it.
    48,545 pointsBadges:
    report
  • philpl1jb
    Odd enough that I have to ask .. are you certain that this error is associated with this statement (the second reade statement)?
    48,545 pointsBadges:
    report
  • philpl1jb
    I should read more carefully. Title of question was wrong .. doesn't fail on READE .. Here it fails...below is the declaration part of called program: -- so we've identified that two fields are passed in a different order from the receiving order but that doesn't explain this specific error. It's more like the second program "receives" some field that wasn't passed and then tries to use it.. Give what you've show us, perhaps the fields structures in FILEDS aren't the same between the programs.
    48,545 pointsBadges:
    report
  • philpl1jb
    The should be: Given what you've shown us ...
    48,545 pointsBadges:
    report
  • TomLiotta
    Since the CALLP doesn't match the parameters of the called program, it's bound to get messed up. The prototype is wrong. It allows the two character variables to be used for the two character parameters, but the addresses are wrong when PGM1 runs. PGM1 can mess up the memory at those addresses, so that the calling program sees garbage data when the CALLP ends. --
    125,585 pointsBadges:
    report
  • RamvishakRamesh
    Thanks everyone.. it is perfect once i corrected the parameter
    2,410 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