Under MVS batch

You can redirect standard streams in the following ways:

Because the topic of JCL statements goes beyond the scope of this information, only simple examples will be shown here.