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 |
How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.
Syntax for JCLLIB & JOBLIB???
COMP-3 field occupy ?
What is different between variable length and fixed length?
what are difference organizations in cobol and access mode in cobol? can you expalin what organization means while declaring for ksds,esds,rrds?
I have a cobol program with a sub program. How ca i find that it is a dynamic call? or static call..?
01rec1. 05 a pic 999v99 value 123.12 05 b pic 99v9 value 45.9 02 rec2. 05 x pic 999v99 05 y pic 99v99 05 z pic x(3) value 'abc' if rec1 is moved to rec2 then what is the value of rec2?
write a program to eliminate duplicate records in a input file and send them to output file.THIS IS IGATE RECENT QUESTIONN.....JUST 1 WEEK BACKKKK...
There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.
Can a REDEFINES clause be used along with an OCCURS clause? if yes, 01 WS-TABLE. 03 WS-TABLE-EL OCCURS 5 TIMES PIC X(1) VALUE 'A'. 03 WS-EX REDEFINES WS-TABLE-EL PIC X(5). What can you expect? if no,why?
How many times the loop runs here 01 a pic 9(2) value 10. perform para1 a times stop run. para1: move 20 to a.
why do u need inspect verb?