IBM Metal C


The IBM z/OS XL C/C++® compiler has an option referred to as METAL C. This option generates IBM high level assembler (HLASM) code instead of an object module. The advantage of using this option is that the generated code does not depend on Language Environment® support at runtime; although it may require the Metal C runtime library (in LPA). METAL C allows the use of embedded system service calls: STORAGE OBTAIN, OBTAIN macro, CATLOG/CAMLST, etc. Routines can be created using METAL C, and then called from an assembler or high level language program. Metal C uses standard MVS linkage conventions.

IBM suggests that Metal C can be used to write system exits. It is also noted that Metal C environments are intended to be used serially by a single dispatchable unit of work.

The downside to using the Metal C option is that very few of the C library routines are available and no I/O is provided. Even without the C library functions, Metal-C can still be a useful tool.

When I got started using the Metal C option, I made a lot of mistakes, as the documentation seemed unclear to me. I thought that I would share some of what I have learned in case anyone else was interested in what can be done with Metal C and with the hope that others will share their ideas.

Application Modernization

Using Metal C allowed me to port all types of open source software to the z/OS environment, saving a considerable amount of development time, in improving application functionality. Besides providing code modernization, it provides performance modernization due to the optimization techniques, such as instruction scheduling, employed by the compiler.

Metal C Features

Some of the features of the Metal C option include:


  1. z/OS Metal C Programming Guide and Reference
  2. z/OS XL C/C++ User’s Guide (SC09-4767-11)
  3. z/OS XL C/C++ Language Reference

All references copyright© IBM Corporation.