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
 
Difference between comp 4 and comp 5

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

New User


Joined: 04 Aug 2005
Posts: 2

PostPosted: Thu Aug 04, 2005 5:11 pm    Post subject: Difference between comp 4 and comp 5
Reply with quote

what is difference between comp4 and comp5 ?
Back to top
View user's profile Send private message

shivashunmugam Muthu

Active User


Joined: 22 Jul 2005
Posts: 114
Location: Chennai

PostPosted: Thu Aug 04, 2005 5:19 pm    Post subject: Re: cobol
Reply with quote

COMP-4 is similar to Binary & COMP

COMP-5 is for display usage type.. termed as native binary

for more explanation refer COBOL lang reference
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Thu Aug 04, 2005 5:52 pm    Post subject: Re: cobol
Reply with quote

Check out this earlier post....It gives a good description about them.....

http://ibmmainframes.com/viewtopic.php?t=146

Regards,

Priyesh.
Back to top
View user's profile Send private message
thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Thu Aug 04, 2005 9:08 pm    Post subject:
Reply with quote

hi amr


comp4 is just like as binary or comp

01 x pic 9(4) comp.

in above example it takes 2 bytes.

01 x pic 9(5) comp5.

in this example also it takes 4 bytes . it is not depend on legth specified in cobol.It will consontrate on value wich you stored in this field.

Table 5. Ranges in value of COMP-5 data items
PICTURE Storage representation Numeric values
S9(1) through S9(4) Binary halfword (2 bytes) -32768 through +32767
S9(5) through S9(9) Binary fullword (4 bytes) -2,147,483,648 through
+2,147,483,647
S9(10) through S9(18)Binary doubleword (8 bytes)
-9,223,372,036,854,775,808 through +9,223,372,036,854,775,807

9(1) through 9(4) Binary halfword (2 bytes) 0 through 65535
9(5) through 9(9) Binary fullword (4 bytes) 0 through 4,294,967,295
9(10) through 9(18) Binary doubleword (8 bytes)
0 through 18,446,744,073,709,551,615


thanks,
thanooz.
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. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
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 ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm

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