Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



What is the output generated by the following code? 01 GRP-I. 05 SUBFLD1 PIC XX VALUE "A..

Answer / guest

a

Is This Answer Correct ?    5 Yes 0 No

What is the output generated by the following code? 01 GRP-I. 05 SUBFLD1 PIC XX VALUE "A..

Answer / vish

I doubt if we can code like IF ELSE ELSE....since no scope
terminatior (END-IF) has been given for the nested IF ELSE
so it should throw a compilation error. It can display the
output as (a) ONLY if the code is something like below:

01 GRP-1.
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"
END-IF
ELSE
DISPLAY "SPACES"
DISPLAY "END".

Please correct me if I am wrong.

Is This Answer Correct ?    5 Yes 1 No

What is the output generated by the following code? 01 GRP-I. 05 SUBFLD1 PIC XX VALUE "A..

Answer / ajith

(a)

Is This Answer Correct ?    2 Yes 0 No

What is the output generated by the following code? 01 GRP-I. 05 SUBFLD1 PIC XX VALUE "A..

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

What is the output generated by the following code? 01 GRP-I. 05 SUBFLD1 PIC XX VALUE "A..

Answer / guest

I hope SUBFLD1 is erroneously written as SUB-FLD1

Is This Answer Correct ?    0 Yes 0 No

What is the output generated by the following code? 01 GRP-I. 05 SUBFLD1 PIC XX VALUE "A..

Answer / muttaiah

I guess we will get Maxcc - 8 when we compile. Because
SUB-FLD1 is not declared anywhere here. If the field has to
be SUBFLD1 by typo mistake.
Then answer would be (a).

Is This Answer Correct ?    0 Yes 0 No

What is the output generated by the following code? 01 GRP-I. 05 SUBFLD1 PIC XX VALUE "A..

Answer / uttam das

my answer is (d)

SUB-FLD3 = SPACES, it satisfies bcz in grp-2

there is no initialization of sub-fld3.
when sub-fld3 is not initialize, it always contains spaces.
alphanumeric stored spaces and numeric stored zeros

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More COBOL Interview Questions

hi is there any means of deletin a record from a ps usin cobol not using jcl?eg if i am reading a record and if some condition is matched tat particular record must be deletd fom the ps

5 Answers   iNautix,


Difference between lrecl, blksize among PS, PDS issues? i.e in jcl at dcb

1 Answers  


What is the difference between a DYNAMIC and STATIC call in COBOL?

2 Answers  


Is this allowed? 01 WS-TABLE. 03 FILLER-X PIC X(5) VALUE 'AAAAA'. 03 WS-EX REDEFINES FILLER-X OCCURS 5 TIMES PIC X(1). can redefines clause be used with occurs clause?

4 Answers  


What are the different rules to perform a Search?

0 Answers  


what is mainframe? what is the mainframe software ? what is use in s/w field?

7 Answers   CSE,


What is the difference between structured cobol programming and object alternativelyiented cobol?

0 Answers  


COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'

8 Answers   Barclays, IBM,


How we copy a program from production region to development region.What is the process & syntax ?

3 Answers   CTS,


here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?

2 Answers   IBM,


In an EVALUTE statement is the order of the WHEN clauses significant?

4 Answers  


How do you reference the following file formats from cobol programs?

0 Answers  


Categories