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 happens if parmparameter passes zero bytes to the program

0 Answers   HSBC,


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

0 Answers   HSBC, Quest,


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

8 Answers   Barclays, IBM,


what happens if we wont give timestamp in precompilation process ?

4 Answers   Covansys,


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

0 Answers  


What is the point of the REPLACING option of a copy statement?

3 Answers  


select TURE Statement(s) aboUt eject statemenet in cobol? a)The eject statememnt must be the only statement on the line b.It causes the program to edit abnormally c. eject statement can be written in either area A or area B d. specifies that the next source statement is to be printed at Top of the next page e.The EJECTstatement has no effect on the compilation of the source program itself

2 Answers  


We know that size of redefine and redefining need not to be same..Then does the below case true 01 ws-date pic 9(6). 01 ws-redf-date REDEFINES ws-date 05 ws-year pic 9(4) 05 ws-mon pic 9(2) 05 ws-day pic 9(2)

1 Answers   Cap Gemini,


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

0 Answers  


What are the functions like c or c++ in cobol?

2 Answers  


) How do u handle errors in BMS macro?

0 Answers   IBM,


In a COBOL II PERFORM statement, when is the conditional tested, before or after the perform execution?

3 Answers  


Categories