Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: 999 to S9(1)V9(2) PD conversion
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: 2150
Location: At my coffee table

PostPosted: Sat Feb 23, 2008 7:29 pm    Post subject: Re: 999 to S9(1)V9(2) PD conversion
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
No new posts EBCDIC to ASCII conversion using OCOPY mistah kurtz All Other Mainframe Topics 5 Tue Sep 06, 2016 2:26 pm
No new posts Comparex utility to Syncsort conversion mistah kurtz SYNCSORT 11 Fri Jul 22, 2016 1:53 pm
No new posts changing z/os unicode conversion service meykh2014 All Other Mainframe Topics 0 Tue Jul 12, 2016 10:49 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us