V7R1 RPGLE variable @JOBDATE1 losing value after a CALL statement

Tags:
AS/400
RPGLE
                 D @JobDate1       S               D

C EVAL @JobDate1 = %DATE(*DATE) ... 024800000000 C call(e) 'CNRWW832CT' 024900000000 C parm @@DIV @DIV 025000000000 C parm '*SEL' @MOD 025100000000 C parm @C1CODE 025200000000 C if @C1CODE ' ' 025300000000 C eval #C1CODE = @C1CODE 025400000000 C endif 025500000000
On 4/13/2013 we upgraded from v6r1 to v7r1 on a new LPAR.  The only thing I did was test and change some JOBDs on the new machine to change library DBU80 to DBU10.  It didn't appear that any other changes were required. This week, a user reported an invalid date error halt in what I consider a very basic program. I threw it in debug and saw something I do not understand. After Eval Statement: @JOBDATE1 = '2013-05-05' Before call at line 248 @JOBDATE1 = '2013-05-05' After Call at line 252 @JOBDATE1 = '          ' How? It's not a variable being passed in the call, so why would the value change? I can't get back to the old machine to test it there, so I'm wondering if it has something to do with v7r1? Thanks, Mary

Software/Hardware used:
V7R1

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: 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
  • philpl1jb
    I don't think this is a function of v7r1 but rather an existing undetected issue in your programs. First item to check is the type and size of the parameters passed @DIV,@MOD, @C1CODE against their counter parts in the called program. If any of the variables in the called program occupy more bytes then the calling program variables then this could happen.
    50,860 pointsBadges:
    report
  • TomLiotta
    Yes, but also any parms for any CALLs that happen in program CNRWW832CT need to be verified, as well as lower level CALLs. Any place with a parm mismatch may affect memory. Tom
    125,585 pointsBadges:
    report
  • MaryKyrrynMathias
    That was it, thank you! In this program: D @DIV s like(@@DIV) inz(' ') D @C1code s like(#C1Code) inz(' ') D @MOD s 4 inz(' ') ... C *entry plist C parm @@DIV C parm @@MOD 4 C parm @@TPID 20 ... In the related DSPF DDS: A 6 5'Class Of Trade:' A #C1CODE 2A B 6 22 A 41 DSPATR(RI) A 41 AO 62 DSPATR(PC) A 6 25'*' A DSPATR(HI) In program CNRWW832CT: C *entry plist C parm @@DIV 3 Division e.g. '002' C parm @@MOD 4 Mode e.g. '*SEL' C parm @@COD 20 Mode e.g. '*SEL' So clearly the Class of Trade code was defined incorrectly in the called program (s/b 2)... I corrected it and my field was no longer cleared...
    70 pointsBadges:
    report
  • philpl1jb
    Just for a wrap-up. We think of passing parameters but we really pass the addresses where the parameters start. The called program can do anything it wants with locations starting at each address. If it puts 20 blanks starting at an address that was 10 long in the called program the additional 10 blanks wipes out something. It's impact depends on what (if anything) is stored just after the 10 characters mapped by the calling program. If the called program passes this address to additional program, they too can update beyond the original programs fields.
    50,860 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