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
IF I mention stop run in CICS what happens?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
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.
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
What are the different rules for performing sort operation?
What are the various section in data division and briefly explain them.
What is the difference between binary search and sequential search?
How can you get the ksds file records into your cobol program?
Write down the divisions of cobol program?
What rules are to be followed while using the corresponding options?
What are the cobol coding sheets?
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?
What is the difference between comp and comp-3 usage?
What is the default value(s) for an initialize and what keyword allows for an override of the default?
What is the difference between next sentence and continue in cobol programing language?