Using Language Environment for CICS programs
Language Environment®, supplied as an element of z/OS®, provides a common set of runtime libraries. Language Environment allows you to use only one runtime environment for your applications, regardless of the programming language or system resource needs, because most system dependencies have been removed.
- You can mix all the languages supported by CICS® in a single program.
- The same Language Environment callable services are available to all programs. For example:
- A linked list created with storage obtained using Language Environment callable services in a PL/I program can be processed later and the storage freed using the callable services from a COBOL routine.
- The currency symbol used on a series of reports can be set in an Assembler routine, even though the reports themselves are produced by COBOL programs.
- System messages from programs written in different languages are all sent to the same output destination.
CICS supports application programs compiled by a variety of compilers; for a list of compilers that are supported in this release of CICS Transaction Server for z/OS, see Changes to CICS support for application programming languages.
Most of the compilers supported by CICS and Language Environment are Language Environment-conforming compilers, meaning that programs compiled by these compilers can take advantage of all Language Environment facilities that are available to a CICS region. CICS and Language Environment also support programs compiled by some pre-Language Environment compilers, which do not conform with Language Environment. However, CICS does not support all the pre-Language Environment compilers that are supported by Language Environment.
Applications compiled and linked with pre-Language Environment compilers might run successfully using the runtime support provided by Language Environment. These applications might not require recompiling or re-link-editing. In some circumstances, you might need to adjust Language Environment runtime options so that the applications run correctly. See the z/OS Language Environment Runtime Application Migration Guide and the Compiler and Run-Time Migration Guide for the language in use.
The runtime libraries provided with pre-Language Environment compilers are not supported. Do not include any Language libraries other than the Language Environment libraries in your CICS startup JCL.
When modifying existing application programs, or writing new programs, you must use a compiler supported by Language Environment. Your application programs must be link-edited using the Language Environment SCEELKED library, which means that the resulting application load module can run only under Language Environment.
In CICS you can also create Assembler MAIN programs that conform to Language Environment. For more information about Assembler programs, see Developing Assembler language applications.
The Language Environment architecture
- Program management
- Condition handling
- Message services
- Storage management.
- Program management
- Program management defines the program execution constructs of an application, and the semantics associated with the integration of various management components of such constructs. Three entities, process, enclave, and thread, are at the core of the Language Environment program management model:
- Process
- The highest level component of the Language Environment program model is the process. A process consists of at least one enclave and is logically separate from other processes. Language Environment generally does not allow language file sharing across enclaves nor does it provide the ability to access collections of externally stored data.
- Enclave
- A collection of the routines that make up an application. The enclave is the equivalent of any of the following:
- A run unit, in COBOL
- A program, consisting of a main C® function and its sub-functions, in C and C++
- A main procedure and all of its subroutines, in PL/I
- Threads
- Each enclave consists of at least one thread, the basic instance of a particular routine. A thread is created during enclave initialization with its own runtime stack, which keeps track of the thread's execution, as well as a unique instruction counter, registers, and condition-handling mechanisms. Each thread represents an independent instance of a routine running under an enclave's resources.
- Condition-handling model
- The Language Environment runtime library provides a consistent and predictable condition-handling facility. It does not replace high-level language condition handling, but instead allows each language to respond to its own unique environment as well as to a mixed-language environment. Callable services can signal conditions and allow you to interrogate information about those conditions. It also provides functions for error diagnosis, reporting, and recovery.
- Message-handling model and national language support
- A set of common message handling services that create and send runtime informational and diagnostic messages. You can use the condition token that is returned from a callable service or from some other signaled condition, format it into a message, and deliver it to a defined output device or to a buffer. National language support callable services allow you to set a national language that affects the language of the error messages and the names of the day, week, and month. It also allows you to change the country setting, which affects the default date format, time format, currency symbol, decimal separator character, and thousands separator.
- Storage management model
- Common storage management services are provided for all Language Environment-conforming programming languages; Language Environment controls stack and heap storage used at run time. Applications can access a central set of storage management facilities. It offers a multiple-heap storage model to languages that do not now provide one. The common storage model removes the need for each language to maintain a unique storage manager, and avoids the incompatibilities between different storage mechanisms.