Input Output Statements Interview Questions


ACCEPT Statement -

What is the function of Accept Verb?

It receives the data from external sources like JCL or the system runtime environment during the program execution.

What are the different ways to receive the input to the program using ACCEPT?

It has two different formats and those are -

  • Receiving input from JCL
  • Receiving system date-related information

How the data received from JCL?

ACCEPT statement without FROM phrasse used to accept the data from JCL.

DISPLAY Statement -

What is the significance in DISPLAY statement?

DISPLAY statement prints the variable contents to the output device, from left to right. It is mainly used to -

  • Debug the program when no tools are available.
  • To see the values of the variable at runtime.

Frequently Asked Questions -

What function does the verb ACCEPT serve?
What is the use of the ACCEPT statement in COBOL, and what are the possible options for input data validation?

How do you use the DISPLAY statement in COBOL, and what are the different formatting and alignment options available?

How do you use the ACCEPT FROM and DISPLAY TO statements in COBOL, and what are the different options available for input and output redirection?