I want to declare a field with data type Double in my COBOL
program. how shall i do that ?

Answers were Sorted based on User's Feedback



I want to declare a field with data type Double in my COBOL program. how shall i do that ?..

Answer / tarunam

To Declare field with double data type u have to declare it
with comp-2
eg: PIC s9(8) usage is comp-2

Is This Answer Correct ?    8 Yes 0 No

I want to declare a field with data type Double in my COBOL program. how shall i do that ?..

Answer / fdsfsdfs

yes it has to be declared COMP 2

Is This Answer Correct ?    5 Yes 0 No

I want to declare a field with data type Double in my COBOL program. how shall i do that ?..

Answer / prasad

With the above answer we can achive decimal numeric
declaration but we will not achive double format
declaration.

To Declare double data type in COBOL we have to decalre
field with COMP-3.

Examples:

WS-NUM PIC 9(4) COMP-3. for non decimal numbers
WS-NUM1 PIC 9(4) v 99 COMP-3. For decimal values.

Is This Answer Correct ?    3 Yes 1 No

I want to declare a field with data type Double in my COBOL program. how shall i do that ?..

Answer / i go crazy

For COMP-2 we will not give PIC clause. By default it takes 8 bytes.

Is This Answer Correct ?    2 Yes 0 No

I want to declare a field with data type Double in my COBOL program. how shall i do that ?..

Answer / sri

9(X) V99 or 9(X) V(Y)

Where X and Y are integers.

Is This Answer Correct ?    3 Yes 4 No

Post New Answer

More COBOL Interview Questions

Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

0 Answers  


if you code move high-values to variable,can you move it into numeric variable or alphanumeric variable?

1 Answers   Patni,


is it possible to pass an SQL query inside a jcl which is inside a cobol program?

5 Answers   CTS,


what r the types of perform statement

4 Answers  


Consider the below example call a-test1. -- -- -- a-test1. if a=b perform a-test through a-exit next sentence else if b=c perform c-test through c-exit. if a=d perform d-test through d-exit. a-test. -- -- a-exit. exit. can u tell me what will happen if a=b after looping into a-exit will the control go back to a- test1. will the condition a=d be checked???

5 Answers   IBM,


What is mean by maxcc

7 Answers   Syntel,


Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefines a. 03 c occus 6 times pic 9. 02 d occurs 6 times pic 9. 03 e pic x(5) 03 f pic 999.

12 Answers  


which certifications r 4 cobol,jcl,db2,cics what is format of xam n what is importance of these certifications... plz post answer only if u r sure... thanks

1 Answers  


What are the various section in data division and briefly explain them.

0 Answers  


I have files that contains both duplicates files(occur more than twice) and non-duplicate files.The file is already sorted by a key.I want to determine those records that are duplicate and will be move to a duplicate file and non- duplicate files to be move to a valid file.thank you.help please

2 Answers  


01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i need to get the miuns sign in the result?

7 Answers  


how to transfer the file from pc to mainframe??

2 Answers  


Categories