View previous topic :: View next topic
|
Author |
Message |
mijanurit Currently Banned New User
Joined: 26 Aug 2005 Posts: 33 Location: bangalore
|
|
|
|
Hi All,
I know COMP is binary representation of data item and COMP-3 is packed decimal representation .. can you please explain me which one will be sutaible for application programming and why ??
Thanks
Mijanurit |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Depending on what you're doing, COMP and COMP-3 are both suitable for application programming. For example, writing programs using CICS pretty much requires COMP fields for some of the commands, especially if you want to see the RESP field. If a file was created using packed fields, you have no choice but to use COMP-3 when reading the file. |
|
Back to top |
|
|
hchinnam
New User
Joined: 18 Oct 2006 Posts: 73
|
|
|
|
Adding to what Robert said,
IF your program has more arithmetic operations then it is better to use COMP. |
|
Back to top |
|
|
satishk
New User
Joined: 20 Jul 2007 Posts: 7 Location: Hyderabad
|
|
|
|
Description as below:
COMPUTATIONAL or COMP Representation of the COMPUTATIONAL phrase is system-dependent and is normally assigned to representations that yield the greatest efficiency when arithmetic operations are performed on that system.
For the VS COBOL II compiler, the COMPUTATIONAL phrase is synonymous with BINARY.
COMPUTATIONAL-3 or COMP-3 (internal decimal)
For VS COBOL II, this is the equivalent of PACKED-DECIMAL.
The amount of storage occupied by a binary item depends on the number
of decimal digits defined in its PICTURE clause:
Digits in PICTURE Clause Storage Occupied
1 through 4 2 bytes (halfword)
5 through 9 4 bytes (fullword)
10 through 18 8 bytes (doubleword) ¦
The leftmost bit of the storage area is the operational sign. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
This is already discussed many times
You will find many topics on comp comp-3 and its use if you search on forum. Here is one
Click here it may help you
|
|
Back to top |
|
|
|