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
 

 

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: 1187
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: 743
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
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Moving a PD to PD spoorni DFSORT/ICETOOL 8 Fri Oct 07, 2016 9:52 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


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