Answer Posted / billyboyo
Packed decimal is IBM's method to allow calculation
directly in base-10.
A DISPLAY numeric field might be PIC S9(7).
If you were to try to add 1 to this, the compiler would
convert, in its own work area, this field to a "packed
decimal" field and generate an AP (Add Packed) to do the
addition, then it would convert the field back to DISPLAY
and the correct value would be in your PIC S9(7) field.
Notice that if you had started off with a COMP-3 (packed
decimal) PIC S9(7) you avoid doing two conversions (from
display to packed and from packed to display).
If you have 1234567 in your display field, it looks like
this in HEX "F1F2F3F4F5F6F7". In comp-3/packed decimal it
looks like this in HEX "1234567C", where the C is the sign
(C is positive, D is negative, and F is unsigned).
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
how can i see junk values in dclgen or in hostvariable of comp ?
What is the default value(s) for an initialize and what keyword allows for an override of the default?
Explain what you understand by passing by value.
Write some characteristics of cobol as means of business language.
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
In which area will you utilize 88 level items in cobol?
Give some examples of command terminators?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
i need a small 3d program using inline and outline.
Define static linking and dynamic linking.
What are the pertinent COBOL
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
What is the difference between comp and comp-3 usage?
Write a program to explain size error.