MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Decimal portion is not populated.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Tue Feb 27, 2007 5:31 am    Post subject: Decimal portion is not populated. Reply with quote

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..... Embarassed

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
View user's profile Send private message
blitz2
Beginner


Joined: 23 Jan 2007
Posts: 84
Topics: 14

PostPosted: Tue Feb 27, 2007 5:47 am    Post subject: Reply with quote

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
View user's profile Send private message
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Tue Feb 27, 2007 5:57 am    Post subject: sorry Reply with quote

sorry guys.......I got answer to this question.

The move should be 123456789.99 to the ws-nm-1 field.

Wink
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
karthikeyan
Beginner


Joined: 29 May 2004
Posts: 16
Topics: 4
Location: chennai

PostPosted: Tue Feb 27, 2007 6:40 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group