View previous topic :: View next topic
|
Author |
Message |
suraaj
New User
Joined: 16 Apr 2009 Posts: 69 Location: Canada
|
|
|
|
Hi
I have a code as below.
Code: |
10 AMOUNT-CHG PIC 9(09)V99.
10 AMOUNT-CHG-X REDEFINES
AMOUNT-CHG PIC X(11).
10 APP-FIELDS OCCURS 5 TIMES
INDEXED BY IDX.
15 APP-AMT PIC S9(09)V99 COMP-3.
10 CHG PIC X(01) VALUE 'N'.
88 CHG-FLG VALUE 'Y'.
|
I am moving the value from APP-AMT to AMOUNT-CHG as below:
Code: |
IF CHG-FLG (WS-SUB)
MOVE APP-AMT (IDX) TO
AMOUNT-CHG
ELSE
MOVE SPACES TO AMOUNT-CHG-X
END-IF
|
But whenever I am moving the values to the AMOUNT-CHG, it is getting populated with 40404040404
Kindly advise and please let me know if further details are required. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Add display's to ensure
Code: |
IF CHG-FLG (WS-SUB) |
is ever true?
also is this an array CHG-FLG? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
The result is SPACES because APP-AMT (IDX) equals SPACES as well. You have bad data. |
|
Back to top |
|
|
suraaj
New User
Joined: 16 Apr 2009 Posts: 69 Location: Canada
|
|
|
|
Hi
The flag is true and the source value is a valid value that I see. I have already verified that these fields have values
Regards Suraaj |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I think you've missed Rohit's points.
Your flag is not part of an OCCURS. The code you have shown will not compile.
Whatever the actual code is, your test (despite what you think) is always false, or the code is never executed and the field happens to contain space, and it is unchanged as the code never executes. Or, you are doing it in a loop and only looking at the final value which is always false, so ways sets space.
So show the actual code. We can't really tell, except we know the code is wrong. You have to accept that. Your code can't be right and give an incorrect result. |
|
Back to top |
|
|
|