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 

CONVERTING NUMERIC EDITED TO NUMERIC

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


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Sun Sep 11, 2005 2:42 am    Post subject: CONVERTING NUMERIC EDITED TO NUMERIC Reply with quote

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
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Sun Sep 11, 2005 3:50 am    Post subject: Reply with quote

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

Thanks,
Phantom
Back to top
View user's profile Send private message
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