View previous topic :: View next topic |
Author |
Message |
tommy123 Beginner
Joined: 04 May 2005 Posts: 21 Topics: 11
|
Posted: Sun May 08, 2005 4:30 am Post subject: PROBLEM IN EDITING CHARACTER "Z" |
|
|
Hai,
I have coded in my program as given below but i am not getting the expected output.
01 SALARY PIC 9(5)V99.
01 EDIT-SALARY PIC $ZZ,ZZ9.99 USAGE IS DISPLAY.
MOVE 1234567 TO SALARY.
DISPLAY "SALARY" SALARY.
MOVE SALARY TO EDIT-SALARY.
DISPLAY "EDIT SALARY" EDIT-SALARY.
MOVE EDIT-SALARY TO SALARY.
DISPLAY " SALARY " SALARY.
SYSOUT
------
SALARY 3456700
EDIT-SALARY $34,567.00
SALARY 3456700
Can anyone tell me why i am getting the SALARY displayed as 3456700 instead of 1234567 as i am moving the value to a data item declared correctly with assumed decimal point.I am expecting the SALARY to be displayed as 1234567, 67 being the decimal values and 12345 being the integer value.Why are two zeroes coming at the end of SALARY field & first two digits 12 are being trucated.EDIT-SALARY is getting displayed as $34,567.00 whereas i want the EDIT-SALARY field to be displayed as $12,345.67.Can anyone tell me where i am wrong / weather my assumption is wrong / how can i get the expected output . |
|
Back to top |
|
 |
Mervyn Moderator

Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Sun May 08, 2005 1:52 pm Post subject: |
|
|
You've missed out the decimal point.
Try "MOVE 12345.67 TO SALARY" _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
|
|