Specifying output files

You can use compile options to specify compilation output files as follows:

Table 1. Compile options that provide output file names
Output File Type Compiler Option
Object Module OBJECT(filename)
Listing File SOURCE (filename), LIST(filename), INLRPT(filename) (Note: All listings must go to the same file. The last given location is used.)
Preprocessor Output PPONLY(filename)
Events File EVENTS(filename)
Template Output TEMPINC(location)
Template Registry TEMPLATEREGISTRY(filename)
When compiler options that generate output files are specified without suboptions to identify the output files, and, in the case of a batch job, the designated ddnames are not allocated, the output file names are generated based on the name of the source file.
Note: The exception to this case is Template Registry, which is fixed to templreg, and Template Output, which is fixed to tempinc.
For data sets, the compiler generates a low-level qualifier by appending a suffix to the data set name of the source, as Table 2 shows.
If you compile source from z/OS® UNIX files without specifying output file names in the compiler options, the compiler writes the output files to the current working directory. The compiler does the following to generate the output file names:

The following default suffixes are used:

Table 2. Defaults for output file types
Output File Type z/OS File z/OS UNIX File
Object Module OBJ o
Listing File LIST lst
Preprocessor Output EXPAND i
Template Output TEMPINC ./tempinc
Template Registry TEMPLREG ./templreg
Notes:
  1. Output files default to the z/OS UNIX directory if the source resides in the z/OS UNIX file system, or to an MVS™ data set if the source resides in a data set.
  2. If you have specified the OE option, see OE | NOOE for a description of the default naming convention.
  3. If you supply inline source in your JCL, the compiler will not generate an output file name automatically. You can specify a file name either as a suboption for a compiler option, or on a ddname in your JCL.
  4. If you are using #pragma options to specify a compile-time option that generates an output file, you must use a ddname to specify the output file name when compiling under batch. The compiler will not automatically generate file names for output that is created by #pragma options.
Example: Under TSO, the compiler generates the object file userid.TEST.SRC.OBJ if you compile the following:
     cc TEST.SRC (OBJ
The compiler generates the object file userid.TEST.SRC.OBJ(HELLO) if you compile the following:
     cc 'hlqual.TEST.SRC(HELLO)' (OBJ