All z390 v1.5.06 includes a new demo consisting of an assembler program called CALLCOMP.MLC which calls a statically linked zcobol program called COMPSUM.CBL. The zcobol program uses a single COMPUTE statement to add 15 different numeric data type fields (HFP, BFP, DFP, F, G, H, P, Q, and Z) passed from the assembler program via a linkage section. The result is returned in the same linkage section as a packed decimal field with implied decimal point for editing and display by the calling program. Each of the two program is about 35 total lines. There is a paper describing the demo here:
http://www.z390.org/zcobol/demo/callcomp/zCOBOL_COMPUTE.pdf The demo is included in z390\zcobol\demo\callcomp directory and can be run from the z390 GUI or command line via the command zcobol\demo\callcomp\CLG.BAT. I hope this demo is useful to those interested in learning more about the 15 different data types supported by z390 and zcobol. And some may be interested in how the zcobol structured conditional macro assembler based compiler translates a single COMPUTE statement into over 300 generated mainframe assembler instructions to perform the calculation. Note the 300 generated assembler instructions uses the same data field labels as the original calling assembler program so one could copy and paste the generated instructions into the original calling program. The only additional complication is that the 128 bit integer multiplication and division routines called in the zcobol runtime for support of data type Q would need to be copied as well to eliminate any zcobol requirements. Don Higgins [email protected]
