System Services available to assembler routines

Language Environment provides a number of services that the host system typically provides. Each of these system-provided services belongs to one of three categories, depending on whether it can and ought to be used in Language Environment:
  • The system-provided service can be used, but you must manage the resource; examples are ENQ and DEQ.
  • The system-provided service can, but should not be used. The system-provided service might not have the desired effect. For example, instead of using GETMAIN and FREEMAIN, use the Language Environment dynamic storage callable services.
  • The system-provided service should not be used. If you use this service, it directly interferes with the Language Environment environment. For example, any ESTAE or ESPIE that you issue interferes with Language Environment condition handling.

Whenever possible, non-Language Environment-conforming assembler routines should use the equivalent Language Environment services. A list of the equivalent services is provided in Table 1.

Table 1. Equivalent host services provided by Language Environment
Host service Language Environment equivalent Usability
ABEND Call CEESGL with a severity 4 condition, call CEE3ABD, or have the assembler user exit request an abend at termination. Host services can, but should not, be used. Use of equivalent Language Environment services is advised. ABEND can be used as a last resort.
ATTACH/DETACH/CHAP1 No equivalent Language Environment function. These services can be used.
ENQ/DEQ No equivalent Language Environment function. These services can be used.
(E)STAE/(E)SPIE/ SETRP/STAX Use Language Environmentcondition management callable services: CEEHDLR, CEEHDLU, and CEESGL. Host services should not be used; instances should be changed to use Language Environment condition management callable services. Otherwise, unpredictable results may occur.
EXEC CICS® LOAD/DELETE Use the Language Environment CEEFETCH assembler macro (see CEEFETCH macro — Dynamically load a routine). Host services can be used, but you must manage the loaded routines.
EXEC CICS XCTL/LINK No equivalent Language Environment function. These services can be used.
GETMAIN/FREEMAIN

EXEC CICS GETMAIN/ EXEC CICS FREEMAIN

For automatic storage (block-related), use Language Environment’s stack storage.

For non-block-related storage (that is, the storage persists beyond the current activation), use Language Environment heap storage.

Host services can, but should not, be used. Use of equivalent Language Environment storage management services is advised.

Any heap storage allocated by Language Environment will automatically be freed at termination.

LOAD/DELETE CVSRTLS Use the Language Environment CEEFETCH assembler macro (see CEEFETCH macro — Dynamically load a routine). If you are introducing a new language into the environment, host services must not be used. The new language is not properly initialized.

If you are not introducing a new language into the environment, host services can be used. However, you must manage the loaded routines.

OPEN/CLOSE GET/PUT READ/WRITE No equivalent Language Environment function. Host services can be used.
PC (Program Call instruction) High level language call statements, such as assembler BALR/BASSM. Not supported by Language Environment.
SNAP Call CEE3DMP. This service can be used.
STIMER2 No equivalent Language Environment function. This service can be used.
TIME Call Language Environment date and time services. This service can be used.
SVC LINK No equivalent Language Environment function This service can be used. For compatibility, Language Environment supports the LINK boundary crossing and treats it as a new enclave.
WAIT/POST/EVENTS3 No equivalent Language Environment function. Host services can be used.
WTO Call CEEMOUT. This writes to the error log or the terminal. Host services can be used.
XCTL No equivalent Language Environment function. Host services can, but should not, be used.
Notes:
  1. When running with POSIX(ON), use the POSIX functions pthread_create and pthread_exit in place of the host system functions ATTACH and DETACH. You cannot use ATTACH, DETACH, or CHAP when running a PL/I multitasking application.
  2. When running with POSIX(ON), use the C functions ALARM and SLEEP in place of the host system function STIMER.
  3. When running with POSIX(ON), use the POSIX functions pthread_mutex_lock and pthread_mutex_unlock in place of the host system functions WAIT and POST.