Specifying z/OS UNIX files or directories

You can use the CC or CXX REXX EXECs to compile source code that is stored in z/OS® UNIX files and directories. Use the following syntax when specifying a z/OS UNIX file or directory as your input or output file:

Read syntax diagramSkip visual syntax diagram
>>-+----------+--+--------------+------------------------------><
   '-+---+--/-'  | .-/--------. |   
     '-.-'       | V          | |   
                 '---pathname-+-'   

If you specify a z/OS UNIX directory, all the source files in that directory are compiled. In the following example all the files in /u/david/src are compiled:
CC /u/david/src
When the file name contains the special characters double quotation mark, blank, or backslash, you must precede these characters with a backslash, as follows:
CC  /u/david/db\ 1.c
CC  file\"one
When you use the CC or CXX REXX EXEC, you must use unambiguous z/OS UNIX source file names. For example, the following input files are z/OS UNIX files:
CXX ./test/hello.c
CC  /u/david/test/hello.c
CXX test/hello.c
CC  ///hello.c
CC  ../test/hello.c
If you specify a file name that does not include pathnames with single slashes, the compiler treats the file as a non-z/OS UNIX file. The compiler treats the following input files as non-z/OS UNIX files:
CXX hello.c
CC  //hello.c

Using special characters

When z/OS UNIX file names contain the special characters blank, backslash, and double quotation mark, you must precede the special character with a backslash(\).

When suboptions contain the special characters left bracket (, right bracket ), comma, backslash, blank and double quotation mark, you must precede these characters with a double backslash(\\) so that they are interpreted correctly, as in:
    def(errno=\\(*__errno\\(\\)\\))
Note: Under TSO, you must precede special characters by a backslash \ in both file names and options.

Specifying compiler options under TSO

When you use REXX EXECs supplied by IBM®, you can override the default compiler options by specifying the options directly on the invocation line after an open left parenthesis (.

Example: The following example specifies, multiple compiler options with the sequential file STUDENT.GRADES.CXX:
       CXX 'STUDENT.GRADES.CXX'
              ( LIST,TEST,
               LSEARCH(MASTER.STUDENT,COURSE.TEACHER),
               SEARCH(VGM9.FINANCE,SYSABC.REPORTS),
               OBJ('GRADUATE.GRADES.OBJ(REPORT)')
See Summary of compiler options for more information on compiler options.