WORKING-STORAGE SECTION.

01 VAR1 COMP-2 VALUE 0.

PROCEDURE DIVISION.

MOVE 10.2115 TO VAR1.

DISPLAY 'VAR1 =' VAR1.

GOBACK.



10.2115 is stored as .10211499999999996E 02 in OS VS Cobol

10.2115 is stored as .10211500000000000E 02 in ecobol.

Any reason why?

Answers were Sorted based on User's Feedback



WORKING-STORAGE SECTION. 01 VAR1 COMP-2 VALUE 0. PROCEDURE DIVISION. MOVE 10.2115 TO VAR..

Answer / islam

Ans is : 10.2115 is stored as .10211500000000000E 02 in
ecobol.

Is This Answer Correct ?    3 Yes 1 No

WORKING-STORAGE SECTION. 01 VAR1 COMP-2 VALUE 0. PROCEDURE DIVISION. MOVE 10.2115 TO VAR..

Answer / jennifer victor

comp-2 is pre defined that it stores all the data values in hexadecimal format, using 8 bytes, hence its displayed in hexa format.

Is This Answer Correct ?    2 Yes 0 No

WORKING-STORAGE SECTION. 01 VAR1 COMP-2 VALUE 0. PROCEDURE DIVISION. MOVE 10.2115 TO VAR..

Answer / mani

comp-1 and comp-2 values can not be handled as above.

they are meant to be used for simple incrementation and i
think we can not move values like the above.

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More COBOL Interview Questions

What is static and dynamic call in cobol?

0 Answers  


88 level entry is used for (a) data items in WORKING-STORAGE SECTION (b) items with RENAMES clause (c) condition-names (d) None of the above

5 Answers   TCS,


How to read records in reverse order in flat file? I know we can do it by reading all records into an array.... Then read records in reverse order by using subscript or index but can any body give me the exact code.

5 Answers   TCS,


What will happen if we generate GDG +2 version instead of +1 version?

2 Answers   T systems,


If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly

0 Answers  






what is record label is empty or standard in file description of data division?

2 Answers   HCL,


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

0 Answers   HCL,


I have 100 records in a file.. i want to sort the records from 5 to 5o... give the syntax...

2 Answers   CTS, DSRC,


What does EXIT do ?

3 Answers   Deloitte,


copy 100 records without using ibm utilities

3 Answers  


How many maximum number of procedures can we write in one COBOL program?

5 Answers  


Suppose, file A has 100 records and file B has 500 records. We want to write records common to both A and B into file C and records which are present only in either A or B into another file D. What should be the logic of Cobol program to achieve this?

7 Answers   Bank Of America, Mind Tree,


Categories