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 are the working storage fields in BMS macro?

2 Answers   IBM,


A table has two indexes defined. Which one will be used by the SEARCH?

0 Answers  


What is the difference between SEARCH and SEARCH ALL?

6 Answers   Cognizant,


How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

0 Answers   Infosys,


IF there 5 to 6 files in a JCL and there is some space abends, how can we identify which file has space abend and what can be done to get off that abend or rectify that abend.

2 Answers   ADNA, CSC,






When the working storage variables get allocated? a.At Compile time b.At starting of the run time c.At end of the run time. d.None of these

6 Answers   Wipro,


Explain call by context by comparing it to other calls.

1 Answers  


How can you submit a job from COBOL programs?

2 Answers   ITC Infotech,


What compiler option would you use for dynamic linking?

2 Answers  


If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will display only 3.(the next sentence, ie., after fullstop/period) ____________________________________ if a>b continue end-if display 1 display 2. display 3. If a>b, it Will display 1 2 3 (the next statement) ____________________________________ if a>b continue display 1 end-if display 2 display 3. display 4. If a>b, Will it display 2 3 4 (or) 1 2 3 4 ?

8 Answers   UST,


How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?

1 Answers  


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

0 Answers  


Categories