Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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

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

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

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

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

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

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.

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

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

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

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

Why not C?

Can we have the reason for the above answer?

 Is This Answer Correct ? 0 Yes 2 No

More COBOL Interview Questions

how can i see junk values in dclgen or in hostvariable of comp ?

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?

What is Control Break processing ?

If my file contains 100,000 records and job abended at 55,000th records processing then how can i restart job from that record onward by ignoring that record. I can not edit the file as file size is big and it is getting browse substituted?

How can we pass data from cobol to JCl?

What guidelines should be followed to write a structured cobol prgm?

Define REDEFINE clause and Is it possible to have the redefine clause anywhere in the working storage section for a data name?

What is file status 39 ?

I've one string with spaces ( I N D I A ). My question is I want remove the spaces & combine in to single string without space (INDIA).How we can write the cobol program & wich options we need to use. Please let me know.

i friends greetings to the day...!!! I face a quation like"while runnig the programe every day i have to access the previous day updates only...!! Ex:- Let last day 100 customers took bank account i have to select those customers only.."

how do you move only numeric data from A to B 01 A pic x(10) value 'a1b2c34d5e'. 01 B pic x(5).

For rewrite, why is it mandatory that file needs to be opened?

Categories