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
 

 

About comp, comp2, comp1, comp3, comp4

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

New User


Joined: 12 Aug 2003
Posts: 2

PostPosted: Fri Sep 05, 2003 1:31 pm    Post subject: About comp, comp2, comp1, comp3, comp4
Reply with quote

where should we use these these comps
for what purpose we use comps
Back to top
View user's profile Send private message

mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1203
Location: India

PostPosted: Sat Sep 06, 2003 1:33 pm    Post subject: re
Reply with quote

Dear,

You can use comp variables:

1. For effective arithmatic calculations
2. For saving memory/register area
3. For faster program execution time

Some applications of comp items are
1. Counters
2. Incrementers
3. Loop variables
3. System internal data

Use COMP-1 FOR FLOATING POINT data when digits<= 8

Use COM-2 for higher floating points

Use COMP-3 for decimal data.

Refer http://ibmmainframes.com/size.html for more info.
Back to top
View user's profile Send private message
DNelsonPNC

EXPERT


Joined: 15 Jun 2003
Posts: 10
Location: North Carolina

PostPosted: Fri Oct 17, 2003 5:33 am    Post subject:
Reply with quote

COMP is binary integer data, 9(4) is 2 byte integer (-32768 - +32767)
9(9) is full word (4 byte integer); 9(18) is double word (8 byte integer)
Less than the number of digits per size are rounded up by the compiler to the next higher (i.e 9(2) is same as 9(4); 9(5) is same as 9(9); 9(10) is same as 9(18).

This a part of the COBOL standard and does not vary by platform. The way the data is stored may vary by platform (i.e. Mainframe does not store binary the same way a PC stores binary.)

This is also explained in detail in the language reference manuals.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Wed Nov 23, 2005 10:24 am    Post subject: COMP
Reply with quote

hi frnd,

check this link for more about COMP

http://www.discinterchange.com/TechTalk_COBOL_comp_.html
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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 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
No new posts Need help to populate date in COMP-3 ... chetanambi DFSORT/ICETOOL 3 Tue Jun 21, 2016 12:25 pm
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts SIGNED DECIMAL TO COMP-3 using cobol ... ram_vizag COBOL Programming 1 Tue Mar 01, 2016 11:32 pm


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