Using Language Environment callable services

Language Environment® callable services make many types of programming tasks easier. You call them by using the CALL statement.

About this task

Language Environment services help you with the following tasks:

  • Handling conditions

    The Language Environment condition-handling facilities enable COBOL applications to react to unexpected errors. You can use language constructs or runtime options to select the level at which to handle each condition. For example, you can handle a particular error in your COBOL program, let Language Environment take care of it, or have the operating system handle it.

    In support of Language Environment condition handling, COBOL provides procedure-pointer data items.

  • Managing dynamic storage

    These services enable you to get, free, and reallocate storage. You can also create your own storage pools.

  • Calculating dates and times

    If you use the date and time services, you can get the current local time and date in several formats, and perform date and time conversions. Two callable services, CEEQCEN and CEESCEN, provide a predictable way to handle two-digit years, such as 91 for 1991 or 09 for 2009.

  • Making math calculations

    Calculations that are easy to perform with mathematical callable services include logarithmic, exponential, trigonometric, square root, and integer functions.

    COBOL also supports a set of intrinsic functions that include some of the same mathematical and date functions as those provided by the callable services. The Language Environment callable services and intrinsic functions provide equivalent results, with a few exceptions. You should be familiar with these differences before deciding which to use.

  • Handling messages

    Message-handling services include services for getting, dispatching, and formatting messages. Messages for non-CICS® applications can be directed to files or printers. CICS messages are directed to a CICS transient data queue. Language Environment splits messages to accommodate the record length of the destination, and presents messages in the correct national language such as Japanese or English.

  • Supporting national languages

    These services make it easy for your applications to support the language that application users want. You can set the language and country, and obtain default date, time, number, and currency formats. For example, you might want dates to appear as 23 June 09 or as 6,23,09.

  • General services such as starting z/OS® Debugger and obtaining a Language Environment formatted dump

    z/OS Debugger provides advanced debugging functions for COBOL applications, including both batch and interactive debugging of CICS programs. z/OS Debugger enables you to debug a COBOL application from the host or, in conjunction with the Debug Perspective of IBM® Developer for z/OS, from a Windows-based workstation.

    Depending on the options that you select, the Language Environment formatted dump might contain the names and values of data items, and information about conditions, program tracebacks, control blocks, storage, and files. All Language Environment dumps have a common, well-labeled, easy-to-read format.

Example: Language Environment callable services