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 declare if emp-name = AAAAA""BBB in working-storage section. After display emp-name should print like AAAAA""BB

6 Answers   Polaris,


if someone is using my file,how can i find which user id is using?

4 Answers  


What are all the divisions of a COBOL program?

0 Answers  


if we have a 10 steps how to override the 4th step in jcl?

2 Answers   Hewitt,


How do we get current date from system with century?

2 Answers  






what is the difference between external and global variables?

1 Answers  


what r the types of perform statement

4 Answers  


What is the difference between SEARCH and SEARCH ALL? What is more efficient?

9 Answers   IBM, iFlex, Wipro,


Can we use redefine clause in occurs clause?

10 Answers  


WE HAVE 2 FILES IN COBOL. ONE IS FIXED LENGTH RECORDS ANOTHER ONE IS VARIABLE LENGTH. IF I DECLEAR LRECL OF FIXED ONE AS 80 AND 2ND RECORD AS 132. WHAT WE NEED TO DECLEAR LRECL FOR THOSE 2 FILES IN JCL?

4 Answers   iGate,


S9(5)V9(2) occupies how many bytes memory ?

6 Answers   Cap Gemini,


given the following piece of code: CALL SUB-PGM USING A, B, C. CALL SUB-PGM USING A, C, C. (a) Both CALL statements will always produce same result. (d) Both CALL statements may produce different result. (c) Compile-time error because SUB-PGM is a dataname. (d) Compile-time error because A, B, C are used twice.

2 Answers   TCS,


Categories