File Name Handling

Several compiler options (such as -o) take a file name as an argument. As a special abbreviation, the character @ can be placed in these file names to stand for the base name of the source program. To form the base name, the compiler removes all directory information from the source file name, along with any characters following a period, and the period itself. The resulting base name is then inserted into the file name argument at the location of the @ character.

For example, if you want to compile a program called TEST.CBL, and you want the resulting object file to be named TEST.OBJ, and the error output to be placed in TEST.ERR, you can use the following command:

ccbl  -o  @.OBJ  -e  @.ERR  TEST.CBL

This is equivalent to the following:

ccbl  -o  TEST.OBJ  -e  TEST.ERR  TEST.CBL

and is also equivalent to:

ccbl  -oe  @.OBJ   @.ERR  TEST.CBL

In this example, the -o indicates that the next argument is the name of the object file. The @.OBJ argument is this name. The -e indicates that the next argument is the name of the error file. The @.ERR argument is this name. The @ character is replaced with the word TEST, which is derived from the name of the source file TEST.CBL.

As another example, on UNIX machines you can compile the program test.cbl and place the object code in the file /programs/test with the command

ccbl  -o  /programs/@  test.cbl

(Substitute \@ for @ if your UNIX machine uses @ as its default "line kill" character.) This can be particularly useful in compile scripts or in conjunction with the CBLFLAGS variable described below.