IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

999 to S9(1)V9(2) PD conversion


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
itzphaniz

New User


Joined: 02 Sep 2005
Posts: 39

PostPosted: Sat Feb 23, 2008 6:52 pm
Reply with quote

Hi,

I've two variables VAR1 & VAR2 which are defined as 9(3), S9(1)V9(2) COMP-3 resprectively.

VAR1 has 999 as its value. When i move VAR1 to VAR2, its value is 9.00

Question1: Why is VAR2's value 9.00 instead of 9.99?
Question2: What should i do to make sure that 9.99 gets moved to VAR2?

Any help would be deeply Appreciated

Thanks!
DP
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat Feb 23, 2008 7:29 pm
Reply with quote

itzphaniz wrote:
Question1: Why is VAR2's value 9.00 instead of 9.99?
999 is seen as 999.00 and the recieving field causes the truncation of the high digits.
Quote:
Question2: What should i do to make sure that 9.99 gets moved to VAR2?
COMPUTE VAR2 = VAR1 / 100
or
VAR1 PIC 9(3).
VAR1A REDEFINES VAR1 PIC 9V99.
VAR2 PIC S9(1)V9(2) COMP-3.
MOVE VAR1A TO VAR2
Back to top
View user's profile Send private message
itzphaniz

New User


Joined: 02 Sep 2005
Posts: 39

PostPosted: Sat Feb 23, 2008 7:37 pm
Reply with quote

Thanks 'CICS Guy'. You're the best! icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts SMF Record Date conversion failing CLIST & REXX 1
No new posts Assembler class assignment: stuck on ... PL/I & Assembler 12
Search our Forums:

Back to Top