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

Answers were Sorted based on User's Feedback



consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP V..

Answer / suresh

hi naveen,

Actually we are moving 0 to group-item so it will become
zero and adding 50 to amount-1. Hence Amount-1 is 50.

please correct me if i am wrong.

Is This Answer Correct ?    5 Yes 1 No

consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP V..

Answer / ashok

i have tried it, the answer is D unpredictable

Is This Answer Correct ?    4 Yes 0 No

consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP V..

Answer / man

d. unpredictable

GROUP-ITEM is considered as alphanumeric. You can only
initialise a group item.

Is This Answer Correct ?    3 Yes 1 No

consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP V..

Answer / jyotiprakash8

a is write ans

Is This Answer Correct ?    1 Yes 1 No

consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP V..

Answer / jyoti prakash

Ans is D and this 100% proof i have tested

Is This Answer Correct ?    1 Yes 1 No

consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP V..

Answer / 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

consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP V..

Answer / harish

u r right a. 50

pls correct me if anything wrong

HARISH POOMGAME SHIVAPPA(hassan,karnataka)
NIIT TECHNOLOGY
KOLKATA

Is This Answer Correct ?    1 Yes 2 No

consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP V..

Answer / sachin borase

yes answer will be 50.

But if you initialize instead of move zeros then
value will be 100.

Is This Answer Correct ?    0 Yes 1 No

consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP V..

Answer / shan

A.50

Is This Answer Correct ?    0 Yes 2 No

consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP V..

Answer / naveen

Why not C?

Can we have the reason for the above answer?

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More COBOL Interview Questions

which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad

0 Answers  


what happens if parmparameter passes zero bytes to the program

0 Answers   HSBC,


If we put three reads in COBOL in the same para one after the other, to read a PS file,will it read the same record thrice or it will read three records sequentially? For example : Input File 01 02 03 Para 900 Read infile Display Infile rec Read infile Display infile rec Read infile Display infile rec. What will be the output?

2 Answers  


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  


What are the different forms of EVALUATE statement?

2 Answers   IBM, Micro Labs,






How to recover a deleted source physical file from library?

1 Answers   HCL,


What are the rules of the move verb?

0 Answers  


What is the significance of the PROGRAM-ID paragraph? If this name doesnt match with the name of the COBOL program, does it make a difference? Is the name specified in the PROGRAM-ID paragraph used as a name for the load module or any such thing?

4 Answers   IBM,


Can anyone explain me CALL procedure in COBOL.Does it carries similarities like call by reference in C.

1 Answers  


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

0 Answers  


Can the OCCURS clause be at the 01 level?

8 Answers   Oracle,


consider two data items 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VLAUE 123.45 after the statement MOVE W-A TO W-B what will be W-B's value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move

5 Answers   TCS,


Categories