when COMP-3 is preferrable?

Answers were Sorted based on User's Feedback



when COMP-3 is preferrable?..

Answer / sunny kalra

Packed Decimal representation. Two digits are stored in each byte. Last nibble is for
sign. (F for unsigned positive, C for signed positive and D for signed negative)
Formula for Bytes: Integer ((n/2) + 1)) => n is number of 9s.

Is This Answer Correct ?    5 Yes 0 No

when COMP-3 is preferrable?..

Answer / sunny kalra

Also, if you need more than 18 decimal digits, you must use COMP-3 (or DISPLAY) as COMP variables cannot exceed 18 digits while COMP-3 can be up to 31 digits.

Is This Answer Correct ?    5 Yes 1 No

when COMP-3 is preferrable?..

Answer / kiran

Hi friends Both are correct and you can make use of them as
your reference.
Packed Decimal representation. Two digits are stored in
each byte. Last nibble is for
sign. (F for unsigned positive, C for signed positive and D
for signed negative)
Formula for Bytes: Integer ((n/2) + 1)) => n is number of
9s.

if you need more than 18 decimal digits, you must use COMP-
3 (or DISPLAY) as COMP variables cannot exceed 18 digits
while COMP-3 can be up to 31 digits.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More COBOL Interview Questions

what is redefines? where it can be effectively use for the purpose of memory utilization? give an example?

4 Answers   IBM,


Can we move SPACES to numeric field and ZEROES to alphabetic field? If yes what are the way doing this?

6 Answers   T systems,


1.Can we define condition-name conditions in FD entry.

11 Answers  


consider the following progrm statements MOVE 0 TO SW.NO.OF.REC PERFORM PRI-OUT UNTIL SW=1 DISPALY NO.OF.REC STOP RUN PRE-OUT READ IN-FILE AT END MOVE 1 TO SW WRITE OUO-REC FROM IN-REC ADD 1 TO NO.OF REC if the IN-FILE contains 1000 records what value will be displayedafter the PERFORM is over?assume that N0.OF.REC has PIC 9(4) a.1000 b.1001 c.1 d.none of the above since there is a syntex error

4 Answers   TCS,


can we use variable picture clause as xx.99 in cobol.

3 Answers  






Can anyone explain me CALL procedure in COBOL.Does it carries similarities like call by reference in C.

1 Answers  


what is the difference between PA & PF keys?

1 Answers   IBM,


How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?

0 Answers   HeadStrong,


9(2).99 how many bytes take? Why . consider as a byte?

2 Answers  


Which mode is used to operate the sequential file?

0 Answers  


If a file has 1000 records.. if i have to replace the first and last characters of the file with another character. how it can be done....

1 Answers   HCL,


what is the diff b/w select stsmt and cursor ?

2 Answers  


Categories