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
State the various causes of s0c1, s0c5 and s0c7.
What is report-item in COBOL?
Write a program that uses move corresponding.
Write some characteristics of cobol as means of business language.
What is Pic 9v99 Indicates in COBOL?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
How you can characterize tables in cobol?
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
What is the difference between PIC 9.99 and PIC9v99?
How do you reference the following file formats from cobol programs?
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
What is a report item?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need