what is the use of comp2 ? where can we use it with example ?

Answers were Sorted based on User's Feedback



what is the use of comp2 ? where can we use it with example ?..

Answer / smartboy

COMP-2 has double precision. Generally used in scientific
data calculations.

USAGE COMP-2 EXAMPLE.
A very simple practical example can be
If DB2 decleration of column is DOUBLE then we have to use
corresponding COBOL host variable as COMP-2
For float data type use COMP-1

Is This Answer Correct ?    13 Yes 0 No

what is the use of comp2 ? where can we use it with example ?..

Answer / kumar

Internal representation of COMP 2 data type is Hexadecimal
requires double word for the data item to store. Used for
accurate calculations ( more precessions )

Is This Answer Correct ?    3 Yes 0 No

what is the use of comp2 ? where can we use it with example ?..

Answer / srinivas yadav

It is used to reduce the Momery space.
comp2:
1)The data stored in the form of Hexa-decimal format.
2)The no. of bytes stored as s9(1)to s9(18)is 8 bytes of
memory.
3)It takes more precession values.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More COBOL Interview Questions

How do you come out of an EVALUATE statement?

3 Answers  


Q:what is the difference between the variable length and fixed lenght.how it varies in the cobol.

12 Answers   CTS, 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,


What is the LINKAGE SECTION used for?

4 Answers  


sample code for read a 2nd record from last in flatfile how can do?

4 Answers   iNautix,






Which of the following paragraphs is compulsory in every COBOL program? (a) SPECIAL-NAMES (b) PROGRAM-ID (c) FILE-CONTROL (d) OBJECT-COMPUTER

4 Answers  


What is JOBLIB and STEPLIB in JCL? what is the purpose of using it?

1 Answers  


In a file if a column account number conatain value 0001234.. how can we move the value to another variable without zero. value may contain any type such as 00123405. we need the value 1234 or 12305. how can we do that in cobol. Please help.

1 Answers   CSC,


What are the different rules for performing sort operation?

0 Answers  


What is redefines clause in COBOL?

0 Answers   B-Ways TecnoSoft,


I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.

2 Answers   L&T,


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,


Categories