View previous topic :: View next topic |
Author |
Message |
ranga_subham Intermediate

Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Tue Feb 27, 2007 5:31 am Post subject: Decimal portion is not populated. |
|
|
Hi,
I've written the below program.
Code: |
IDENTIFICATION DIVISION.
PROGRAM-ID. MOVE03.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-NM-1 PIC 9(09)V99.
01 WS-NM-2 PIC 9(09).99.
PROCEDURE DIVISION.
MAIN-PARA.
MOVE ZEROS TO WS-NM-1.
MOVE 12345678999 TO WS-NM-1 WS-NM-2.
DISPLAY 'NM-1 ' WS-NM-1.
DISPLAY 'NM-2' WS-NM-2.
STOP RUN.
|
I got the below output:
Code: |
NM-1 34567899900
NM-2 345678999.00
|
I expected the output to be.......
Code: |
NM-1 12345678999
NM-2 123456789.99
|
I know that my basics might be wrong.....
Why the decimal potion is "00" always? When it will be populated?
Please explain.
TIA. _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
 |
blitz2 Beginner

Joined: 23 Jan 2007 Posts: 84 Topics: 14
|
Posted: Tue Feb 27, 2007 5:47 am Post subject: |
|
|
Just in case you weren't aware of it, Cobol manuals are available on the homepage.. www.mvsforums.com
________
Mercedes-Benz W215 history
Last edited by blitz2 on Wed Feb 02, 2011 3:12 am; edited 1 time in total |
|
Back to top |
|
 |
ranga_subham Intermediate

Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Tue Feb 27, 2007 5:57 am Post subject: sorry |
|
|
sorry guys.......I got answer to this question.
The move should be 123456789.99 to the ws-nm-1 field.
 _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
 |
karthikeyan Beginner

Joined: 29 May 2004 Posts: 16 Topics: 4 Location: chennai
|
Posted: Tue Feb 27, 2007 6:40 am Post subject: |
|
|
Ranga,
You have to pass the value like 123456789.99 to both ws-num-1 and ws-num-2value.The WS-NUM-1 is an assumed decimal format and WS-NUM-2 is a numeric edited field.
WS-NUM-2 is used for displaying purpose.
Karthik |
|
Back to top |
|
 |
|
|