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

how to transfer the file from pc to mainframe??

4 Answers  


how many subpgms we can use in a main pgm ? how do u link sub pgm to main pgm ? how can i use the parameters declared in main pgm to sub pgm ?

2 Answers   TCS,


What is XDC ?

3 Answers   Cap Gemini, IBM,


have in 100 records in a file i want to read first 3 records and skip next 3 records and agan i want to read 3 records and again i want to skip 3 records...

2 Answers   ITC Indian Tobacco Company, PNP, TCS,


) How do u handle errors in BMS macro?

0 Answers   IBM,






what are the isolation levels and where we use it in the db2 program

3 Answers   TCS,


how to change picture class of copy book variable inside program?

2 Answers  


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 ......

4 Answers   Accenture,


Explain complete concept of table handling in COBOL with an example?

2 Answers   IBM, TCS, Wipro,


88 class is used for

5 Answers   CTS, EDS,


how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?

4 Answers   TCS,


What is the local-storage section?

0 Answers  


Categories