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
 
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: 1200
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 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
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm

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