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

What is the difference between PIC 9.99 and 9v99 in COBOL?

732


How arrays can be defined in COBOL?

663


what is search and searchall?what is the diffrence between them?give an best example?

5559


How do you reference the fixed block file formats from cobol programs

705


What are the access modes of START statement?

719






what are decleratives in cobol?

1827


What are the pertinent COBOL commands?

2626


) How do u handle errors in BMS macro

1510


How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?

700


How can you get the ksds file records into your cobol program?

644


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

710


What is Pic 9v99 Indicates in COBOL?

727


How do we get current date from system with century in COBOL?

805


Whats the difference between search & search ALL?

5264


What is the compute verb? How is it used?

661