Compiling and binding AMODE 64 programs under z/OS UNIX

The setup and preparations for compiling COBOL AMODE 64 programs with z/OS® UNIX are the same as the corresponding setup and preparations under AMODE 31. See Compiling under z/OS UNIX for more information.

The compilation is done using the -q64 option of the cob2 command. For example, the following command compiles and binds the COBOL source file hello.cbl in the current directory. The binder output is written to the default executable file a.out.
cob2  -q64  hello.cbl
You can explicitly specify the binder output file by using the -o option. The following cob2 command generates the executable file hello.exe.
cob2 -q64 hello.cbl -o hello.exe
Other compiler options can be specified by using the -q option in the same way as using cob2 command with AMODE 31. For example, the following command invokes the COBOL compiler by using SOURCE and LIST options:
cob2  -q64  -q"SOURCE,LIST"  hello.cbl
Note that -q64 is the short form of the compiler option LP(64) in the cob2 command line. It must be specified on its own in the cob2 command line, separate from other compiler option specifications. Instead of -q64, you can use LP(64) directly with other compiler options:
cob2  -q"LP(64),SOURCE,LIST"  hello.cbl

Correspondingly, the -q32 is the short form of the compiler option LP(32). If cob2 is invoked without explicitly specifying -q64 or -q32, the default is -q32.

Environment variables

In addition to the environment variables supported with AMODE 31, the following two additional environment variables are supported for AMODE 64:
_C89_L6SYSLIB
Specifies the library dataset concatenations of SYSLIB DD to be used by the bind step. Dataset names are separated by colons. For example, the following environment variable setting
export  _C89_L6SYSLIB=MYSAMPLE.SCEEBND2:CEE.SCEEBND2
gives the following SYSLIB DD concatenation in the bind step:

//SYSLIB	  DD  DSN=MYSAMPLE.SCEEBND2,DISP=SHR
//                DD  DSN=CEE.SCEEBND2,DISP=SHR
By default, if _C89_L6SYSLIB is not specified, the following equivalent setting is used:
export  _C89_L6SYSLIB=CEE.SCEEBND2
_C89_L6SYSIX
Specifies the side-deck dataset concatenations of SYSLIN to be used by the bind step. Dataset names are separated by colons. For example, the following environment variable setting
export  _C89_L6SYSIX="MYSAMPLE.SCEELIB(CELQV004):CEE.SCEELIB(CELQV004)"
gives the following SYSLIN DD concatenation in the bind step:

//SYSLIN    DD    DSN=MYSAMPLE.SCEELIB(CELQV004),DISP=SHR
//	    DD    DSN=CEE.SCEELIB(CELQV004),DISP=SHR
By default, if _C89_L6SYSIX is not specified, the following equivalent setting is used:
export  _C89_L6SYSIX="CEE.SCEELIB(CELQV004)"