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

Discuss about changing dataset name in proc.

0 Answers  


what will be the output when a)pic 9(6)value 000178 is moved to pic ***,***. b)pic 9(5) value 57397 is moved to pic $$,$$9.

5 Answers  


The disposition parameter in the jcl is share ( DISP+SHR ) and the program opens file in extend mode what will happen?

6 Answers   Cognizant,


What is comp-1 and comp-2?

0 Answers  


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

1 Answers   Syntel,






When can the USING phrase be included in the call statement ?

2 Answers  


What are the situations u have used in ur project for Subcript and Index ? 1.if u use Subscript why not Index,why u choose Subscript only? 2.if u use Index why not Subscript,what abt Displacement?

2 Answers   Cap Gemini,


I had 100 records and i want to execute last three records by using cobol programming?what will be coding?

4 Answers   IBM,


for an INITIALIZE and what keyword allows for an override of the default.

2 Answers  


What is COMP SYNC?

3 Answers  


how can count the number of character in feild ?? suppose for instance i have a feild with value ' rajesh sarkar' then how can v count the number of characters whitout spaces...........

4 Answers   Wipro,


What is the difference between copy and include in cobol?

1 Answers  


Categories