Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Conversion of DLI update Jobs as BMP ... Gopinath Shanmugam IMS DB/DC 3 Wed Dec 20, 2017 12:02 pm
No new posts Conversion of UTF-8 to EBCDIC muralikrishnan_new COBOL Programming 1 Tue Nov 21, 2017 5:33 pm
No new posts Mainframe Blocks to Tracks conversion upendrasri JCL & VSAM 1 Sat Nov 18, 2017 10:52 am
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

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us