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

Need the result when moving COMP to Decimal


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

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

Hi Ashimer,

It will contain 2768.

This link will be helpful:
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: 771
Location: Germany

PostPosted: Mon Sep 25, 2006 4:27 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts first column truncated in search result IBM Tools 13
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top