To create a DLL from the z/OS UNIX shell, you must specify the cob2 option -bdll.
cob2 -o mydll -bdll mysub.cbl
When you specify cob2 -bdll:
The name of the DLL definition side file is based on the output file-name. If the output name has a suffix, that suffix is replaced with x to form the side-file name. For example, if the output file-name is foo.dll, the side-file name is foo.x.
To use the DLL definition side file later when you create a module that calls that DLL, specify the side file with any other object files (file.o) that you need to link. For example, the following command compiles myappl.cbl, uses the DLL option to enable myappl.o to reference DLLs, and links to produce the module myappl:
cob2 -o myappl -qdll myappl.cbl mydll.x
Example: using cob2 to compile and link under UNIX
related references
cob2 syntax and options
cob2 input and output files