Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between COMP & COMP-3 ?

Answer Posted / raghunandan modak

COMP is a binary storage format while COMP-3 is packed
decimal format.

For comp-3 you can refer following examples -

Packed Decimal fields: Sign is stored as a hex value in
the last nibble (4 bits ) of the storage.

The actual number of bytes occupied in the file is about
half that. To calculate the number of bytes from the PIC,
add 1 (for the sign) to the total number of digits, divide
by 2, and round up if necessary. For example:

PIC S9(7) COMP-3. Byte size = (7 + 1) / 2 = 4
PIC S9(5)V99 COMP-3. Byte size = (5 + 2 + 1) / 2 = 4
PIC S9(6) COMP-3. Byte size = (6 + 1) / 2 = 3.5,
rounded to 4
Comp-3 fields reserve a nibble for the sign, even
for "unsigned" values, so the following fields are still 4
bytes:
PIC 9(7) COMP-3. Byte size = (7 + 1) / 2 = 4
PIC 9(6) COMP-3. Byte size = (6 + 1) / 2 = 3.5,
rounded to 4.

Is This Answer Correct ?    47 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

IF I mention stop run in CICS what happens?

2421


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

1147


Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2471


can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech

2487


What are the different rules for performing sort operation?

1268


What are the various section in data division and briefly explain them.

1246


What is the difference between binary search and sequential search?

1125


How can you get the ksds file records into your cobol program?

1133


Write down the divisions of cobol program?

1329


What rules are to be followed while using the corresponding options?

1121


What are the cobol coding sheets?

1348


here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?

8018


What is the difference between comp and comp-3 usage?

1250


What is the default value(s) for an initialize and what keyword allows for an override of the default?

1259


What is the difference between next sentence and continue in cobol programing language?

1271