consider the following piece of code
01 GROUP-ITEM
05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50
05 AMOUNT-2 PIC 9(4)V99 USAGE COMP
MOVE ZERO TO GROUP-ITEM
ADD 50 TO AMOUNT-1
what will be the content of AMOUNT-1?
a.50
b.100
c.0
d.unpredictable
Answer Posted / priyanka
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 GROUP-ITEM.
05 AMOUNT-1 PIC 99V9 COMP USAGE COMP VALUE 50.
05 AMOUNT-2 PIC 9(4)V99 USAGE COMP.
PROCEDURE DIVISION.
A000-FIRST-PARA.
INITIALIZE GROUP-ITEM.
MOVE 0 TO GROUP-ITEM.
ADD 50 TO AMOUNT-1.
DISPLAY AMOUNT-1
.
STOP RUN.
If we don't use " MOVE 0 TO GROUP-ITEM." condition then the answer is 50 else if we are using it then the answer is 32.0. so I think the right answer is unpredictable.
Please correct in email if I am wrong.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the difference between next sentence and continue in cobol programing language?
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
What is a scope terminator give example?
I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......
Explain how to differentiate call by context by comparing it to other calls?
What is amode(31)
What are the rules of the move verb?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
how to convert the recors form vsam file to db2 table tru file aid
Name the divisions, which are available in a cobol program?
Can you please let me know the centre name of INS certification in Kolkata.
how to access the file from prodution from changeman tool and to submit a file to production
What is the difference between perform … with test after and perform … with test before?
What do you understand by psb and acb?
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?