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 |
I know my query will return more than one row but I don't want cursor what should I do?
how do you reference the printer file formats from cobol programs
Define REDEFINE clause and Is it possible to have the redefine clause anywhere in the working storage section for a data name?
whats the difference between search and search all?
1.What is the default print format in cobol?
Are you comfortable in cobol or jcl?
HOW TO MOVE REDEFINES CLAUSE FROM INPUT TO OUTPUT ?
01 NAME1 PIC X(13) VALUE "COBOL PROGRAMMING". 01 NAME2 PIC X(13). now I want to display the value of NAME1 in reverse order i.e value should be displayed as "GNIMMARGORP LOBOC" HOW can I do that ??? please let me know if any one knows it.
What is the use of intialize verb?
ID DIVISION. PROGRAM-ID. PLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 VAR1 PIC 9(2). 01 VAR2 PIC X(2). PROCEDURE DIVISION. ACCEPT VAR2. MOVE VAR2 TO VAR1. STOP RUN. if i give 'PI' in var2 then what will b output of progr. any abend?????
A s9(4). B v9(4) value 0.21 can i move this?
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc