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

What are the Advantages of using comp-3 variables


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kumar40322

New User


Joined: 25 Apr 2009
Posts: 15
Location: Hyderabad

PostPosted: Thu Aug 06, 2009 11:02 pm
Reply with quote

Hi

What are the Advantages of using comp-3 variables?Whether we can see comp-3 variables?If so how?
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Thu Aug 06, 2009 11:19 pm
Reply with quote

Each digit only takes 1/2 byte, plus 1/2 byte for the sign (even if it is unsigned).
You may view it the same ways you view other variables but you may need to turn hex on in order to understand it better.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Aug 06, 2009 11:26 pm
Reply with quote

Hello,

In addition to the space savings, Packed-decimal (comp-3) provides better performance than Zoned-decimal in computations.

Some instructions require packed-decimal data, so if the field is not already packed-decimal, it must be converted to packed-decimal to be used. This is automatically done by the complier, so many people do not even know it happens.
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Fri Aug 07, 2009 8:45 am
Reply with quote

Hi,
Have a look at this may be this will help u
for comp3
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Aug 07, 2009 9:13 am
Reply with quote

The best place to look for how data is stored is the COBOL Language Reference Manual. The Programming Guide, I think, will give tips on which pictures and usage clauses are the best to use for any given purpose.
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 COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts JCL with variables JCL & VSAM 1
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts JCL Variables JCL & VSAM 1
Search our Forums:

Back to Top