View previous topic :: View next topic
|
Author |
Message |
Roshnii
New User
Joined: 30 Sep 2008 Posts: 45 Location: bangalore
|
|
|
|
Hi
I have a field WS-AMOUNT PIC 9(17)V99.
I want to move this value to a WS-AMOUNT PIC X(19).
I want a decimal in the alphanumeric field after the 17th number.
But If I delare the variable like this , I will lose data which I do not want.
Code: |
03 WS-AMOUNT.
05 WS-AMT-X PIC 9(17)V99.
05 WS-AMT REDEFINES W300-AMT-X.
07 WS-AMT-PART1 PIC X(16).
07 WS-AMT-PART2 PIC X(01).
07 WS-AMT-PART3 PIC X(02). |
Is there any other way of moving it without losing data?
My data should look like this after moving 100.50
Thanks,
Roshnii.
Edited: Please use BBcode when You post some code, that's rather readable...Anuj |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Code: |
05 WS-MOVED-AMOUNT PIC Z(17).99. |
|
|
Back to top |
|
|
Roshnii
New User
Joined: 30 Sep 2008 Posts: 45 Location: bangalore
|
|
|
|
Hi,
Thank you for the solution.
Thanks,
Roshnii |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Are you saying that you want 17 digits to the left of the decimal + 1 decimal point + 2 digits to the right of the decimal (17+1+2=20) and you want to store these 20 characters in a 19 character field with no loss of data? |
|
Back to top |
|
|
Roshnii
New User
Joined: 30 Sep 2008 Posts: 45 Location: bangalore
|
|
|
|
No, I am storing these in a 20 char field. and the format is
Quote: |
17 digits to the left of the decimal + 1 decimal point + 2 digits to the right of the decimal (17+1+2=20)
|
But I got the solution . Thanks |
|
Back to top |
|
|
|