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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

1234


) How do u handle errors in BMS macro

2051


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

1233


Write some characteristics of cobol as means of business language.

1143


what happens if parmparameter passes zero bytes to the program

2133


How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

4171


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

1216


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17880


How you can read the file from bottom?

1157


What is rmode(any) ?

1266


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

2998


Write down the divisions of cobol program?

1255


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

9104


How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

1172


What is the difference between perform … with test after and perform … with test before?

1448