View previous topic :: View next topic
|
Author |
Message |
vin12pr Warnings : 1 New User
Joined: 14 Jun 2006 Posts: 56
|
|
|
|
COPYBOOK
05 NEW-POL-NBR PIC X(20).
05 NEW-IN-PIM-NBR-GP REDEFINES
NEW-POL-NBR.
10 NEW-BRANCH-NBR PIC XXX.
10 NEW-DATE-NBR PIC S9(9) COMP-3.
10 FILLER PIC X(12).
-----------------------------------------------------------------------
I am facing a strange problem.
IF CONDITION
MOVE NEW-POL-NBR TO REWRITE-POL-NBR
END-IF
Sometimes whts happening is when the above move statement is executed ,Low values is getting moved to REWRITE-POL-NBR.The reason might be the fact that the NEW-POL-NBR is redefined.i am not understanding on what scnerios its moving the data present in NEW-IN-PIM-NBR-GP to REWRITE-POL-NBR.I cannot even remove NEW-IN-PIM-NBR-GP from there as its a global copybook and its used in a lot of other programs as well.
Is there any way to eliminate this problem?
Thanks for ur help in advance |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Sometimes whts happening is when the above move statement is executed ,Low values is getting moved to REWRITE-POL-NBR.The reason might be the fact that the NEW-POL-NBR is redefined.i am not understanding on what scnerios its moving the data present in NEW-IN-PIM-NBR-GP to REWRITE-POL-NBR.
|
low-values are being moved because that is the data contained in NEW-POL-NBR / NEW-IN-PIM-NBR-GP.
NEW-IN-PIM-NBR-GP and NEW-POL-NBR define the same area in memory.
your problem with the move has nothing to do with the redefine.
you are simply not populating the source (new-pol-nbr) |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Quote: |
i am not understanding on what scnerios its moving the data present in NEW-IN-PIM-NBR-GP to REWRITE-POL-NBR. |
It's your logic and you have look into it.
Please see these NEW-POL-NBR, NEW-IN-PIM-NBR-GP , where they are initialized and got values.
What does this condition say? |
|
Back to top |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
Just check whether the REWRITE-POL-NBR is getting populated with values or not. I think that the condition that you are checking against the IF is not satisfying and hence the data is not moved to the desired field. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What should be in REWRITE-POL-NBR when the condition is not true?
If you do not specifically put some value in REWRITE-POL-NBR, the content is unpredictable. |
|
Back to top |
|
|
SHAILESH OZA
New User
Joined: 10 Jun 2005 Posts: 21 Location: Mumbai
|
|
|
|
Hi ,
Check whether any of the group is intialized i.e NEW-POL-NBR/NEW-IN-PIM-NBR-GP are intialized before the execution of the your if Condition.
Since in redifne clause both the groups are using the same memory location, if any of group item is intialized then as per intialize rules, numberic data is replaced by zeros and alphanumric by spaces. |
|
Back to top |
|
|
gvsus
New User
Joined: 27 Mar 2008 Posts: 4 Location: USA
|
|
|
|
SHAILESH OZA wrote: |
Hi ,
Check whether any of the group is intialized i.e NEW-POL-NBR/NEW-IN-PIM-NBR-GP are intialized before the execution of the your if Condition.
Since in redifne clause both the groups are using the same memory location, if any of group item is intialized then as per intialize rules, numberic data is replaced by zeros and alphanumric by spaces. |
Why would you initialize your source data field? Then there is no purpose moving it to the target field.
Now to the actual problem ...
1) As some one said above, it might be happening when there the IF condition is not met. you might want to move spaces to REWRITE-POL-NBR in the ELSE part of the IF.
2) The Source itself NEW-POL-NBR has low-values in it. Note: NEW-POL-NBR and NEW-IN-PIM-NBR-GP will always have the same value, they are pointing to the same storage in memory.
Thanks |
|
Back to top |
|
|
|