Suppose a program has the following code. What will be the
output?

MAIN-PARA.
DISPLAY 'MAIN-PARA'
PERFORM SECTION-A.
STOP RUN.

SECTION-A.
PARA-A1.
DISPLAY 'SECTION A PARA A1'.
PARA-A2.
DISPLAY 'SECTION A PARA A2'.

Answers were Sorted based on User's Feedback



Suppose a program has the following code. What will be the output? MAIN-PARA. DISPLAY '..

Answer / deependra

The output is as follow:-
MAIN-PARA
SECTION A PARA A1
SECTION A PARA A2

Is This Answer Correct ?    24 Yes 1 No

Suppose a program has the following code. What will be the output? MAIN-PARA. DISPLAY '..

Answer / brij

the above one is correct

Is This Answer Correct ?    5 Yes 0 No

Suppose a program has the following code. What will be the output? MAIN-PARA. DISPLAY '..

Answer / wairagade

Output = MAIN-PARA

See the Main-Para. the flow is like , it will display MAIN-
PARA text and then perform SECTION-A in which nothing is
coded, it will give control back to OS.

If PERFORM SECTION-A thru PARA-A2

Then
O/P
MAIN-PARA
SECTION A PARA A1
SECTION A PARA A2

Please correct me if I stated wrong

Is This Answer Correct ?    3 Yes 3 No

Suppose a program has the following code. What will be the output? MAIN-PARA. DISPLAY '..

Answer / suresh ramaiyan

The output is :
---------------
MAIN-PARA
SECTION A PARA A1
SECTION A PARA A2

Because, There is no THRU command in PERFORM statement. So
it will execute still it reaches the 'EXIT' command or it
will perform the full section or until the next section
reaches.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More COBOL Interview Questions

what is the difference b/w level no.01 & level no.77?

3 Answers   HCL,


I got user abend U4038 while compiling my runjcl.. can anyone help me?

10 Answers   CGI,


What is diff betn PS and ESDS file? What is the diffrent compiler options in cobol and there discription? What is retrive nth maximum salary from salary DB2 table. Can we redefine COM-3 variable with varchar variable?

4 Answers  


What are the two search techniques ?

2 Answers   iGate,


how we can reverse the string in the cobol for example satheesh can be reveresed as hseehtas

3 Answers   IBM,






how do you reference the variable block file formats from cobol programs

0 Answers  


Suppose i have a Cobol field of 10 byte. it contains a decimal sign.How to know where is the point location?

1 Answers  


What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(9) VALUE SPACES. 01 WS-VARN REDEFINES WS-VARX PIC 9(9).

8 Answers  


The below is the declaration for a variable ws 01 ws pic 9(3). if you want to insert space how will you do that. in which level u should do it

3 Answers   ADP,


In COBOL CALL-CALLING,if a program A is calling 3 sub- programs, dynamically, then it is said sub-programs will always will always in Initial Mode. My question is : Do we need to code CANCEL or (IS INITIAL) for dynamically called sub-programs or it is the property of Dynamically called pgms so every time sub-pgms are called they will be in initial mode. ***This question is only Dynamic call****, Please reply. Thank you in advance.

4 Answers   Wipro,


can we display comp-3 variables. if we want to display what we have to do . give me one example

6 Answers   CGI, Deloitte,


What are the pertinent COBOL commands?

0 Answers   Satyam,


Categories