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
 
Need the result when moving COMP to Decimal

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Sep 25, 2006 3:08 pm    Post subject: Need the result when moving COMP to Decimal
Reply with quote

hi i
have a field declared as s9(4) comp which contains 32768 ..now i move this to 9(4) ..wht will the new field contain and y ??????

regards
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1191
Location: Bangalore,India

PostPosted: Mon Sep 25, 2006 4:19 pm    Post subject:
Reply with quote

Hi Ashimer,

It will contain 2768.

This link will be helpful:
http://www.helsinki.fi/atk/unix/dec_manuals/cobv27ua/cobum_008.htm
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Mon Sep 25, 2006 4:27 pm    Post subject: Re: comp to decimal
Reply with quote

Hi

First have a look at declarations. Comp is the same as binary. So S9(4) comp themes to be two bytes binary. Comp-3 is the same as packed decimal. And Pic S9(4) is a four byte numeric field.

I think, now it's clear !

Remarks:

Using binary fields within arithmetic intruktions are more effective as packed decimal, even if the numeric digits are not more than
9 digits.

Conversations between packed decimal and display have a bigger performance than between binary and display.

Regards, UmeySan
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 How can I convert charactor to fixed ... liying DFSORT/ICETOOL 7 Tue May 22, 2018 3:35 pm
No new posts Handling result sets in the calling N... Rusikesh DB2 7 Fri Apr 13, 2018 12:25 am
No new posts How to group and sum the decimal value sakrat DFSORT/ICETOOL 2 Tue Mar 06, 2018 9:13 pm
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm

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