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


Please Help Members By Posting Answers For Below Questions

Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2052


can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech

1950


What are the pertinent COBOL commands?

2621


Why would you use find and get rather than to obtain?

680


Write a program to explain size error.

669






Explain about different table spaces.

645


What is the utilization of copybook in cobol?

651


How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

716


What is the default value(s) for an initialize and what keyword allows for an override of the default?

691


What is the difference between Global and External Variables?

661


Write a program that uses move corresponding.

669


Which is not true about evaluate statement

1567


example for sub strings ? and refernce modifications whit output pls

1843


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

892


Explain how to differentiate call by context by comparing it to other calls?

683