zCOBOL Overview
zCOBOL is an open source portable mainframe COBOL compiler
available as part of the z390 open source portable mainframe
assembler for Windows or Linux starting with z390 v1.5.00.
You can download z390 and zcobol in InstallShield format for
Windows for file image format for Linux from
www.z390.org.
You will also need the J2SE Java runtime which you can
download from
Oracle. The latest release of zcobol
v1.5.06 has been
regression tested with J2SE 6 update 31. Be sure to
remove any old obsolete versions of J2SE such as 1.4 or
1.5 which may conflict with current version. Once you
have installed z390 with zcobol and J2SE runtime, then you can
start the z390 GUI interface or command line interface and
enter the following command to compile, link, and execute the
COBOL hello world demo on Windows or Linux:
ZC390CLG zcobol\demo\HELLO
A new demo has been added with zcobol v1.5.06 consisting
of a main assembler program CALLCOMP.MLC which calls
statically linked zcobol program CALCSUM.CBL to use COMPUTE
statement to calculate the sum of 15 different type numeric
data fields and return the sum as a packed decimal field for
editing and display by main program. The two programs
can be compiled, linked, and executed with the following
command once z390 v1.5.06 is installed:
zcobol\demo\callcomp\CLG.BAT
There is an article about this demo titled "Using
zcobol COMPUTE to calculate complex expressions for z390
mainframe assembler".
The zCOBOL compiler has been developed as a new flexible
tool for testing and modernizing COBOL applications without
requiring rewriting existing programs. With the recent
addition of z390 structured conditional macro assembler
extensions, the development of zCOBOL became feasible and
continues to evolve. John Hennesy has developed a
new zcobol debugging tool call
"U" written in zcobol which has been included in z390
v1.5.06.
The zcobol compiler translates COBOL source language
programs into executable code using the following 3 major
components:
- The java program zc390.class in z390.jar reads COBOL
language source program with file extension CBL and
generates a z390 HLASM compatible mainframe assembler source
program with MLC extension. Each COBOL verb becomes a
macro call opcode and all the words following up to the next
verb or period become positional parameters for the macro
call. Periods generate a PERIOD macro call to
terminate all structures which may be missing the optional END-IF type words.
All dashes in words are converted to underscores unless in
quotes. the level numbers in data division statements are mapped
to WS macro call with level as first positional operand.
- The macros in COBOL verb macro library z390\zcobol\*.mac parse the
parameters for each verb, access global macro symbol table,
and call code generation macros to generated executable
code. For example the IF macro issues calls to GEN_COMP macro to generate executable source code to compare
two fields, and issues call to GEN_BC to generate executable
source code to branch on condition.
- There are currently 4 optional zcobol executable code
generation macro libraries:
- z390\zcobol\z390 - zcobol code generation macros for
HLASM native z9/10 code
- z390\zcobol\java - zcobol code generation macros for
J2SE Java
- z390\zcobol\vce - zcobol code generation macros for MS
Visual Express C++
- z390\zcobol\i586 - zcobol code generation macros for
HLA and MASM native Intel code
The z390\zcobol\z390 HLASM code generation library is the primary
focus currently. However there is a
COBOL demo program z390\zcobol\demo\HELLO.CBL which can be
compiled and executed in all 4 different target language
environments using the initial zcobol release.
Once the z390 HLASM code generation macros are complete and
all the
NIST COBOL 1985 standards tests have been completed
successfully as a first milestone,
then these macros can be copied to the other libraries and modified
to replace HLASM source code model statements with the other
target language statements. The zcobol compiler
compiles 408 of the NIST COBOL 1985 test suite programs with
only level 8 MNOTE messages for as yet unsupported features.
Future releases will add missing features in priority order
which you can help define by joining the
zcobol
group. If you are an assembler
or COBOL developer who would like to contribute to the
zcobol open source project, join the
zcobol
group and indicate your specific interests. All users
are welcome and are encouraged to submit bug reports and
requests for priority on future open source zcobol and z390
development.
|