Previous Topic Next topic Print topic


User Interaction for COBOL Program Services

A COBOL program service can receive and return data in two ways:
  • Using input and output parameters defined as data items in the Linkage Section.
  • Using ACCEPT and DISPLAY statements or the RETURN-CODE special register. Two forms of the ACCEPT statement are supported: ANSI ACCEPT and ACCEPT FROM COMMAND-LINE.

When the application runs as a service in an enterprise server, any ANSI ACCEPT or ACCEPT FROM COMMAND-LINE statements that are not mapped to interface fields return spaces, and any ANSI DISPLAY statements or RETURN-CODE values that are not mapped to interface fields are ignored. Any screen or keyboard operation other than an ANSI ACCEPT, ACCEPT FROM COMMAND-LINE or ANSI DISPLAY will generate the run-time system error 197 and the application will be terminated.

A service can also issue ACCEPT FROM CONSOLE and DISPLAY UPON CONSOLE statements. When execution reaches a DISPLAY UPON CONSOLE statement, the display text is displayed in the enterprise server console log, and the service continues. When execution reaches an ACCEPT FROM CONSOLE statement, the service pauses and asks for input using pages in ESMAC.

Previous Topic Next topic Print topic