View previous topic :: View next topic |
Author |
Message |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Sun Sep 11, 2005 2:42 am Post subject: CONVERTING NUMERIC EDITED TO NUMERIC |
|
|
My requirement in my program is to convert numeric edited to edited.I am having declaration in my Program like this :
05 A-EDITED PIC 9(7).99.
05 B-EDITED PIC 9(7).99.
05 C-EDITED PIC 9(9).99.
I want to move these numeric edited to numeric so i have made declarations like below and my corresonding moves are :
05 A PIC 9(7)V99.
05 B PIC 9(7)V99.
05 C PIC 9(9)V99.
05 D S9(07)V9(02) COMP-3.
Procedure division.
MOVE A-EDITED TO A.
MOVE B-EDITED TO B.
MOVE C-EDITED TO C.
1.QUESTION
COMPUTE D ROUNDED = A / 2.
Can i perform this operation ?
or should i have the statement
COMPUTE D ROUNDED = A-EDITED / 2.
2.QUESTION
MOVE A TO D.
Can i perform this operation ?
or should i have the statement
MOVE A-EDITED TO D.
Can anyone clarify me the corresponding statements what might happen at compilation / execution time ? |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Sun Sep 11, 2005 3:50 am Post subject: |
|
|
Shekar123,
The code below will definitely work. Numeric Edited fields can only be used for display/reporting purposes. They cannot take part in Arithmetic computations. Since 'A' is just a normal numeric variable, the code below will work.
Code: |
COMPUTE D ROUNDED = A / 2.
Can i perform this operation ?
|
And, you will get compile time error for this.
Code: |
COMPUTE D ROUNDED = A-EDITED / 2.
|
Both the statements listed below will work. Numeric Edited cannot be used in Arithmetic computations but can definitely take part in MOVEs.
Code: |
MOVE A TO D.
MOVE A-EDITED TO D.
|
Code: |
Can anyone clarify me the corresponding statements what might happen at compilation / execution time ?
|
Why don't u try and let us know.
Thanks,
Phantom |
|
Back to top |
|
|
|
|