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

How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

0 Answers   Infosys,


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

0 Answers  


Consider the below example call a-test1. -- -- -- a-test1. if a=b perform a-test through a-exit next sentence else if b=c perform c-test through c-exit. if a=d perform d-test through d-exit. a-test. -- -- a-exit. exit. can u tell me what will happen if a=b after looping into a-exit will the control go back to a- test1. will the condition a=d be checked???

5 Answers   IBM,


How to convert bunch of words in a line to relvant ASCII values?

2 Answers  


Why we need to use redefine clause when we can define the variable seperately... what is actual need....

5 Answers   Accenture,






what is scope terminator

2 Answers   IBM,


In an EVALUATE statement, can I give a complex condition on a when clause?

2 Answers  


I have a cobol program with a sub program. How ca i find that it is a dynamic call? or static call..?

3 Answers   HCL, IBM,


what is srange and nosrange pls reply to ths question ?

2 Answers   L&T,


what are the limitations of Inline Perform?

3 Answers   Zensar,


What is the maximum size of a 01 level item in COBOL I? in COBOL II?

2 Answers   IBM, RBS,


What is SDSF?

3 Answers  


Categories