The Language Environment is the common runtime execution environment of COBOL, PL/I, C, C++, Metal C, Fortran, Assembler (partly) and Java (partly due to JNI-LE bridge) programs under z/OS. The LE does not support other languages therefore those can not run natively on z/OS; execution of such programs can happen under USS, z/OS Container Extensions (zCX), Docker or Linux.
THe LE provides:
date/time services
time zone management
character coding
error/exception management
ABEND management
memory management
stack/heap models
condition token system
The COBOL runs above the LE, and e.g. its built-in functions use services of the LE.
The COBOL pointers are also managed by the LE.
When a COBOL starts, the LE
creates the runtime stack
creates the heap
initializes the condition handlers
initializes the locale (coding, date, time zone)
initializes the runtime library
handles the control over the COBOL program
When the COBOL program raises an error:
the LE catches it
the LE decides whether it is an ABEND or a handler
the LE generates the dump
the LE writes the CEEDUMP
The condition token contains all the information on raised exceptions. It must be declared in the WORKING-STORAGE SECTION, and be given to the LE functions in order to catch exceptions.
In case the FC-SEVERITY value is not zero, exception was raised.
EXAMPLE FOR CONDITION TOKEN:
As per the software infrastructure, usually the outer (bank or other) applications are responsible for converting local time to UTC, while the COBOL on mainframes work in UTC only.
Epoch or Julian day rules:
the 0 value means 0001-01-01 00:00:00,00
integer number pointing to the given date 00:00:00,00
2026-09-26 ~ 738000
Functions:
CEELOCT (get local time on mainframe; result is in LPAR timezone, not UTC, not user or bank timezone)
CEEGMT (get UTC time)
CEEDAYS (convert date to days-since-epoch; follows epoch/Julian day rules)
CEEDATE (convert days-since-epoch to date; follows epoch/Julian rules)
CEELOCT parameters:
LOCTIME (local time structure)
FC (condition token)
CEEGMT parameters:
GMTTIME (UTC time structure; used by SWIFT, SEPA, TARGET2, all settlements, all international bank systems)
FC (condition token)
CEEDAYS parameters:
DATE-STRING (input date; record structure)
DATE-FORMAT (format of input date)
DAYS (output integer)
FC (condition token)
In case the format is invalid or does not match with the input date, exception is raised.
CEEDATE parameters:
DAYS (input days-since-epoch)
DATE-STRING (output date; record structure)
DATE-FORMAT (format of output date)
FC (condition token)
In case the format is invalid or does not match with the input date, exception is raised.
The DATE-STRING parameter contains a day-of-week data where 1 means Monday, 7 means Sunday.
EXAMPLE FOR DATE-STRING STRUCTURE (CEEDAYS, CEEDATE):
EXAMPLE FOR LE DATE FUNCTIONS:
Functions:
CEECVRT (general coding control)
CEEUTF8 (UTF-8 to UTF-16; JSON/XML PARSE/GENERATE uses it in the background)
CEEUTF16 (UTF-16 to UTF-8; JSON/XML PARSE/GENERATE uses it in the background)
CEECVRT parameters:
SRC-BUF (source buffer; string)
SRC-LEN (source length)
TGT-BUF (target buffer; string)
TGT-LEN (target length)
CVRT-TYPE (conversion type; string)
FC (condition token)
CVRT-TYPE values:
"UTF8→UTF16"
"UTF16→UTF8"
"EBCDIC→UTF8"
"UTF8→EBCDIC"
CEEUTF8 parameters:
UTF8-IN (input string)
UTF16-OUT (output string)
FC (condition token)
CEEUTF16 parameters:
UTF16-IN (input string)
UTF8-OUT (output string)
FC (condition token)
EXAMPLE FOR LE CHARACTER CODING FUNCTIONS:
Functions:
CEEHDLR (introduce user-defined exception handler)
CEEMRCE (read condition token when entering ON EXCEPTION branch; generate machine-readable condition token)
CEE3ABD (read ABEND code which can be used in IF/EVALUATE)
CEE3DMP (generate dump)
CEEHDLR parameters:
HANDLER-PROC (own procedure)
TOKEN (condition token when the exception is raised; record structure)
FC (condition token for this CALL)
CEEMRCE parameters:
TOKEN (processed condition token; not-zero SEVERITY field is checked for deciding whether to enter into COBOL ON EXCEPTION branches; record structure)
FC (condition token for this CALL)
CEE3ABD parameters:
ABEND-CODE (to read; PIC 9(4) or hexadecimal from Assembler)
FC (condition token for this CALL)
CEE3DMP parameter:
FC (condition token for this CALL)
The dump is a memory image file which is generated by the LE, containing
stack of the program
the heap
the registers regiszterek
the pointers
the variables
the call chain
the error code
the condition token
the program counter
the storage map
EXAMPLE FOR TOKEN STRUCTURE (CEEHDLR, CEEMRCE):
EXAMPLE FOR LE EXCEPTION MANAGEMENT:
Functions:
CEEGTST (reserve memory, get storage)
CEEFRST (free memory area, free storage)
CEECZST (get stack trace)
CEEGTST parameters:
SIZE (number of bytes)
PTR (pointer which will point to the new memory area)
FC (condition token)
CEEFRST parameters:
PTR (pointer pointing to the memory area)
FC (condition token)
CEECZST parameters:
BUFFER (buffer; the most used string size is 32767, other common values are 65535 and 10000)
FC (condition token)
The stack contains:
the call chain of a program (which program from which line called an other program)
which routine was active
what pointers were on the stack
what registers were active
EXAMPLE FOR LE MEMORY MANAGEMENT: