What is the output generated by the following code?
01 GRP-I.
05 SUBFLD1 PIC XX VALUE "AB".
05 FILTER PIC X(6) VALUE SPACES.
01 GRP-2 REDEFINED GRP-1.
05 SUB-FLD2 PIC XX.
05 SUB-FLD3 PIC XX.
05 FILTER PIC X(4).
IF SUB-FLD1 NOT = SPACES
DISPLAY "SUBFLD1"
MOVE "ABBCCD" TO GRP-1
IF SUB-FLD3 = SPACES
DISPLAY "SPACES"
ELSE
DISPLAY "SUBFLD3"
DISPLAY "END"
ELSE
DISPLAY "SPACES"
DISPLAY "END".
(a) SUBFLD1
SUBFLD3
END
(b) SPACES
END
(c) SUBFLD1
END
(d) SUBFLD1
SPACES

Answer Posted / vish

Uttam, I guess you missed to see the REDEFINES part of the
code given. It's moving 'ABBCCD' to GRP-1 and since GRP-2
REDEFINES GRP-1, the variables in GRP-2 also will be
populated and then naturally SUB-FLD3 is not SPACES and
contain 'BC'. So the correct answer is (a).

I request - please don't be in hurry to answer the
questions. A lot many people build their concepts based on
the questions & queswers provided in such groups.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to know whether the module is dynamical or statistical?

660


What are the different open modes available in cobol?

722


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

1078


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1846


) How do u handle errors in BMS macro

1512






What type of SDLC u followed? Why?

1524


I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

1808


Which Search verb is equivalent to PERFORM…VARYING?

691


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

698


how do you reference the ksds vsam file formats from cobol programs

669


What happens when we move a comp-3 field to an edited (say z (9). Zz-)?

780


What is report-item in COBOL?

713


What is rmode(any) ?

688


What are various search techniques in cobol? Explain.

650


) what is the difference between AID and HANDLE AID?

1638