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
 

 

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
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 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


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