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

If we put three reads in COBOL in the same para one after the other, to read a PS file,will it read the same record thrice or it will read three records sequentially? For example : Input File 01 02 03 Para 900 Read infile Display Infile rec Read infile Display infile rec Read infile Display infile rec. What will be the output?

2 Answers  


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.

3 Answers  


I have a sequential file of 100 records. How do I load the records into a two dimensional array ?

3 Answers   IBM, Xansa,


which is faster either static call or dynamic call ? and specify the reasons for it ? reply fast

1 Answers  


What does the IS NUMERIC clause establish ?

2 Answers  






) How do you access the migrate the data from production region to development region

1 Answers   IBM,


if one main program ,n -subprograms are then which call you follow ?why reasonuhg

4 Answers   UHG,


I have dataset DS1 which has records say 1 2 3 4 5 ... ... etc And also I have second dataset DS2 whcih has records 1 3 4 5 6 8 .. ... Both the files are sorted and now I want to compare these files and write it into the third files if the records are matching.

4 Answers   FIS, Wipro,


consider the following FD FILE-1 01 REC-1 PIC X(80) ...... WORKING-STORAGE SECTION 01 W-REC PIC X(90) ........ PROCEDURE DIVISION FIRST-PARA ....... READ FILE-1 INTO W-REC AT END MOVE 1 TO EOF-FLAG which of the following is true with respect to the above? a.REC-1 will contain nothing and W-REC will contain the contains of the record read b.REC-1 and W-REC contain the same data c.syntex is invalid and error will occur d.REC-1 and W-REC must be of same size

1 Answers   TCS,


A cobol program to read a file , match it with other if. If match occurs then write it to an output file. If no match then no need to write it.Error log created by program to track any error.

1 Answers  


What are literals?

0 Answers  


what is a zoned decimal data type and how it will be stored?

2 Answers   IBM,


Categories