wht is packed decimal in cobol
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / naagju
Packed decimal is nothing but COMP3..
which occupies half byte for a character n half byte for sign.
Ex.01 name pic x(10) value 'sivaNaagju'
which occupies only 5 bytes.
| Is This Answer Correct ? | 2 Yes | 5 No |
diffrence between renames and redifnes with examples
what are the diferences b/w sub-script and index?
2)Where the Plan is located in CICS-DB2?
I have a sequential file. How do I access a record in this sequential file randomly in my program ?
Which division and paragraphs are mandatory for a COBOL program?
What does the IS NUMERIC clause establish ?
i have the job which has written updated 100 records into the table and for 101th record it got abended and i want to start the job again and should wirte from 101th record not from 1st record..how to do it..?
OCCURS clause is used in the DATA DIVISION on data names at (a) 01 level (b) 77 level (c) 88 level (d) any level from 02 to 49
How to delete the records of a dataset through cobol programme?We should not use jcl utilitities like IDCAMS.
what are the error codes in cobol, db2, cics, vsam , and jcl
Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.
What guidelines should be followed to write a structured cobol prgm?