SET INTERCEPT command (C and C++)

Intercepts input to and output from specified files. Output and prompts for input are displayed in the log.

Only sequential I/O can be intercepted. I/O intercepts remain in effect for the entire debug session, unless you terminate them by entering SET INTERCEPT OFF command. The initial setting is OFF.

Read syntax diagramSkip visual syntax diagram SET INTERCEPT ONOFF FILEfile_spec ;
ON
Turns on I/O interception for the specified file. Output appears in the log, preceded by the file specifier for identification. Input causes a prompt entry in the log, with the file specifier identified. You can then enter input for the specified file on the command line by using the INPUT command.
OFF
Turns off I/O interception for the specified file.
FILE file_spec
A valid fopen() file specifier including stdin, stdout, or stderr. The FILE keyword cannot be abbreviated.
Usage notes
  • For Enterprise COBOL for z/OS® Version 5, ACCEPT is not supported.
  • Intercepted streams or files cannot be part of any C I/O redirection during the execution of a nested enclave.
  • You cannot use the SET INTERCEPT command while you replay recorded statements by using the PLAYBACK commands.

Examples

Turn on the I/O interception for the fopen() file specifier dd:mydd. The current programming language setting is C.
SET INTERCEPT ON FILE dd:mydd;

Refer to the following topics for more information related to the material discussed in this topic.