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 do you reference the variable unblock file formats from cobol programs
Why would you use find and get rather than to obtain?
i want a program using by if, evaluate , string, unstring, perform, occurs?
How are the next sentence and continue different from each other?
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
How to remove 2 duplicate records and copy only one using job control language?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?
In COBOL programming, what is PERFORM? What is VARYING?
EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?
What are the rules of the move verb?
Name the sections present in data division.