regarding comp-5



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

regarding comp-5

Postby Kal El » Wed Jul 28, 2010 1:32 pm

We all know that pic s9(1)- pic s9(4) comp-5 has 2 bytes of data.
But why is it so why can it not incorporate 1 byte of data? does this have anything to do with IBM mainframe registers?

Also could anyone give me in simple terms the difference between comp-3 and comp-5 and packed decimal?
Kal El
 
Posts: 9
Joined: Mon Jun 21, 2010 1:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: regarding comp-5

 

Re: regarding comp-5

Postby Robert Sample » Wed Jul 28, 2010 3:13 pm

Packed decimal is COMP-3 -- the terms can be used interchangeably.

COMP-5 is COMP -- but COMP may obey the PICTURE size, based on compiler options, while COMP-5 always provides the binary values not the PICTURE size.

But why is it so why can it not incorporate 1 byte of data? does this have anything to do with IBM mainframe registers?
This makes no sense as stated -- you need to ask your question in a clearer way. You also need to spend some time in the COBOL manuals learning the internal formats for numeric variables.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times

Re: regarding comp-5

Postby dick scherrer » Thu Jul 29, 2010 12:59 am

Hello,

But why is it so why can it not incorporate 1 byte of data? does this have anything to do with IBM mainframe registers?
As Robert mentioned, you need to clarify what you want to know.

I'm completly unable to relate to the "mainframe registers" in this question.

If you find something in the manual that is not clear, post what you found and your doubt. SOmeone will be able to clarify.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post