REDIR | NOREDIR

Category

Object code control

Pragma equivalent

None.

Purpose

Allows redirection of stderr, stdin, and stdout from the command line.

Syntax

Read syntax diagramSkip visual syntax diagram
   .-RED---.   
>>-+-NORED-+---------------------------------------------------><

Defaults

REDIR

Usage

When the REDIR compiler option is in effect, the compiler creates an object module that, when linked and run, allows you to redirect stdin, stdout, and stderr for your program from the command line when invoked from TSO or batch.

REDIR does not apply to programs invoked by the exec or spawn family of functions (in other words, redirection does not apply to programs invoked from the z/OS® UNIX System Services shell).

IPA effects

If you specify the REDIR option for any compilation unit in the IPA compile step, the compiler generates information for the IPA link step. This option also affects the regular object module if you request one by specifying the IPA(OBJECT) option.

If you specify the REDIR option for the IPA compile step, you do not need to specify it again on the IPA link step. The IPA link step uses the information generated for the compilation unit that contains the main() function, or for the first compilation unit it finds if it cannot find a compilation unit containing main().

If you specify this option on both the IPA Compile and the IPA link steps, the setting on the IPA link step overrides the setting on the IPA compile step. This situation occurs whether you use REDIR and NOREDIR as compiler options or specify them using the #pragma runopts directive (on the IPA compile step).

Predefined macros

None.