wht is packed decimal in cobol

Answers were Sorted based on User's Feedback



wht is packed decimal in cobol..

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

wht is packed decimal in cobol..

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

Post New Answer

More COBOL Interview Questions

In COBOL, what is the different between index and subscript?

0 Answers   TryTechnicals Pvt Ltd,


Syntax for JCLLIB & JOBLIB???

1 Answers  


I have a files containing both duplicate and non-duplicate records.The file is already sorted by a key.I want to determine those records that are duplicate and records that are non-duplicate.If duplicate the record is move to a duplicate file and if non-duplicate that will be move to valid file.thank you

1 Answers  


What are the rules of the move verb?

0 Answers  


what are the utilities for load and unload the DB2 tables

1 Answers   L&T,






hai friends ,i have HSBc exam on this sunday,my platform is Mainframe,i have 1 year exp,pls any one send me placement papers of Hsbc and technical questions on mainframe

6 Answers   Citi Bank, CitiGroup, HSBC, iNautix, Wipro,


How to define a array dynamically.....

5 Answers   Fidelity,


what are the limitations of Inline Perform?

3 Answers   Zensar,


What is the use of EVALUATE statement?

4 Answers   Tesco,


IF I mention stop run in CICS what happens?

0 Answers   IBM,


whats the disadvantage of search all over search?

4 Answers   Patni, TCS,


What is the difference between Call and a Link?

0 Answers  


Categories