═══ 1. LE/370 Quick Reference Tables ═══ These quick reference tables can either be inserted directly before Chapter 1 or they can be used as a separate document. The tables are a quick reference of the run-time options, callable services, and math services. They list the syntax of the options and services and briefly state their function. This section contains the following quick reference of the run-time options, callable services, and math services: ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Run-Time Options │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ Condition Handling Callable Services │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ Date and Time Callable Services │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ Dynamic Storage Callable Services │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ General Callable Services │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ Initialization and Termination Services │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ Math Services │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ Message Handling Callable Services │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ National Language Support Callable Services │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ═══ 1.1. Run-Time Options ═══ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 1. Run-Time Options Quick Reference │ ├──────────────────────────────────────────────────────────────────────────────────┬───────────────────────────────────┤ │ RUN-TIME OPTIONS │ FUNCTION │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Percolates a specified abend. │ │ .-NONE───. │ │ │ >>──ABPerc──(──+────────+──)──────────────────────────────────────────────────>< │ │ │ '-abcode-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Sets the enclave termination │ │ .-RETCODE-. │ behavior for an enclave ending │ │ >>──ABTermenc──(──'-ABEND───'──)──────────────────────────────────────────────>< │ with an unhandled condition of │ │ │ severity 2 or greater. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Invokes the access method ser- │ │ .-NOAIXBLD-. │ vices (AMS) for VSAM indexed and │ │ >>──┬─AIXBLD───┬──────────────────────────────────────────────────────────────>< │ relative data sets to complete │ │ │-AIX──────│ │ the file and index definition │ │ '-NOAIX────' │ procedures for COBOL routines. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Indicates whether an application │ │ .-OFF-. │ does or does not run entirely in │ │ >>──ALl31──(──+─────+──)──────────────────────────────────────────────────────>< │ AMODE(31) │ │ '-ON──' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Controls allocation of library │ │ .-ANYwhere-. │ heap storage not restricted to │ │ >>──ANyheap──(──.───────────.──,──.───────────.──,──+──────────+──,────────────> │ below the 16M line. │ │ '-init_size-' '-incr_size-' '-BELOW────' │ │ │ │ │ │ .-FREE-. │ │ │ >──+──────+──)────────────────────────────────────────────────────────────────>< │ │ │ '-KEEP-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies whether arguments on │ │ .-ARGPARSE───. │ the command line are to be parsed │ │ >>──'-NOARGPARSE-'────────────────────────────────────────────────────────────>< │ in the usual C/370 format. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Controls allocation of library │ │ .-FREE-. │ heap storage below the 16M line. │ │ >>──BElowheap──(──.───────────.──,──.───────────.──,──+──────+──)─────────────>< │ │ │ '-init_size-' '-incr_size-' '-KEEP-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies the format of the argu- │ │ .-ON──. │ ment string on application invo- │ │ >>──CBLOpts──(──+─────+──)────────────────────────────────────────────────────>< │ cation when the main routine is │ │ '-OFF-' │ COBOL. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Controls whether CICS* PUSH │ │ .-ON──. │ HANDLE and CICS POP HANDLE com- │ │ >>──CBLPshpop──(──+─────+──)──────────────────────────────────────────────────>< │ mands are issued when a COBOL │ │ '-OFF-' │ subprogram is called. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Controls COBOL QSAM dynamic allo- │ │ .-ON──. │ cation. │ │ >>──CBLQda──(──+─────+──)─────────────────────────────────────────────────────>< │ │ │ '-OFF-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Indicates whether "checking │ │ .-ON──. │ errors" within an application │ │ >>──CHeck──(──+─────+──)──────────────────────────────────────────────────────>< │ should be detected. │ │ '-OFF-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies the default formats for │ │ >>──COUNTRy──(──.──────────────.──)───────────────────────────────────────────>< │ date, time, currency symbol, │ │ '-country_code-' │ decimal separator, and the thou- │ │ │ sands separator based on a │ │ │ country. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Activates the COBOL batch debug- │ │ .-DEBUG───. │ ging features specified by the │ │ >>──'-NODEBUG-'───────────────────────────────────────────────────────────────>< │ "debugging lines" or the USE FOR │ │ │ DEBUGGING declarative. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Limits the extent to which condi- │ │ >>──DEPthcondlmt──(──.───────.──)─────────────────────────────────────────────>< │ tions can be nested. │ │ '-limit-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies the operating system │ │ >>──ENV──(──.-CMS-.──)────────────────────────────────────────────────────────>< │ that your C/370 application runs │ │ |-IMS-| │ under. │ │ '-MVS-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Sets the initial values for the │ │ <-,────────< │ environment variables specified │ │ >>──ENVAR──(───.────────.───)─────────────────────────────────────────────────>< │ in string. │ │ '-string-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies how many severity 2, 3, │ │ >>──ERrcount──(──.────────.──)────────────────────────────────────────────────>< │ or 4 errors are allowed before an │ │ '-number-' │ application is abnormally termi- │ │ │ nated. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies whether run-time │ │ .-EXECOPS───. │ options can be specified on the │ │ >>──'-NOEXECOPS-'─────────────────────────────────────────────────────────────>< │ command line. │ └──────────────────────────────────────────────────────────────────────────────────┴───────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 1. Run-Time Options Quick Reference │ ├──────────────────────────────────────────────────────────────────────────────────┬───────────────────────────────────┤ │ RUN-TIME OPTIONS │ FUNCTION │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Controls the FLOW output produced │ │ .-NOFLOW──. │ by OS/VS COBOL programs. │ │ >>──┬─FLOW────┬───────────────────────────────────────────────────────────────>< │ │ │ │-FLOW(n)-│ │ │ │ │-FLOW=n──│ │ │ │ '-FLOWn───' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Controls allocation of the heaps. │ │ .-ANYwhere-. .-KEEP-. │ │ │ >>──Heap──(──.───────────.──,──.───────────.──,──+──────────+──,──+──────+─────> │ │ │ '-init_size-' '-incr_size-' '-BELOW────' '-FREE-' │ │ │ │ │ │ >──,──.──────────────.──,──.──────────────.──)────────────────────────────────>< │ │ │ '-.──────────.-' '-.──────────.-' │ │ │ '-initsz24-' '-incrsz24-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Causes attentions recognized by │ │ .-OFF-. │ the host operating system to be │ │ >>──INTerrupt──(──+─────+──)──────────────────────────────────────────────────>< │ recognized by LE/370. │ │ '-ON──' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Controls the allocation of the │ │ .-FREE-. │ thread's library stack storage. │ │ >>──LIBStack──(──.───────────.──,──.───────────.──,──+──────+──)──────────────>< │ │ │ '-init_size-' '-incr_size-' '-KEEP-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies the ddname of the run- │ │ >>──MSGFile──(──.────────.──)─────────────────────────────────────────────────>< │ time diagnostics file. │ │ '-ddname-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies the number of ISI │ │ >>──MSGQ──(──.────────.──)────────────────────────────────────────────────────>< │ blocks allocated on a per-thread │ │ '-number-' │ basis during execution. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies the national language │ │ .-ENU-. │ to use for the run-time environ- │ │ >>──NATlang──(──┬─────┬──)────────────────────────────────────────────────────>< │ ment. │ │ │-UEN-│ │ │ │ '-JPN-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies the format of the invo- │ │ .-HOST-. │ cation arguments received by your │ │ >>──PLIST──(──┬─CICS─┬──)─────────────────────────────────────────────────────>< │ C/370 application when it is │ │ │-CMS──│ │ invoked. │ │ │-IMS──│ │ │ │ │-MVS──│ │ │ │ │-OS───│ │ │ │ '-TSO──' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies whether the enclave can │ │ .-OFF-. │ run with the POSIX semantics. │ │ >>──POSix──(──+─────+──)──────────────────────────────────────────────────────>< │ │ │ '-ON──' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies whether redirections │ │ .-REDIR───. │ for "stdin", "stderr", and │ │ >>──'-NOREDIR-'───────────────────────────────────────────────────────────────>< │ "stdout" are allowed from the │ │ │ command line. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies that a report of the │ │ .-OFF-. │ run-time options in use by the │ │ >>──RPTOpts──(──+─────+──)────────────────────────────────────────────────────>< │ application be generated. │ │ '-ON──' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies that a report of the │ │ .-OFF-. │ storage used by the application │ │ >>──RPTStg──(──+─────+──)─────────────────────────────────────────────────────>< │ be generated at the end of exe- │ │ '-ON──' │ cution. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Initializes the run-time environ- │ │ .-NORTEREUS-. │ ment to be reusable when the │ │ >>──'-RTEREUS───'─────────────────────────────────────────────────────────────>< │ first COBOL routine is invoked. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies whether your COBOL rou- │ │ .-NOSIMVRD-. │ tines use a VSAM KSDS to simulate │ │ >>──'-SIMVRD───'──────────────────────────────────────────────────────────────>< │ variable length relative organ- │ │ │ ization data sets. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Controls allocation of the │ │ .-BELOW────. .-KEEP-. │ thread's stack storage. │ │ >>──STACk──(──.───────────.──,──.───────────.──,──+──────────+──,──+──────+────> │ │ │ '-init_size-' '-incr_size-' '-ANYwhere-' '-FREE-' │ │ │ │ │ │ >──)──────────────────────────────────────────────────────────────────────────>< │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Controls the value of storage │ │ >>──STOrage──(──.──────────────────.──,──.─────────────────.──,────────────────> │ that is allocated and freed. │ │ '-heap_alloc_value-' '-heap_free_value-' │ │ │ │ │ │ >──.─────────────────.──,──.──────────────.──)────────────────────────────────>< │ │ │ '-dsa_alloc_value-' '-reserve_size-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Sets the level of information │ │ .-TRACE-. │ produced due to an unhandled │ │ >>──TERmthdact──(──┬───────┬──)───────────────────────────────────────────────>< │ error of severity 2 or greater. │ │ │-QUIET-│ │ │ │ │-MSG───│ │ │ │ '-DUMP──' │ │ └──────────────────────────────────────────────────────────────────────────────────┴───────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 1. Run-Time Options Quick Reference │ ├──────────────────────────────────────────────────────────────────────────────────┬───────────────────────────────────┤ │ RUN-TIME OPTIONS │ FUNCTION │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies that a debug tool is to │ │ .-NOTest-. .-ALL───. .-PROMPT───. │ be given control according to the │ │ >>──'-TEST───'──(──┬───────┬──,──.───────────────.──,──┬──────────┬──,─────────> │ suboptions specified. │ │ │-ERROR-│ |-commands_file-| │-NOPROMPT-│ │ │ │ '-NONE──' '-*─────────────' │-*────────│ │ │ │ │-;────────│ │ │ │ '-command──' │ │ │ │ │ │ >──.─────────────────.──)─────────────────────────────────────────────────────>< │ │ │ |-preference_file-| │ │ │ '-*───────────────' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Determines whether LE/370 run- │ │ .-OFF-. .-DUMP───. │ time library tracing is active. │ │ >>──TRACE──(──+─────+──.────────────.──+────────+──.─────.──)─────────────────>< │ │ │ '-ON──' '-table_size-' '-NODUMP-' '-LE=-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies how LE/370 routines │ │ .-ON──. │ handle abends and program inter- │ │ >>──TRap──(──+─────+──)───────────────────────────────────────────────────────>< │ rupts. │ │ '-OFF-' │ │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Sets the eight UPSI switches on │ │ >>──UPSI──(──.──────────.──)──────────────────────────────────────────────────>< │ or off. Affects only COBOL rou- │ │ '-nnnnnnnn-' │ tines. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies whether any language in │ │ .-OFF-. │ an application uses the vector │ │ >>──Vctrsave──(──+─────+──)───────────────────────────────────────────────────>< │ facility when user-written condi- │ │ '-ON──' │ tion handlers are called. │ ├──────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────┤ │ │ Specifies whether an exponent │ │ .-AUTO-. │ underflow causes a program inter- │ │ >>──Xuflow──(──┬──────┬──)────────────────────────────────────────────────────>< │ rupt. │ │ │-ON───│ │ │ │ '-OFF──' │ │ └──────────────────────────────────────────────────────────────────────────────────┴───────────────────────────────────┘ ═══ 1.2. Condition Handling Callable Services ═══ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 2. Condition Handling Callable Services │ ├────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────┤ │ CALLABLE SERVICE │ FUNCTION │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Returns a pointer to a condi- │ │ >>──CEE3CIB──(──.────────────.──,──cib_ptr──,──fc──)────────────────────────────>< │ tion information block (CIB) │ │ '-cond_token-' │ associated with a given condi- │ │ │ tion token. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Gets the name of the most │ │ >>──CEE3GRN──(──name──,──fc──)──────────────────────────────────────────────────>< │ current LE/370-conforming │ │ │ routine in which a condition │ │ │ occurred. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Queries and modifies the │ │ >>──CEE3SPM──(──action──,──cond_string──,──fc──)────────────────────────────────>< │ enablement of LE/370 hardware │ │ │ conditions. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Decomposes or alters an │ │ >>──CEEDCOD──(──cond_token──,──c_1──,──c_2──,──case──,──severity──,──control─────> │ existing condition token. │ │ │ │ │ >──,──facility_ID──,──i_s_info──,──fc──)────────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Retrieves the version ID and │ │ >>──CEEGPID──(──CEE_Version_ID──,──Plat_ID──,──fc──)────────────────────────────>< │ the platform ID of the version │ │ │ and platform of LE/370 cur- │ │ │ rently in use for processing │ │ │ the active condition. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Provides a mechanism by which │ │ >>──CEEGQDT──(──cond_rep──,──q_data_token──,──fc──)─────────────────────────────>< │ application code (in partic- │ │ │ ular, PL/I ON-units) can │ │ │ retrieve the q_data_token from │ │ │ the Instance Specific Informa- │ │ │ tion (ISI). │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Registers a user condition │ │ >>──CEEHDLR──(──routine──,──token──,──fc──)─────────────────────────────────────>< │ handler for the current stack │ │ │ frame. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Unregisters a user-written con- │ │ >>──CEEHDLU──(──routine──,──fc──)───────────────────────────────────────────────>< │ dition handler for the current │ │ │ stack frame. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Computes the initial condition │ │ >>──CEEITOK──(──i_ctok──,──fc──)────────────────────────────────────────────────>< │ token for the current condition │ │ │ information block. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Moves the resume cursor to a │ │ >>──CEEMRCR──(──type_of_move──,──fc──)──────────────────────────────────────────>< │ position relative to the │ │ │ current position of the handle │ │ │ cursor. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Dynamically constructs a condi- │ │ >>──CEENCOD──(──c_1──,──c_2──,──case──,──severity──,──control──,──facility_ID────> │ tion token. │ │ │ │ │ >──,──i_s_info──,──cond_token──,──fc──)─────────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Raises, or signals, a condition │ │ >>──CEESGL──(──cond_rep──,──.─────────────────.──fc──)──────────────────────────>< │ to the condition manager. │ │ '-q_data_token──,-' │ │ └────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────┘ ═══ 1.3. Date and Time Callable Services ═══ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 3. Date and Time Callable Services │ ├────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────┤ │ CALLABLE SERVICE │ FUNCTION │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Converts a string representing │ │ >>──CEECBLDY──(──input_char_date──,──picture_string──,──output_Lilian_date──,────> │ a date to a COBOL Lilian │ │ │ format. │ │ >──fc──)────────────────────────────────────────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Converts a number representing │ │ >>──CEEDATE──(──input_Lilian_date──,──picture_string──,──output_char_date──,─────> │ a Lilian date to a date written │ │ │ in character format. │ │ >──fc──)────────────────────────────────────────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Converts a number representing │ │ >>──CEEDATM──(──input_seconds──,──picture_string──,──output_timestamp──,──fc─────> │ the number of seconds since │ │ │ 00:00:00 14 October 1582 to │ │ >──)────────────────────────────────────────────────────────────────────────────>< │ character format. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Converts a string representing │ │ >>──CEEDAYS──(──input_char_date──,──picture_string──,──output_Lilian_date──,─────> │ a date to a Lilian format. │ │ │ │ │ >──fc──)────────────────────────────────────────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Calculates the day of the week │ │ >>──CEEDYWK──(──input_Lilian_date──,──output_day_no──,──fc──)───────────────────>< │ on which a Lilian date falls. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Computes the current Greenwich │ │ >>──CEEGMT──(──output_GMT_Lilian──,──output_GMT_seconds──,──fc──)───────────────>< │ Mean Time (GMT) as both a │ │ │ Lilian date and as the number │ │ │ of seconds since 00:00:00 14 │ │ │ October 1582. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Computes values to the calling │ │ >>──CEEGMTO──(──offset_hours──,──offset_minutes──,──offset_seconds──,──fc──)────>< │ routine that represent the dif- │ │ │ ference between the local │ │ │ system time and Greenwich Mean │ │ │ Time. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Converts separate binary inte- │ │ >>──CEEISEC──(──input_year──,──input_months──,──input_day──,──input_hours──,─────> │ gers representing year, month, │ │ │ day, hour, minute, second, and │ │ >──input_minutes──,──input_seconds──,──input_milliseconds──,──output_seconds─────> │ millisecond to a number repres- │ │ │ enting the number of seconds │ │ >──,──fc──)─────────────────────────────────────────────────────────────────────>< │ since 00:00:00 14 October 1582. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Gets the current local time in │ │ >>──CEELOCT──(──output_Lilian──,──output_seconds──,──output_Gregorian──,──fc─────> │ three formats. │ │ │ │ │ >──)────────────────────────────────────────────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Queries the century within │ │ >>──CEEQCEN──(──century_start──,──fc──)─────────────────────────────────────────>< │ which LE/370 assumes two-digit │ │ │ year values lie. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Sets the century in which │ │ >>──CEESCEN──(──century_start──,──fc──)─────────────────────────────────────────>< │ LE/370 assumes two-digit year │ │ │ values lie. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Converts a number representing │ │ >>──CEESECI──(──input_seconds──,──output_year──,──output_month──,──output_day────> │ the number of seconds since │ │ │ 00:00:00 14 October 1582 to │ │ >──,──output_hours──,──output_minutes──,──output_seconds──,──────────────────────> │ seven separate binary integers │ │ │ representing year, month, day, │ │ >──output_milliseconds──,──fc──)────────────────────────────────────────────────>< │ hour, minute, second, and │ │ │ millisecond. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Converts a string representing │ │ >>──CEESECS──(──input_timestamp──,──picture_string──,──output_seconds──,──fc─────> │ a timestamp into a number │ │ │ representing the number of │ │ >──)────────────────────────────────────────────────────────────────────────────>< │ seconds since 00:00:00 14 │ │ │ October 1582. │ └────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────┘ ═══ 1.4. Dynamic Storage Callable Services ═══ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 4. Dynamic Storage Callable Services │ ├────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────┤ │ CALLABLE SERVICE │ FUNCTION │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Sets the heading displayed at │ │ >>──CEE3RPH──(──report_heading──,──fc──)────────────────────────────────────────>< │ the top of the storage or │ │ │ options reports that are gener- │ │ │ ated when you specify the │ │ │ RPTSTG(ON) or RPTOPTS(ON) run- │ │ │ time options. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Defines additional heaps. │ │ >>──CEECRHP──(──heap_id──,──initial_size──,──increment──,──options──,──fc──)────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Changes the size of a previ- │ │ >>──CEECZST──(──address──,──new_size──,──fc──)──────────────────────────────────>< │ ously allocated storage │ │ │ element, while preserving its │ │ │ contents. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Discards an entire heap that │ │ >>──CEEDSHP──(──heap_id──,──fc──)───────────────────────────────────────────────>< │ you created previously with a │ │ │ call to CEECRHP. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Frees storage previously allo- │ │ >>──CEEFRST──(──address──,──fc──)───────────────────────────────────────────────>< │ cated by CEEGTST or a language │ │ │ intrinsic function. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Allocates storage from a heap │ │ >>──CEEGTST──(──heap_id──,──size──,──address──,──fc──)──────────────────────────>< │ whose ID you specify. │ └────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────┘ ═══ 1.5. General Callable Services ═══ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 5. General Callable Services │ ├────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────┤ │ CALLABLE SERVICE │ FUNCTION │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Generates a dump of the run- │ │ >>──CEE3DMP──(──title──,──options──,──fc──)─────────────────────────────────────>< │ time environment of LE/370 and │ │ │ the member language libraries. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Computes to the calling routine │ │ >>──CEE3PRM──(──char_parm_string──,──fc──)──────────────────────────────────────>< │ the argument string that was │ │ │ specified at invocation of the │ │ │ program. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Sets or queries one of two │ │ >>──CEE3USR──(──function_code──,──field_number──,──field_value──,──fc──)────────>< │ 4-byte fields known as the user │ │ │ area fields. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Generates a sequence of uniform │ │ >>──CEERAN0──(──seed──,──random_no──,──fc──)────────────────────────────────────>< │ pseudo-random numbers between │ │ │ 0.0 and 1.0 using the multipli- │ │ │ cative congruential method with │ │ │ a user-specified seed. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Invokes a debug tool, such as │ │ >>──CEETEST──(──.───────────────────────.──,──fc──)─────────────────────────────>< │ Debug Tool/370. │ │ '-string_of_commands──,-' │ │ └────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────┘ ═══ 1.6. Initialization and Termination Services ═══ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 6. Initialization and Termination Services │ ├────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────┤ │ CALLABLE SERVICE │ FUNCTION │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Terminates the enclave with an │ │ >>──CEE3ABD──(──abcode──,──clean-up──)──────────────────────────────────────────>< │ abend. The abend can be issued │ │ │ either with or without │ │ │ clean-up. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Gets the enclave return code. │ │ >>──CEE3GRC──(──return_code──,──fc──)───────────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Sets the enclave return code. │ │ >>──CEE3SRC──(──return_code──,──fc──)───────────────────────────────────────────>< │ │ └────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────┘ ═══ 1.7. Math Services ═══ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 7. Math Services │ ├────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────┤ │ MATH SERVICE │ FUNCTION │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Absolute value │ │ >>──CEESxABS──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Arccosine │ │ >>──CEESxACS──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Arcsine │ │ >>──CEESxASN──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Hyperbolic arctangent │ │ >>──CEESxATH──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Arctangent │ │ >>──CEESxATN──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Arctangent of two arguments │ │ >>──CEESxAT2──(──parm1──,──parm2──,──fc──,──result──)───────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Conjugate complex │ │ >>──CEESxCJG──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Cosine │ │ >>──CEESxCOS──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Hyperbolic cosine │ │ >>──CEESxCSH──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Cotangent │ │ >>──CEESxCTN──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Positive difference │ │ >>──CEESxDIM──(──parm1──,──parm2──,──fc──,──result──)───────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Division │ │ >>──CEESxDVD──(──parm1──,──parm2──,──fc──,──result──)───────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Error function complement │ │ >>──CEESxERC──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Error function │ │ >>──CEESxERF──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Exponential (base e) │ │ >>──CEESxEXP──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Gamma function │ │ >>──CEESxGMA──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Imaginary part of complex │ │ >>──CEESxIMG──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Truncation │ │ >>──CEESxINT──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Log gamma function │ │ >>──CEESxLGM──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Logarithm base 10 │ │ >>──CEESxLG1──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Logarithm base 2 │ │ >>──CEESxLG2──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Logarithm base e │ │ >>──CEESxLOG──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Floating complex multiplication │ │ >>──CEESxMLT──(──parm1──,──parm2──,──fc──,──result──)───────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Modular arithmetic │ │ >>──CEESxMOD──(──parm1──,──parm2──,──fc──,──result──)───────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Nearest integer │ │ >>──CEESxNIN──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Nearest whole number │ │ >>──CEESxNWN──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Transfer of sign │ │ >>──CEESxSGN──(──parm1──,──parm2──,──fc──,──result──)───────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Sine │ │ >>──CEESxSIN──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Hyperbolic sine │ │ >>──CEESxSNH──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Square root │ │ >>──CEESxSQT──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Tangent │ │ >>──CEESxTAN──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Hyperbolic tangent │ │ >>──CEESxTNH──(──parm1──,──fc──,──result──)─────────────────────────────────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Exponential (**) │ │ >>──CEESxXPx──(──parm1──,──parm2──,──fc──,──result──)───────────────────────────>< │ │ └────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────┘ ═══ 1.8. Message Handling Callable Services ═══ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 8. Message Handling Callable Services │ ├────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────┤ │ CALLABLE SERVICE │ FUNCTION │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Stores message insert data. │ │ >>──CEECMI──(──cond_rep──,── insert_seq_num──,──insert_data──,──fc──)───────────>< │ │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Gets, formats, and stores in a │ │ >>──CEEMGET──(──cond_token──,──message_area──,──msg_ptr──,──fc──)───────────────>< │ buffer a message corresponding │ │ │ to a condition token returned │ │ │ from a callable service or │ │ │ passed to a user-written condi- │ │ │ tion handler. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Dispatches a user-defined │ │ >>──CEEMOUT──(──message_string──,──destination_code──,──fc──)───────────────────>< │ message to the message string │ │ │ file. │ ├────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────┤ │ │ Gets, formats, and dispatches a │ │ >>──CEEMSG──(──cond_token──,──destination_code──,──fc──)────────────────────────>< │ message corresponding to an │ │ │ input condition token received │ │ │ from a callable service or │ │ │ passed to a user-written condi- │ │ │ tion handler. │ └────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────┘ ═══ 1.9. National Language Support Callable Services ═══ ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 9. National Language Support Callable Services │ ├──────────────────────────────────────────────────────────────────────┬───────────────────────────┤ │ CALLABLE SERVICE │ FUNCTION │ ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤ │ │ Changes or queries the │ │ >>──CEE3CTY──(──function──,──country_code──,──fc──)───────────────>< │ current national country │ │ │ setting. │ ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤ │ │ Changes or queries the │ │ >>──CEE3LNG──(──function──,──desired_language──,──fc──)───────────>< │ current national lan- │ │ │ guage. │ ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤ │ │ Gets the default currency │ │ >>──CEE3MCS──(──country_code──,──currency_symbol──,──fc──)────────>< │ symbol for a country │ │ │ specified in │ │ │ country_code. │ ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤ │ │ Gets the default decimal │ │ >>──CEE3MDS──(──country_code──,──decimal_separator──,──fc──)──────>< │ separator for the country │ │ │ specified in │ │ │ country_code. │ ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤ │ │ Gets the default thou- │ │ >>──CEE3MTS──(──country_code──,──thousands_separator──,──fc──)────>< │ sands separator for the │ │ │ country that you specify │ │ │ in country_code │ ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤ │ │ Gets the default date │ │ >>──CEEFMDA──(──country_code──,──date_pic_str──,──fc──)───────────>< │ picture string for a │ │ │ country specified in │ │ │ country_code. │ ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤ │ │ Gets the default date and │ │ >>──CEEFMDT──(──country_code──,──datetime_str──,──fc──)───────────>< │ time picture strings for │ │ │ the country specified in │ │ │ country_code. │ ├──────────────────────────────────────────────────────────────────────┼───────────────────────────┤ │ │ Gets the default time │ │ >>──CEEFMTM──(──country_code──,──time_pic_str──,──fc──)───────────>< │ picture string for the │ │ │ country specified in │ │ │ country_code. │ └──────────────────────────────────────────────────────────────────────┴───────────────────────────┘ ═══ 2. LE/370 Run-Time Options ═══ This chapter describes the LE/370 run-time options, their syntax, and their usage. IBM-supplied default settings for the options are indicated in the syntax diagrams or, where applicable, are underlined in the suboption descriptions. The minimum unambiguous abbreviation of each LE/370 option is also indicated in its syntax diagram with capital letters (for example, ABPerc indicates that ABP is the minimum abbreviation). For a list of all the LE/370 run-time options, see LE/370 Quick Reference Tables. This section contains the following run-time options: ┌────────────────────────────────┬────────────────────────────────┬────────────────────────────────┐ │ ABPERC │ ABTERMENC │ AIXBLD | NOAIXBLD │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ ALL31 │ ANYHEAP │ ARGPARSE | NOARGPARSE │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ BELOWHEAP │ CBLOPTS │ CBLPSHPOP │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ CBLQDA │ CHECK │ COUNTRY │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ DEBUG | NODEBUG │ DEPTHCONDLMT │ ENV │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ ENVAR │ ERRCOUNT │ EXECOPS | NOEXECOPS │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ FLOW │ HEAP │ INTERRUPT │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ LIBSTACK │ MSGFILE │ MSGFILE │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ MSGQ │ NATLANG │ PLIST │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ POSIX │ REDIR | NOREDIR │ RPTOPTS │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ RPTSTG │ RTEREUS │ SIMVRD │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ STACK │ STORAGE │ TERMTHDACT │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ TEST | NOTEST │ TRAP │ UPSI │ ├────────────────────────────────┼────────────────────────────────┼────────────────────────────────┤ │ VCTRSAVE │ XUFLOW │ │ └────────────────────────────────┴────────────────────────────────┴────────────────────────────────┘ ═══ 2.1. How to Specify Run-Time Options ═══ When specifying run-time options, use commas to separate any suboptions of those options. If you do not specify a suboption, you must still specify the comma to indicate its omission, for example; STACK(,,ANYWHERE,FREE). Trailing commas, however, are not required; STACK(4K,4K,ANYWHERE) is valid. If you do not specify any suboptions, either of the following is valid: STACK or STACK(). For more information about specifying LE/370 run-time options, see LE/370 Programming Guide. ═══ 2.1.1. ABPERC ═══ ABPERC percolates an abend whose code you specify. The ABPERC option is a debug tool that specifies the application can run with TRAP set to ON. This provides LE/370 semantics for everything except one abend, whose code you specify. When you run with ABPERC and encounter the specified abend:  User condition handlers are not enabled.  In OpenEdition* MVS, POSIX signal handling semantics are not enabled for the abend.  No storage report or run-time options report is generated.  No LE/370 messages or LE/370 dump output is generated.  The assembler user exit is not driven for enclave termination.  The abnormal termination exit (if there is one) is not driven.  Files opened by HLLs are not closed by LE/370, so records might be lost.  Resources acquired by LE/370 are not freed.  The debug tool is not notified of the error. You can specify a list of abend codes on the assembler user exit for the condition manager to percolate. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─NONE───┐ │ │ >>──ABPerc──(──┼────────┼──)──────────────────────────────────────────────────────────────────>< │ │ └─abcode─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ NONE Specifies that all abends are handled according to LE/370 condition handling semantics. abcode Specifies the code number of the abend to percolate. abcode can be specified as: Shhh A system abend code where hhh is the hex system abend code Udddd A user abend code where dddd is a decimal user-issued abend code Any 4-character string can also be used as an abcode. You can identify only one abend code with this option. However, an abend U0000 is interpreted in the same way as S000. Usage Notes  LE/370 ignores ABPERC(0Cx). In this instance, no abend is percolated, and LE/370 condition handling semantics are in effect.  CICS consideration-ABPERC is ignored under CICS.  OpenEdition MVS consideration-ABPERC percolates an abend regardless of the thread in which it occurs. ═══ 2.1.2. ABTERMENC ═══ ABTERMENC sets the enclave termination behavior for an enclave ending with an unhandled condition of severity 2 or greater. TRAP(ON) must be in effect for ABTERMENC to have an effect. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─RETCODE─┐ │ │ >>──ABTermenc──(──┴─ABEND───┴──)──────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ RETCODE Specifies that the enclave terminates with a normal return code and reason code. However, the assembler user exit can modify this behavior as follows:  If the assembler user exit does not set the CEEAUE_ABND flag to ON during enclave termination, LE/370 returns to its caller with a return code and a reason code.  If the assembler user exit sets the CEEAUE_ABND flag to ON during enclave termination, LE/370 issues an abend to terminate the enclave. LE/370 sets the abend and reason code for the abend to equal the values of assembler-user-exit parameters, as follows: - Abend code: Value of the CEEAUE_RETURN parameter of the assembler user exit. If the assembler user exit does not modify the CEEAUE_RETURN value, LE/370 sets an abend code that maps to the severity of the condition and to the user return code. - Reason code: Value of the CEEAUE_REASON parameter of the assembler user exit. ABEND Specifies that LE/370 issues an abend to end the enclave regardless of the setting of the CEEAUE_ABND flag by the assembler user exit. However, the setting of the CEEAUE_ABND flag affects the abend processing, as follows: When CEEAUE_ABND is off, the following occurs:  Abend code: LE/370 sets an abend code value that depends on the type of unhandled condition.  Reason code: LE/370 sets a reason code value that depends on the type of unhandled condition.  Abend dump attribute: LE/370 does not request a system dump.  Abend task/step attribute (on MVS): An abend is issued to terminate the task. When CEEAUE_ABND is on, LE/370 uses values set by the assembler user exit to determine abend processing:  Abend code: Value of the CEEAUE_RETURN parameter of the assembler user exit.  Reason code: Value of the CEEAUE_REASON parameter of the assembler user exit.  Abend dump attribute: LE/370 requests a system dump only if the assembler user exit sets CEEAUE_DUMP to ON. The system abend dump goes to the system abend ddname with the filename you define in your JCL (for MVS) or in your FILEDEF (for VM). The filename is the name defined in the DD card.  Abend task/step attribute (on MVS): If the assembler user exit sets CEEAUE_STEPS to ON, LE/370 issues an abend to terminate the step. Otherwise, LE/370 issues an abend to terminate the task. Usage Notes  COBOL considerations-ABEND is the recommended setting for COBOL customers who use MVS. Your system administrator can change the default value of ABTERMENC to ABEND.  CICS consideration-The default under CICS is ABTERMENC(ABEND). ═══ 2.1.3. AIXBLD | NOAIXBLD ═══ AIXBLD invokes the access method services (AMS) for VSAM indexed and relative data sets (KSDS and RRDS) to complete the file and index definition procedures for COBOL routines. AIXBLD conforms to the ANSI 1985 COBOL standard. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─NOAIXBLD─┐ │ │ >>──┼─AIXBLD───┼──────────────────────────────────────────────────────────────────────────────>< │ │ ├─AIX──────┤ │ │ └─NOAIX────┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ NOAIXBLD Does not invoke the access method services for VSAM indexed and relative data sets. AIXBLD Invokes the access method services for VSAM indexed and relative data sets. Usage Notes  You can use only AIX and NOAIX as abbreviations for AIXBLD and NOAIXBLD.  When specifying this option in CEEDOPT or CEEUOPT, use the syntax AIXBLD(ON) or AIXBLD(OFF). Use AIXBLD and NOAIXBLD only on the command line.  CICS consideration-This option is ignored under CICS.  MVS consideration-If you also specify the MSGFILE run-time option, the access method services messages are directed to the MSGFILE ddname or to the default SYSOUT. See MSGFILE for information about MSGFILE. Performance Considerations Running your program under AIXBLD requires more storage, which can degrade performance. Therefore, use AIXBLD only during application development to build alternate indices. Use NOAIXBLD when you have already defined your VSAM data sets. ═══ 2.1.4. ALL31 ═══ ALL31 specifies whether an application can run entirely in AMODE(31) or whether the application has one or more AMODE(24) routines. This option does not implicitly alter storage, in particular storage managed by the STACK and HEAP run-time options. However, you must be aware of your application's requirements for stack and heap storage, because such storage can potentially be allocated above the line while running in AMODE(24). ALL31 should have the same setting for all enclaves in the process, because LE/370 does not support the invocation of a nested enclave requiring ALL31(OFF) from an enclave running with ALL31(ON). In a multithread environment, LE/370 invokes all start routines in AMODE(31). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─OFF─┐ │ │ >>──ALl31──(──┼─────┼──)──────────────────────────────────────────────────────────────────────>< │ │ └─ON──┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ OFF Indicates that one or more routines of an LE/370 application are AMODE(24). With ALL31(OFF) specified:  AMODE switching across calls to LE/370 common run-time routines is performed. For example, AMODE switching is performed on calls to LE/370 callable services.  In COBOL, external data is allocated in storage below the 16M line. If you use the default setting ALL31(OFF), you must also use the default setting STACK(,,BELOW). AMODE(24) routines usually require stack storage below the 16M line. See STACK for information about STACK. ON Indicates that no user routines of an LE/370 application are AMODE(24). With ALL31(ON) specified:  AMODE switching across calls to LE/370 common run-time routines is minimized. For example, no AMODE switching is performed on calls to LE/370 callable services.  In COBOL, external data is allocated in unrestricted storage. Usage Notes  CICS consideration-The default under CICS is ALL31(ON).  OpenEdition MVS consideration-The ALL31 option applies to the enclave. Performance Consideration If your application consists entirely of AMODE (31) routines, it might run faster with ALL31(ON) than with ALL31(OFF) because mode switching code is not required. ═══ 2.1.5. ANYHEAP ═══ ANYHEAP controls the allocation of library heap storage that is not restricted to a location below the 16M line. The ANYHEAP option is always in effect. If you do not specify ANYHEAP or if you specify ANYHEAP(0), LE/370 allocates the value of 32K when a call is made to obtain heap storage. The IBM-supplied default is (32K,16K,ANYWHERE,FREE). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─ANYwhere─┐ ┌─FREE─┐ │ │ >>──ANyheap──(──┬───────────┬──,──┬───────────┬──,──┼──────────┼──,──┼──────┼──)──────────────>< │ │ └─init_size─┘ └─incr_size─┘ └─BELOW────┘ └─KEEP─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ init_size Determines the minimum initial size of the anywhere heap storage. This value can be specified as n, nK, or nM bytes of storage. The actual amount of allocated storage is rounded up to the nearest multiple of 4K. incr_size Determines the minimum size of any subsequent increment to the anywhere heap area, and is specified in n, nK, or nM bytes of storage. This value is rounded up to the nearest multiple of 4K. ANYwhere Specifies that heap storage can be allocated anywhere in storage. On systems that support bimodal addressing, storage can be allocated either above or below the 16M line. If there is no storage available above the line, storage is acquired below the line. On systems that do not support bimodal addressing (for example, when VM/ESA* is initially loaded in 370 mode), this option is ignored and heap storage is placed below 16M. BELOW Specifies that heap storage must be allocated below the 16M line in storage that is accessible to 24-bit addressing. FREE Specifies that storage allocated to ANYHEAP increments is released when the last of the storage is freed. KEEP Specifies that storage allocated to ANYHEAP increments is not released when the last of the storage is freed. Usage Notes  CICS consideration-Under CICS, ANYHEAP assumes the defaults ANYHEAP(4K,4K,ANYWHERE,FREE). Both the initial size and the increment size are rounded up to the nearest multiple of 8 bytes. The minimum is 4K. If you specify ANYHEAP or ANYHEAP(0), LE/370 assumes the default value of 4K. The maximum initial and increment size for ANYHEAP under CICS is 1 gigabyte (1024M).  OpenEdition MVS consideration-The ANYHEAP option applies to the enclave. Performance Considerations The ANYHEAP option improves performance when you specify values that minimize the number of times the operating system allocates storage. The RPTSTG run-time option generates a report of the storage the application uses while running; you can use the report numbers to help determine what values to specify. See RPTSTG for more information about the RPTSTG run-time option. ═══ 2.1.6. ARGPARSE | NOARGPARSE ═══ ARGPARSE specifies whether arguments on the command line are to be parsed in the usual C/370 format. This option is restricted to applications in which C/370 is the main routine. You can specify it only by using #pragma runopts. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─ARGPARSE───┐ │ │ >>──┴─NOARGPARSE─┴────────────────────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ARGPARSE Specifies that arguments given on the command line are to be parsed and given to the main() function in the usual C/370 argument format (argv, and argc). NOARGPARSE Specifies that arguments given on the command line are not parsed, but are passed to the main() function as one string. Therefore, argc has a 2 value and argv[1] contains a pointer to the string. Usage Note  CICS consideration-This option is ignored under CICS.  OpenEdition MVS consideration-The ARGPARSE option applies only to the main routine of the initial thread. ═══ 2.1.7. BELOWHEAP ═══ BELOWHEAP controls the allocation of library heap storage that must be located below the 16M line. The heap controlled by BELOWHEAP is intended for items such as control blocks used for I/O. The BELOWHEAP option is always in effect. If you do not specify BELOWHEAP or if you specify BELOWHEAP(0), the value of 32K is allocated when a call is made to obtain heap storage. The IBM-supplied default is (32K,16K,FREE). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─FREE─┐ │ │ >>──BElowheap──(──┬───────────┬──,──┬───────────┬──,──┼──────┼──)─────────────────────────────>< │ │ └─init_size─┘ └─incr_size─┘ └─KEEP─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ init_size Determines the minimum initial size of the below heap storage. This value can be specified as n, nK, or nM bytes of storage. The actual amount of allocated storage is rounded up to the nearest multiple of 4K. incr_size Determines the minimum size of any subsequent increment to the area below the 16M line, and is specified in n, nK, or nM bytes of storage. This value is rounded up to the nearest multiple of 4K. FREE Specifies that storage allocated to BELOWHEAP increments is released when the last of the storage is freed. KEEP Specifies that storage allocated to BELOWHEAP increments is not released when the last of the storage is freed. Usage Notes  CICS considerations-Under CICS, BELOWHEAP assumes the defaults BELOWHEAP(4K,4K,FREE). Both the initial size and the increment size are rounded to the nearest multiple of 8 bytes. The minimum is 4K. If you specify BELOWHEAP(0), both init_size and incr_size assume the IBM-supplied default of 4K.  OpenEdition MVS consideration-The BELOWHEAP option applies to the enclave. Performance Considerations BELOWHEAP improves performance when you specify values that minimize the number of times that the operating system allocates storage. The RPTSTG run-time option generates a report of storage your application uses while running. You can use its numbers to help determine what values to specify. See RPTSTG for more information about the RPTSTG run-time option. ═══ 2.1.8. CBLOPTS ═══ CBLOPTS specifies the format of the parameter string on application invocation when the main routine is COBOL. CBLOPTS determines whether run-time options or program arguments appear first in the parameter string. You can specify this option only in CEEUOPT or CEEDOPT at initialization. When you specify the ON suboption of CBLOPTS in CEEUOPT or CEEDOPT, the run-time arguments and program arguments specified in the JCL or on the command line are honored in the following order: program arguments/run-time options This order is the reverse of that normally honored by LE/370. Use this option only when the main routine is COBOL. Otherwise, LE/370 expects run-time options to precede program arguments. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─ON──┐ │ │ >>──CBLOpts──(──┼─────┼──)────────────────────────────────────────────────────────────────────>< │ │ └─OFF─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ON Specifies that program arguments appear first in the parameter string. OFF Specifies that run-time options appear first in the parameter string. ═══ 2.1.9. CBLPSHPOP ═══ CBLPSHPOP controls whether CICS PUSH HANDLE and CICS POP HANDLE commands are issued when a COBOL (VS COBOL II or COBOL/370) subroutine is called. Specify CBLPSHPOP(ON) to avoid compatibility problems when calling COBOL/370 or VS COBOL II subroutines that contain CICS CONDITION, AID, or ABEND condition handling commands. You can set the CBLPSHPOP run-time option on a transaction by transaction basis using CEEUOPT. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─ON──┐ │ │ >>──CBLPshpop──(──┼─────┼──)──────────────────────────────────────────────────────────────────>< │ │ └─OFF─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ON Automatically issues the following when a COBOL subroutine is called:  An EXEC CICS PUSH HANDLE command as part of the routine initialization.  An EXEC CICS POP HANDLE command as part of the routine termination. OFF Does not issue CICS PUSH HANDLE and CICS POP HANDLE commands on a call to a COBOL subroutine. Performance Consideration If your application calls COBOL subroutines under CICS, performance is better with CBLPSHPOP(OFF) than with CBLPSHPOP(ON). ═══ 2.1.10. CBLQDA ═══ CBLQDA controls COBOL QSAM dynamic allocation on an OPEN statement. CBLQDA does not affect dynamic storage allocation for the message file specified in MSGFILE or the dump file. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─ON──┐ │ │ >>──CBLQda──(──┼─────┼──)─────────────────────────────────────────────────────────────────────>< │ │ └─OFF─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ON Specifies that COBOL QSAM dynamic allocation is permitted. OFF Specifies that COBOL QSAM dynamic allocation is not permitted. Usage Note  CICS consideration-This option is ignored under CICS. ═══ 2.1.11. CHECK ═══ CHECK flags checking errors within an application. COBOL flags index, subscript, and reference modification ranges as checking errors. COBOL is the only language that uses the CHECK option. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─ON──┐ │ │ >>──CHeck──(──┼─────┼──)──────────────────────────────────────────────────────────────────────>< │ │ └─OFF─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ON Specifies that run-time checking is performed. OFF Specifies that run-time checking is not performed. Usage Note  CHECK(ON) has no effect if NOSSRANGE was in effect at compile time. Performance Consideration If your COBOL program was compiled with SSRANGE, and you are not testing or debugging an application, performance improves when you specify CHECK(OFF). ═══ 2.1.12. COUNTRY ═══ COUNTRY sets the default formats for date, time, the currency symbol, the decimal separator, and the thousands separator, based on a specified country. You can set the country value using the run-time option COUNTRY or the callable service CEE3CTY. For more information about CEE3CTY, refer to CEE3CTY-Set Default Country. The COUNTRY setting affects the format of the date and time in the reports generated by the RPTOPTS and RPTSTG run-time options. For more information, see RPTOPTS and RPTSTG. The IBM-supplied default is COUNTRY(US), with US signifying the United States. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──COUNTRy──(──┬──────────────┬──)───────────────────────────────────────────────────────────>< │ │ └─country_code─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ country_code A 2-character code that indicates to LE/370 the country on which to base the default settings. See IBM-Supplied Country Code Defaults for a list of countries and their codes. Usage Notes  If you specify a country_code that is not available on your system, LE/370 accepts the value and issues an informational message. When you specify an unavailable country code, you must provide a message template for that code. CEEUOPT and CEEDOPT permit the specification of an unavailable country code, but give a return code of 4 and a warning message.  C/370 consideration-C/370 provides locales that map to German, Spanish, French, U.S. English, and others. These locales establish default formats for items such as currency symbols. To change the locale, you can use the setlocale() library function. The settings of setlocale() and the COUNTRY run-time option do not affect one another. COUNTRY affects only LE/370 services; setlocale() affects only C/370 functions. To ensure that all settings are correct for your country, use both setlocale() and COUNTRY.  OpenEdition MVS consideration-The COUNTRY option sets the initial value for the enclave. ═══ 2.1.13. DEBUG | NODEBUG ═══ DEBUG activates the COBOL batch debugging features specified by the USE FOR DEBUGGING declarative. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─DEBUG───┐ │ │ >>──┴─NODEBUG─┴───────────────────────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ DEBUG Activates the COBOL batch debugging features. You must have the WITH DEBUGGING MODE clause in the environment division of your application in order to compile the debugging sections. NODEBUG Suppresses the COBOL batch debugging features. Usage Note  When specifying this option in CEEDOPT or CEEUOPT, use the syntax DEBUG(ON) or DEBUG(OFF). Use DEBUG and NODEBUG only on the command line. Performance Consideration To improve performance, use this option only while debugging. ═══ 2.1.14. DEPTHCONDLMT ═══ DEPTHCONDLMT specifies the extent to which conditions can be nested. Effect of DEPTHCONDLMT(3) on Condition Handlingpg=no. illustrates the effect of DEPTHCONDLMT(3) on condition handling. The initial condition and two nested conditions are handled in this example. The third nested condition is not handled. The IBM-supplied default is DEPTHCONDLMT(10). Error (level 1)  User-written condition handler ─ Another error (level 2)  User-written condition handler ─ Another error (level 3)  User-written condition handler ─ Another error (level 4)  Not handled Effect of DEPTHCONDLMT(3) on Condition Handling ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──DEPthcondlmt──(──┬───────┬──)─────────────────────────────────────────────────────────────>< │ │ └─limit─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ limit An integer of 0 or greater value. It is the depth of condition handling allowed. An unlimited depth of condition handling is allowed if you specify 0. A 1 value specifies handling of the initial condition, but does not allow handling of nested conditions that occur while handling a condition. With a 5 value, for example, the initial condition and four nested conditions are processed, but there can be no further nesting of conditions. If the number of nested conditions exceeds the limit, the application terminates with abend 4091 and reason code 21 (X'15'). Usage Note  OpenEdition MVS consideration-The DEPTHCONDLMT option sets the limit for how many nested synchronous conditions are allowed for a thread. Asynchronous signals do not affect DEPTHCONDLMT. ═══ 2.1.15. ENV ═══ ENV specifies the operating system for your C/370 application. The ENV option is restricted to applications where C/370 is the main routine. It can only be specified using #pragma runopts. The ENV option differs from other run-time options in that it does not have a standard default. The default depends on the system (CMS or MVS) in which compilation occurs. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──ENV──(──┬─CMS─┬──)────────────────────────────────────────────────────────────────────────>< │ │ ├─IMS─┤ │ │ └─MVS─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ CMS Specifies that the C/370 application runs in a VM environment. IMS Specifies that the C/370 application runs in an IMS environment. (However, you do not need to specify the ENV option if your application is invoked under IMS but does not actually use IMS facilities.) MVS Specifies that the C/370 application runs in an MVS environment. Usage Notes  CICS consideration-This option is ignored under CICS.  OpenEdition MVS consideration-The ENV option applies to the enclave. ═══ 2.1.16. ENVAR ═══ ENVAR sets the initial values for the environment variables specified in string. With ENVAR you can pass switches or tagged information into the application using the standard POSIX functions getenv, setenv, and clearenv. When you merge the run-time options, strings are appended in the order encountered during the merge. Thus, values established for the environment variables are the accumulation of all ENVAR run-time options specified. For a given name=, the last value is used. Environment variables in effect at the time of the system function are copied to the new environment. The copied environment variables are treated the same as those found in the ENVAR run-time option on the command level, with respect to the merge of the run-time options from their various sources. When you have specified the RPTOPTS run-time option, you receive a list of the various sources of the ENVAR option. The IBM-supplied default is ENVAR(''). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─,────────┐ │ │  │ │ │ >>──ENVAR──(───┬────────┬┴──)─────────────────────────────────────────────────────────────────>< │ │ └─string─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ string Is of the form name=value, where name and value are sequences of characters that do not contain null bytes or equal signs. The string name is an environment variable, and value is its value. Blanks are significant in both the name= and the value characters. You can enclose the string in either single or double quotation marks to distinguish it from other strings. string cannot contain DBCS characters. It can have a maximum of 250 characters. You can specify multiple environment variables, separating the name=value pairs with commas. Quotation marks are required when specifying multiple variables. Usage Notes  The ENVAR option functions independently of the POSIX run-time option setting.  You can override the ENVAR run-time option. If you specify NONOVR in CEEDOPT, LE/370 assumes OVR.  C/370 consideration-An application can access the environment variables using C function getenv or the POSIX variable environ, which is defined as: extern char **environ; Access through getenv is recommended, especially in a threading environment. HLLs can access the environment variables through standard C functions at enclave initialization and throughout the application's run. Access remains until the HLL returns from enclave termination. Environment variables that are propagated across the EXEC override those established by the ENVAR option. getenv serializes access to the environment variables.  OpenEdition MVS consideration-The environment variables apply to the enclave. ═══ 2.1.17. ERRCOUNT ═══ ERRCOUNT specifies how many conditions of severity 2, 3, and 4 can occur before the enclave terminates abnormally. After the number specified in ERRCOUNT is reached, no further LE/370 condition management, including CEEHDLR management, is honored. The IBM-supplied default is ERRCOUNT(0). This specifies that an unlimited number of conditions can occur. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──ERrcount──(──┬────────┬──)────────────────────────────────────────────────────────────────>< │ │ └─number─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ number The number of severity 2, 3, and 4 conditions that can occur while this enclave is running. If the number of conditions exceeds number, the enclave terminates abnormally. Usage Notes  COBOL consideration-LE/370 counts severity 1 messages with the facility ID IGZ. When the limit is reached, additional severity 1 messages are suppressed.  PL/I consideration-Use the default setting of ERRCOUNT(0) if you are using PL/I.  OpenEdition MVS consideration-The ERRCOUNT option sets the threshold for the total number of severity 2, 3, and 4 synchronous conditions that can occur for the enclave; thus, all threads participate in the count. Asynchronous signals do not affect ERRCOUNT. ═══ 2.1.18. EXECOPS | NOEXECOPS ═══ EXECOPS specifies whether you can enter run-time options on the command line. The EXECOPS | NOEXECOPS option is restricted to applications where C/370 is the main routine. You can specify it only by using #pragma runopts. Although EXECOPS | NOEXECOPS is only available as a run-time option for C/370, NOEXECOPS is also an OPTIONS option in the PL/I procedure statement. EXECOPS | NOEXECOPS can affect the format of the inbound argument list passed to your application. If you specify NOEXECOPS, the slash (/) that usually separates arguments from run-time options is passed as an argument to the application. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─EXECOPS───┐ │ │ >>──┴─NOEXECOPS─┴─────────────────────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ EXECOPS Specifies that you can enter run-time options on the command line. NOEXECOPS Specifies that you cannot enter run-time options on the command line. LE/370 interprets any options on the command line as arguments to the application. Usage Notes  CICS consideration-This option is ignored under CICS.  OpenEdition MVS consideration-The EXECOPS option applies only to the main routine of the initial thread. ═══ 2.1.19. FLOW ═══ FLOW controls the FLOW output produced by OS/VS COBOL routines. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─NOFLOW──┐ │ │ >>──┼─FLOW────┼───────────────────────────────────────────────────────────────────────────────>< │ │ ├─FLOW(n)─┤ │ │ ├─FLOW=n──┤ │ │ └─FLOWn───┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ NOFLOW Suppresses the OS/VS COBOL FLOW output. FLOW Does not suppress the OS/VS COBOL FLOW output. n Specifies the number of procedures traced. n can be any integer from 1 to 99, inclusive. ═══ 2.1.20. HEAP ═══ HEAP controls the allocation of the initial heap, controls allocation of additional heaps created with the CEECRHP callable service, and specifies how that storage is managed. Heaps are storage areas where you allocate memory for user-controlled dynamically allocated variables such as:  C variables allocated as a result of the malloc(), calloc(), and realloc() functions  COBOL working storage variables  PL/I variables with the storage class CONTROLLED, or the storage class BASED The HEAP option is always in effect. If you do not specify HEAP, LE/370 allocates the default value of heap storage when a call is made to obtain heap storage. LE/370 does not allocate heap storage until the first call to obtain heap storage is made. You can obtain heap storage by using language constructs or by making a call to CEEGTST. The IBM-supplied default is (64K,64K,ANYWHERE,KEEP,16K,16K). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─ANYwhere─┐ ┌─KEEP─┐ │ │ >>──Heap──(──┬───────────┬──,──┬───────────┬──,──┼──────────┼──,──┼──────┼──,──────────────────> │ │ └─init_size─┘ └─incr_size─┘ └─BELOW────┘ └─FREE─┘ │ │ │ │ >──┬──────────────┬──,──┬──────────────┬──)───────────────────────────────────────────────────>< │ │ └─┬──────────┬─┘ └─┬──────────┬─┘ │ │ └─initsz24─┘ └─incrsz24─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ init_size Determines the minimum initial allocation of heap storage. Specify this value as n, nK, or nM bytes of storage. The actual amount of allocated storage is rounded up to the nearest multiple of 4K. incr_size Determines the minimum size of any subsequent increment to the heap storage. Specify this value as n, nK, or nM bytes of storage. The actual amount of allocated storage is rounded up to the nearest multiple of 4K. ANYwhere Specifies that you can allocate heap storage anywhere in storage. On systems that support bimodal addressing, you can allocate storage either above or below the 16M line. If there is no available storage above the line, storage is acquired below the line. On systems that do not support bimodal addressing (for example, when VM/ESA is initially loaded in 370 mode), LE/370 ignores this option and places the heap storage below 16M. BELOW Specifies that you must allocate heap storage below the 16M line in storage that is accessible to 24-bit addressing. KEEP Specifies that storage allocated to HEAP increments is not released when the last of the storage is freed. FREE Specifies that storage allocated to HEAP increments is released when the last of the storage is freed. initsz24 Determines the minimum initial size of the heap storage that is obtained below the 16M line for applications running with ALL31(OFF) when these applications specify ANYWHERE in the HEAP run-time option. Specify initsz24 as n, nK, or nM number of bytes. The amount of storage is rounded up to the nearest multiple of 4K. initsz24 applies to all heaps that are not allocated strictly below the 16M line. incrsz24 Determines the minimum size of any subsequent increment to the heap area that is obtained below the 16M line for applications running with ALL31(OFF) when these applications specify ANYWHERE in the HEAP run-time option. Specify incrsz24 as n, nK, or nM number of bytes. The amount of storage is rounded up to the nearest multiple of 4K. incrsz24 applies to all heaps that are not allocated strictly below the 16M line. Usage Notes  Applications running in AMODE(24) that request heap storage obtain the storage below the 16M line regardless of the setting of ANYWHERE | BELOW.  COBOL consideration-You can use the HEAP option to provide some of the function provided by COBOL's space management tuning table.  C/370 consideration-If your C/370 application runs below the 16M (AMODE(24)) line, you must specify HEAP(,,BELOW,,,) as an installation default for the HEAP run-time option, on the command line when invoking the program, or at compile time as a #pragma runopts.  PL/I consideration-In pre-LE/370-conforming PL/I, the ANYWHERE | BELOW and KEEP | FREE suboptions were not positional. They could be in any order respective to each other. If init_size and/or incr_size was not specified they could be in the first or second position as well. This is no longer the case.  CICS consideration-If HEAP is not specified or if HEAP(0) is specified, LE/370 uses the IBM-supplied default of HEAP(4K,4K,ANYWHERE,KEEP,4K,4K). Both the initial HEAP allocation and HEAP increments are rounded to the next higher multiple of 8 bytes (not 4K bytes). The minimum is 4K bytes. If HEAP(,,ANYWHERE) is in effect, the maximum size of a heap segment is 1 gigabyte (1024M). These restrictions are subject to change from one release of CICS to another.  OpenEdition MVS considerations-The HEAP option applies to the enclave. Under OpenEdition MVS, heap storage is managed at the thread level using pthread_key_create, pthread_setspecific, and pthread_getspecific. Performance Considerations To improve performance, use the storage report numbers generated by the RPTSTG run-time option as an aid in setting the initial and increment size for HEAP. See RPTSTG for more information about the RPTSTG run-time option. ═══ 2.1.21. INTERRUPT ═══ INTERRUPT causes attention interrupts recognized by OS/2 to be recognized by LE/370 after the LE/370 environment has been initialized. The way you request an attention interrupt varies from operating system to operating system. When you request the interrupt, you can give control to your application or to a debug tool. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─OFF─┐ │ │ >>──INTerrupt──(──┼─────┼──)──────────────────────────────────────────────────────────────────>< │ │ └─ON──┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ OFF Specifies that LE/370 does not recognize attention interrupts. ON Specifies that LE/370 recognizes attention interrupts. In addition, if you have specified the TEST(ERROR) or TEST(ALL) run-time option, the interrupt causes the debug tool to gain control. See TEST | NOTEST for more information about the TEST run-time option. Usage Notes  PL/I consideration-LE/370 supports the PL/I method of polling code.  CICS consideration-INTERRUPT is ignored under CICS.  OpenEdition MVS consideration-The INTERRUPT option applies to the enclave. You do not need to set INTERRUPT to ON when POSIX(ON) is in effect. Terminal attention interrupts are directed to the POSIX process even with INTERRUPT set to OFF. ═══ 2.1.22. LIBSTACK ═══ LIBSTACK controls the allocation of the thread's library stack storage. This stack is used by LE/370 and HLL library routines that require save areas below the 16M line. The IBM-supplied default is (32K,16K,FREE). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─FREE─┐ │ │ >>──LIBStack──(──┬───────────┬──,──┬───────────┬──,──┼──────┼──)──────────────────────────────>< │ │ └─init_size─┘ └─incr_size─┘ └─KEEP─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ init_size Determines the size of the initial library stack segment. The storage is contiguous. Specify init_size as n, nK, or nM bytes of storage. init_size can be preceded by a minus sign. On systems other than CICS, if you specify a negative number, all available storage minus the amount specified is used for the initial stack segment. In all supported systems except CICS, an init_size of 0 or -0 requests half of the largest block of contiguous storage below the 16M line. At initialization, LE/370 allocates the storage rounded up to the nearest 4K. incr_size Determines the minimum size of any subsequent increment to the library stack area. Specify this value as n, nK, or nM bytes of storage. The actual amount of allocated storage is the larger of 2 values- incr_size or the requested size-rounded up to the nearest 4K (except under CICS). If you do not specify incr_size, C/370 uses the IBM-supplied default setting of 16K. If incr_size=0, LE/370 obtains only the amount of storage needed at the time of the request, rounded up to the nearest 4K. The requested size is the amount of storage a routine needs for a stack frame. For example, if the requested size is 9000 bytes, incr_size is specified as 8K and the initial stack segment is full, LE/370 obtains a 12K stack increment from the operating system to satisfy the request. If the requested size is smaller than 8K, LE/370 obtains an 8K stack increment from the operating system. FREE Specifies that LE/370 releases storage allocated to LIBSTACK increments when the last of the storage in the library stack is freed. The initial library stack segment is not released until the enclave terminates. KEEP Specifies that LE/370 does not release storage allocated to LIBSTACK increments when the last of the storage is freed. Usage Notes  CICS consideration-The initial and increment sizes for LIBSTACK are rounded to the next higher multiple of 8 bytes. The minimum is 4K. The IBM-supplied default setting for LIBSTACK under CICS is LIBSTACK(4K,4K,FREE).  OpenEdition MVS consideration-The LIBSTACK option sets the library stack characteristics on each thread. The recommended setting for LIBSTACK under OpenEdition MVS is LIBSTACK(12K,12K,FREE). Performance Considerations To improve performance, use the storage report numbers generated by the RPTSTG run-time option as an aid in setting the initial and increment size for LIBSTACK. See RPTSTG for more information about the RPTSTG run-time option. ═══ 2.1.23. MSGFILE ═══ MSGFILE specifies the ddname of the file where all run-time diagnostics and reports generated by the RPTOPTS and RPTSTG run-time options are written. The IBM-supplied default is MSGFILE(SYSOUT). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──MSGFile──(──┬────────┬──)─────────────────────────────────────────────────────────────────>< │ │ └─ddname─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ddname The ddname of the run-time diagnostics file. Usage Notes  HLL compile-time options can affect whether your run-time output goes to MSGFILE ddname.  LE/370 does not check the validity of the MSGFILE ddname. An invalid ddname generates an error condition on the first attempt to issue a message.  For more information on default attributes for MSGFILE, including COBOL and C run-time output, see CEEMSG-Get, Format, and Dispatch a Message.  C/370 consideration-C/370 perror() messages and output directed to stderr go to the MSGFILE destination.  PL/I consideration-Run-time messages in PL/I routines are directed to the file specified by the LE/370 MSGFILE run-time option, instead of to the PL/I SYSPRINT STREAM PRINT file. User-specified output is still directed to the PL/I SYSPRINT STREAM PRINT file. To direct this output to the LE/370 MSGFILE file, specify MSGFILE(SYSPRINT).  CICS considerations-The MSGFILE option is ignored under CICS. Run-time output under CICS is directed instead to a transient data queue named CESE.  OpenEdition MVS considerations-The MSGFILE option specifies the ddname of the diagnostic file for the enclave. When multiple threads write to the message file, the output is interwoven by line. To group lines of output, serialize MSGFILE access by using a mutex (for example). When OpenEdition MVS is available and the MSGFILE option specifies a ddname nominating a POSIX file, LE/370 uses POSIX services to write the message file. A ddname nominates a POSIX file using the keyword PATH=. OpenEdition MVS must be available on the underlying operating system for the MSGFILE option to write to a POSIX file. If the ddname nominates a POSIX file when POSIX is set to OFF, LE/370 tries to dynamically allocate an MVS file to be used as the message file. If the message file is allocated (whether POSIX or MVS), LE/370 directs the output to this file. If the current message file is not allocated, and the application carries out a fork/exec, LE/370 tries to dynamically allocate the message file to the POSIX file system. Within nested enclaves only the first enclave can have the POSIX option set to ON. All other nested enclaves must have the POSIX option set to OFF. ═══ 2.1.24. MSGQ ═══ MSGQ specifies the number of ISI blocks that LE/370 allocates on a per thread basis for use by the application. The ISI contains information that LE/370 uses to identify and react to conditions, provide access to q_data tokens, and assign space for message inserts used with user-created messages. When an ISI is needed and one is not available, LE/370 takes the least recently used ISI for reuse. The IBM-supplied default is MSGQ(15). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──MSGQ──(──┬────────┬──)────────────────────────────────────────────────────────────────────>< │ │ └─number─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ number An integer that specifies the number of ISIs to be maintained per thread within an enclave. ═══ 2.1.25. NATLANG ═══ NATLANG specifies the initial national language to be used for the run-time environment, including error messages, month names, and day of the week names. Message translations are provided for Japanese and (uppercase and mixed-case) U.S. English. NATLANG also determines how the message facility formats messages. You can set the national language by using the NATLANG run-time option or the SET option of the CEE3LNG callable service. LE/370 maintains one current language at the enclave level. This current language remains in effect until one of the above changes it. For example, if you specify JPN in the NATLANG run-time option, but subsequently specify ENU using the CEE3LNG callable service, ENU becomes the current national language. LE/370 writes storage and options reports and dump output only in mixed-case U.S. English. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─ENU─┐ │ │ >>──NATlang──(──┼─────┼──)────────────────────────────────────────────────────────────────────>< │ │ ├─UEN─┤ │ │ └─JPN─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ENU A 3-character ID specifying mixed-case U.S. English. Message text consists of SBCS (single-byte character set) characters and includes both uppercase and lowercase letters. UEN A 3-character ID specifying uppercase U.S. English. Message text consists of SBCS characters and includes only uppercase letters. JPN A 3-character ID specifying Japanese. Message text can contain a mixture of SBCS and DBCS (double-byte character set) characters. Usage Notes  If you specify a national language that is not available on your system, LE/370 uses the IBM-supplied default ENU (mixed-case U.S. English). CEEUOPT and CEEDOPT can specify an unknown national language code, but give a return code of 4 and a warning message.  OpenEdition MVS consideration-The NATLANG option specifies the initial value for the enclave. ═══ 2.1.26. PLIST ═══ PLIST specifies the format of the invocation parameters your C/370 application receives when you invoke it. Although the CICS, CMS, IMS, MVS, and TSO suboptions of PLIST are supported for compatibility, it is strongly recommended that you use the HOST or OS suboptions of PLIST. This option is restricted to applications where C/370 is the main routine. You can specify it only by using #pragma runopts. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─HOST─┐ │ │ >>──PLIST──(──┼─CICS─┼──)─────────────────────────────────────────────────────────────────────>< │ │ ├─CMS──┤ │ │ ├─IMS──┤ │ │ ├─MVS──┤ │ │ ├─OS───┤ │ │ └─TSO──┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ HOST The parameter list is a character string. The string is located differently under various systems as follows:  Under CMS, if invoked by OSRUN, use the string presented in an MVS-like format located by the pointer held in R1.  Under CMS, if not invoked by OSRUN, use the CMS extended parameter list.  Under TSO, if a command processor parameter list (CPPL) is detected, obtain the string from the command buffer.  Under TSO, if a CPPL is not detected, assume a halfword-prefixed string in the MVS format.  Under MVS, use the halfword-prefixed string. CICS The parameter list received by your C/370 application is assumed to be in a CICS format. CMS The parameter list received by your C/370 application is assumed to be in a CMS extended parameter list format. IMS The parameter list received by your C/370 application is assumed to be in an IMS format. MVS The parameter list received by your C/370 application is assumed to be in an MVS format. OS The parameter list received by your C/370 application is assumed to be in an OS style. TSO The parameter list received by your C/370 application is assumed to be in a CPPL format. Usage Notes  When using the pre-LE/370-conforming C/370 interface for preinitialization, it was necessary to specify PLIST(MVS) in order to flag pre-initialized routines. Although PLIST(MVS) is supported for compatibility, it is recommended that you specify PLIST(OS), when possible, to flag these pre-LE/370-conforming pre-initialized routines.  IMS considerations-If your C application runs under IMS, the suboption of PLIST that you specify depends on the version of the C/370 compiler you used. If you compiled your application with Version 2.1 (or earlier) of the C/370 compiler, specify the PLIST(IMS) suboption. If you compiled your application with an IBM SAA AD/Cycle C/370 compiler, specify the PLIST(OS) suboption.  CICS consideration-This option is ignored under CICS.  OpenEdition MVS consideration-The PLIST option applies only to the main routine of the initial thread. ═══ 2.1.27. POSIX ═══ POSIX specifies whether the enclave can run with the POSIX semantics. POSIX is an application characteristic that is maintained at the enclave level. After you have established the characteristic during enclave initialization, you cannot change it. When you set POSIX to ON, you can use functions that are unique to POSIX, for example, fork(). ANSI C routines can access POSIX files on MVS independently of the POSIX setting. Where ambiguities exist between ANSI and POSIX semantics, the POSIX run-time option setting indicates the POSIX semantics to follow. An error occurs if you set POSIX to ON when the feature is not available on the host system. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─OFF─┐ │ │ >>──POSix──(──┼─────┼──)──────────────────────────────────────────────────────────────────────>< │ │ └─ON──┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ OFF Indicates that the application is not POSIX-enabled. ON Indicates that the application is POSIX-enabled. Usage Notes  POSIX(ON) applies only to MVS/ESA*. It explicitly excludes CICS and CMS. If you set POSIX to ON while an application is running under CICS or CMS, you receive a warning message and the application continues to run. You can specify POSIX(ON) for both DB2* and IMS applications.  One of the effects of POSIX(ON) is the enablement of POSIX signal handling semantics, which interact closely with the LE/370 condition handling semantics.  The target of an exec function runs with POSIX set to ON, unless it has explicitly set POSIX to OFF.  If you set POSIX to ON when OpenEdition MVS is not active, the following events occur: - The message file receives a warning, but the application continues to run. - If you invoke a POSIX function, it does not take effect. - If you invoke a POSIX function that has no provision for failure, for example, alarm, a severity 3 condition is signaled. ═══ 2.1.28. REDIR | NOREDIR ═══ REDIR specifies whether you can enter directions for stdin, stderr, and stdout from the command line. This option is restricted to applications in which C/370 is the main routine. You can specify it only by using #pragma runopts. For ILC applications, REDIR can be used to direct printf output from the application to the MSGFILE so it can be interspersed with output from COBOL routines using the compile-time option OUTDD. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─REDIR───┐ │ │ >>──┴─NOREDIR─┴───────────────────────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ REDIR Specifies that you can redirect stdin, stderr, and stdout from the command line. REDIR applies only if ARGPARSE is also specified or defaulted. (See ARGPARSE | NOARGPARSE for a description of ARGPARSE). NOREDIR Specifies that you cannot redirect stdin, stderr, and stdout from the command line. Usage Notes  CICS consideration-This option is ignored under CICS.  OpenEdition MVS consideration-The REDIR | NOREDIR option applies only to the main routine of the initial thread. ═══ 2.1.29. RPTOPTS ═══ RPTOPTS generates, after an application has run, a report of the run-time options in effect while the application was running. LE/370 writes options reports only in mixed-case U.S. English. A report, however, includes language-specific settings. LE/370 directs the report to the ddname specified in the MSGFILE run-time option. See MSGFILE for more information about the MSGFILE option. RPTOPTS does not generate the options report if an application terminates abnormally. Options Report Produced by LE/370 Run-Time Option RPTOPTS(ON) shows the sample output when RPTOPTS is set to ON. RPTOPTS(ON) lists the declared run-time options in alphabetical order. The report lists the option names and shows where each option obtained its current setting. The LAST WHERE SET column in the report shows the last place where the options were referenced, even if no suboptions or subsets of the options were changed. "Default setting" in the report indicates that you cannot specify the option in CEEDOPT or CEEUOPT. "Programmer default" includes any options specified with C/370 #pragma runopts, PL/I PLIXOPT, and CEEUOPT. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─OFF─┐ │ │ >>──RPTOpts──(──┼─────┼──)────────────────────────────────────────────────────────────────────>< │ │ └─ON──┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ OFF Does not generate a report of the run-time options in effect while the application was running. ON Generates a report of the run-time options in effect while the application was running. Usage Note  OpenEdition MVS consideration-The RPTOPTS option reports run-time options for the enclave. Performance Considerations This option increases the time it takes for the application to run. Therefore, use it only as an aid to application development. Options Report Produced by LE/370 Run-Time Option RPTOPTS(ON) Options Report for Enclave NOP 05/12/93 9:53 AM LAST WHERE SET OPTION ------------------------------------------------------------------- Installation default ABPERC(NONE) Installation default ABTERMENC(RETCODE) Installation default NOAIXBLD Installation default ALL31(OFF) Installation default ANYHEAP(32768,16384,ANYWHERE,FREE) Installation default BELOWHEAP(32768,16384,FREE) Installation default CBLOPTS(ON) Installation default CBLPSHPOP(ON) Installation default CBLQDA(ON) Installation default CHECK(ON) Installation default COUNTRY(US) Installation default DEBUG Installation default DEPTHCONDLMT(10) Installation default ENVAR('') Installation default ERRCOUNT(0) Default setting NOFLOW(99) Installation default HEAP(65536,65536,ANYWHERE,KEEP,16384,16384) Installation default INTERRUPT(OFF) Default setting ISAINC(0,0) Default setting ISASIZE(0,0,0) Installation default LIBSTACK(32768,16384,FREE) Installation default MSGFILE(SYSOUT) Installation default MSGQ(15) Installation default NATLANG(ENU) Installation default POSIX(OFF) Invocation command RPTOPTS(ON) Invocation command RPTSTG(ON) Installation default NORTEREUS Installation default NOSIMVRD Installation default STACK(524288,524288,BELOW,KEEP) Installation default STORAGE(NONE,NONE,NONE,8192) Installation default TERMTHDACT(TRACE) Installation default NOTEST(ALL,"*","PROMPT","INSPPREF") Installation default TRACE(OFF,4K,DUMP,LE=0) Installation default TRAP(ON) Installation default UPSI(00000000) Installation default VCTRSAVE(OFF) Installation default XUFLOW(AUTO) ═══ 2.1.30. RPTSTG ═══ RPTSTG generates, after an application has run, a report of the storage the application used. The report is directed to the ddname specified in the MSGFILE run-time option. For more information about the MSGFILE option, see MSGFILE. Storage Report Produced by LE/370 Run-Time Option RPTSTG(ON)pg=no. shows a sample report created with the RPTSTG option set to ON. You can use the storage report information to adjust the ANYHEAP, BELOWHEAP, HEAP, LIBSTACK, and STACK run-time options. LE/370 writes storage reports only in mixed-case U.S. English. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─OFF─┐ │ │ >>──RPTStg──(──┼─────┼──)─────────────────────────────────────────────────────────────────────>< │ │ └─ON──┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ OFF Does not generate a report of the storage used while the application was running. ON Generates a report of the storage used while the application was running. Usage Notes  RPTSTG does not generate a storage report if your application terminates abnormally.  In the storage report shown in Storage Report Produced by LE/370 Run-Time Option RPTSTG(ON) the numbers displayed following "Number of segments allocated" and "Number of segments freed" represent the following: - On VM/ESA, the number of CMSSTOR OBTAIN and CMSSTOR RELEASE requests, respectively. - On CICS, the number of EXEC CICS GETMAIN and EXEC CICS FREEMAIN requests, respectively.  OpenEdition MVS consideration-The RPTSTG option applies to storage utilization for the enclave, including thread-level information on stack utilization, and stack storage used by multiple threads. Performance Considerations This option increases the time it takes for an application to run. Therefore, use it only as an aid to application development. The storage report generated by RPTSTG(ON) shows the number of system-level get storage calls that were required while the application was running. To improve performance, use the storage report numbers generated by the RPTSTG option as an aid in setting the initial and increment size for STACK and HEAP. This reduces the number of times that the LE/370 storage manager makes requests to acquire storage. For example, you can use the storage report numbers to set appropriate values in the HEAP and STACK init_size and incr_size fields for allocating storage. See STACK for more information about the STACK run-time option. See HEAP for more information about the HEAP run-time option. For more information about tuning your application with storage numbers, see LE/370 Programming Guide. Storage Report Produced by LE/370 Run-Time Option RPTSTG(ON) STORAGE REPORT FOR ENCLAVE TEST. 07/08/93 2:30 PM STACK statistics: Initial size: 524288 Increment size: 524288 Stack storage used (by all threads): 11464 Largest stack used (by any thread): 11464 Number of segments allocated: 0 Number of segments freed: 0 LIBSTACK statistics: Initial size: 32768 Increment size: 16384 Stack storage used (by all threads): 680 Largest stack used (by any thread): 680 Number of segments allocated: 0 Number of segments freed: 0 HEAP statistics: Initial size: 65536 Increment size: 65536 Total heap storage used (sugg. initial size): 0 Successful Get Heap requests: 0 Successful Free Heap requests: 0 Number of segments allocated: 0 Number of segments freed: 0 ANYHEAP statistics: Initial size: 32768 Increment size: 16384 Total heap storage used (sugg. initial size): 1776 Successful Get Heap requests: 16 Successful Free Heap requests: 1 Number of segments allocated: 1 Number of segments freed: 0 BELOWHEAP statistics: Initial size: 32768 Increment size: 16384 Total heap storage used (sugg. initial size): 168 Successful Get Heap requests: 1 Successful Free Heap requests: 0 Number of segments allocated: 1 Number of segments freed: 0 Additional Heap statistics: Successful Create Heap requests: 0 Successful Discard Heap requests: 0 Total heap storage used: 0 Successful Get Heap requests: 0 Successful Free Heap requests: 0 Number of segments allocated: 0 Number of segments freed: 0 End of Storage Report ═══ 2.1.31. RTEREUS ═══ RTEREUS implicitly initializes the run-time environment to be reusable when the main program for the thread is a COBOL program. This option is valid only when used with CEEDOPT or CEEUOPT. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─NORTEREUS─┐ │ │ >>──┴─RTEREUS───┴─────────────────────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ NORTEREUS Does not initialize the run-time environment to be reusable when the first COBOL routine is invoked. RTEREUS Initializes the run-time environment to be reusable when the first COBOL routine is invoked. Usage Notes  When you specify RTEREUS in CEEDOPT or CEEUOPT, the only accepted syntax is RTEREUS(ON) or RTEREUS(OFF).  CICS consideration-This option is ignored under CICS.  IMS consideration-RTEREUS is not recommended for use under IMS. Performance Considerations You must change STOP RUN statements to GOBACK statements in order to gain the benefits of RTEREUS. STOP RUN terminates the reusable environment. If you specify RTEREUS, LE/370 recreates the reusable environment on the next invocation of COBOL. Doing this repeatedly degrades performance, because a reusable environment takes longer to create than does a normal environment. LE/370 also offers preinitialization support in addition to RTEREUS. ═══ 2.1.32. SIMVRD ═══ SIMVRD specifies whether your COBOL routines use a VSAM KSDS to simulate variable-length relative organization data sets. SIMVRD conforms to the ANSI 1985 COBOL standard. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─NOSIMVRD─┐ │ │ >>──┴─SIMVRD───┴──────────────────────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ NOSIMVRD Do not use a VSAM KSDS to simulate variable length relative organization. SIMVRD Use a VSAM KSDS to simulate variable length relative organization. Usage Notes  When specifying this option in CEEDOPT or CEEUOPT, use the syntax SIMVRD(ON) or SIMVRD(OFF). Use SIMVRD and NOSIMVRD only on the command line.  CICS consideration-This option is ignored under CICS. ═══ 2.1.33. STACK ═══ STACK controls the allocation of the thread's stack storage. Typical items residing in the stack are C or PL/I automatic variables, and temporary work areas for COBOL library routines. Storage required for the common anchor area (CAA) and other control blocks is allocated separately from, and prior to, the allocation of the initial stack segment and the initial heap. The IBM-supplied default is (512K,512K,BELOW,KEEP). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─BELOW────┐ ┌─KEEP─┐ │ │ >>──STACk──(──┬───────────┬──,──┬───────────┬──,──┼──────────┼──,──┼──────┼──)────────────────>< │ │ └─init_size─┘ └─incr_size─┘ └─ANYwhere─┘ └─FREE─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ init_size Determines the size of the initial stack segment. The storage is contiguous. You specify the init_size value as n, nK, or nM bytes of storage. The actual amount of allocated storage is rounded up to the nearest multiple of 4K. init_size can be preceded by a minus sign. On systems other than CICS, if you specify a negative number LE/370 uses all available storage minus the amount specified for the initial stack segment. A size of "0" or "-0" requests half of the largest block of contiguous storage in the region below the 16M line. Behavior under CICS is described in the Usage Notes for this run-time option. incr_size Determines the minimum size of any subsequent increment to the stack area. You can specify this value as n, nK, or nM bytes of storage. The actual amount of allocated storage is the larger of two values- incr_size or the requested size-rounded up to the nearest 4K (except under CICS). If you specify incr_size as 0, only the amount of the storage needed at the time of the request, rounded up to the nearest 4K, is obtained. The requested size is the amount of storage a routine needs for a stack frame. For example, if the requested size is 9000 bytes, incr_size is specified as 8K, and the initial stack segment is full, LE/370 obtains a 12K stack increment from the operating system to satisfy the request. If the requested size is smaller than 8K, LE/370 obtains an 8K stack increment from the operating system. BELOW Specifies that the stack storage must be allocated below the 16M line, in storage that is accessible to 24-bit addressing. ANY Specifies that stack storage can be allocated anywhere in storage. On systems that support bimodal addressing, storage can be allocated either above or below the 16M line. If there is no storage available above the line, LE/370 acquires storage below the line. On systems that do not support bimodal addressing (for example, when VM/ESA is initial program loaded in 370 mode) LE/370 ignores this option and places the stack storage below 16M. KEEP Specifies that storage allocated to STACK increments is not released when the last of the storage in the stack increment is freed. FREE Specifies that storage allocated to STACK increments is released when the last of the storage in the stack is freed. The initial stack segment is never released until the enclave terminates. Usage Notes  Applications running with ALL31(OFF) must specify STACK(,,BELOW) to ensure that stack storage is addressable by the application.  CICS consideration-The IBM-supplied default setting for STACK under CICS is STACK(4K,4K,ANYWHERE,KEEP). The maximum initial and increment size for CICS above 16M is 1 gigabyte (1204M). This restriction is subject to change from one release of CICS to another. Both the initial size and the increment size are rounded up to the nearest multiple of 8 bytes. The minimum is 4K. If you do not specify STACK, LE/370 assumes the default value of 4K. Under CICS, STACK(0), STACK (-0), and STACK (-n) are all interpreted as STACK(4K).  PL/I consideration-PL/I automatic storage above the 16M line is supported under control of the LE/370 STACK option. When the LE/370 stack is above, PL/I temporaries (dummy arguments) and parameter lists (for reentrant/recursive blocks) also reside above. You must recompile your programs with PL/I MVS & VM to use this feature. Otherwise, you must use STACK(BELOW) or results are unpredictable. The stack frame size for an individual block is constrained to 16M. Stack frame extensions are also constrained to 16M. Therefore, the size of an automatic aggregate, temporary variable, or dummy argument cannot exceed 16M. Violation of this constraint might have unpredictable results.  OpenEdition MVS consideration-The STACK option specifies the characteristics of the user stack for the initial thread. In particular, it obtains the initial size of the user stack for the initial thread. The characteristics that indicate incr_size, ANYWHERE, and KEEP | FREE apply to any thread created using pthread_create. For threads created using pthread_create, LE/370 obtains the initial stack size from the threads attribute object specified in the pthread_create function. The default size to be set in the threads attribute object is obtained from the STACK run-time option's initial size. The recommended default setting for STACK under OpenEdition MVS is STACK(12K,12K,ANYWHERE,KEEP). Performance Considerations To improve performance, use the storage report numbers generated by the RPTSTG run-time option as an aid in setting the initial and increment size for STACK. See RPTSTG for more information about the RPTSTG run-time option. ═══ 2.1.34. STORAGE ═══ STORAGE controls the initial content of storage when allocated and freed, and the amount of storage that is reserved for the out-of-storage condition. If you specify one of the parameters in the STORAGE run-time option, all allocated storage processed by the parameter is initialized to that value. Otherwise, it is left uninitialized. You can use the STORAGE option to identify uninitialized application variables, or prevent the accidental use of previously freed storage. STORAGE is also useful in data security. For example, storage containing sensitive data can be cleared when it is freed. The IBM-supplied default is (NONE,NONE,NONE,8K). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──STOrage──(──┬──────────────────┬──,──┬─────────────────┬──,──┬─────────────────┬──,────────> │ │ └─heap_alloc_value─┘ └─heap_free_value─┘ └─dsa_alloc_value─┘ │ │ │ │ >──┬──────────────┬──)────────────────────────────────────────────────────────────────────────>< │ │ └─reserve_size─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ heap_alloc_value The initialized value of any heap storage allocated by the storage manager. You can specify heap_alloc_value as:  A single character enclosed in quotes. If you specify a single character, every byte of heap storage allocated by the storage manager is initialized to that character's EBCDIC equivalent. For example, if you specify 'a' as the heap_alloc_value, heap storage is initialized to X'818181...81' or 'aaa...a'.  Two hex digits without quotes. If you specify two hex digits, every byte of the allocated heap storage is initialized to that value. For example, If you specify FE as the heap_alloc_value, heap storage is initialized to X'FEFEFE...FE'. A heap_alloc_value of 00 initializes heap storage to X'0000...00'.  NONE. If you specify NONE, the allocated heap storage is not initialized. heap_free_value The value of any heap storage freed by the storage manager is overwritten. You can specify heap_free_value as:  A single character enclosed in quotes. For example, a heap_free_value of 'f' overwrites freed heap storage to X'868686...86'; 'B' overwrites freed heap storage to X'C2'.  Two hex digits without quotes. A heap_free_value of FE overwrites freed heap storage with X'FEFEFE...FE'.  NONE. If you specify NONE, the freed heap storage is not initialized. dsa_alloc_value The initialized value of stack frames from the LE/370 stack. A stack frame is dynamically-acquired storage that is composed of a standard register save area and the area available for automatic storage. If specified, all LE/370 stack storage, including automatic variable storage, is initialized to dsa_alloc_value. Stack frames allocated outside the LE/370 stack are never initialized. You can specify dsa_alloc_value as:  A single character enclosed in quotes. If you specify a single character, any dynamically acquired stack storage allocated by the storage manager is initialized to that character's EBCDIC equivalent. For example, if you specify 'A' as the dsa_alloc_value, stack storage is initialized to X'C1'. A dsa_alloc_value of 'F' initializes stack storage to X'C6', 'd' to X'84'.  Two hex digits without quotes. If you specify two hex digits, any dynamically-acquired stack storage is initialized to that value. For example, if you specify FE as the dsa_alloc_value, stack storage is initialized to X'FE'. A dsa_alloc_value of 00 initializes stack storage to X'00', FF to X'FF'.  NONE. If you specify NONE, the stack storage is not initialized. reserve_size The amount of storage for the LE/370 storage manager to reserve in the event of an out-of-storage condition. You can specify the reserve_size value as n, nK, or nM bytes of storage. The amount of storage is rounded to the nearest 4K. If you specify reserve_size as 0, no reserve segment is allocated. If you do not specify a reserve segment and your application runs out of storage, the application abends with a return code of 4088 and a reason code of 1004. If you specify a reserve_size that is greater than 0 on a non-CICS system, LE/370 does not immediately abend when your application runs out of storage. Instead, when the stack overflows, LE/370 attempts to get another stack segment and add it to the stack. If unsuccessful, LE/370 temporarily adds the reserve stack segment to the overflowing stack, and signals the out-of-storage condition. This causes a user-written condition handler to gain control and release storage. If the reserve stack segment overflows while this is happening, LE/370 abends with a return code of 4088 and reason code of 1004. To avoid such an overflow, increase the size of the reserve stack segment with the STORAGE(,,,reserve_size) run-time option. The reserve stack segment is not freed until thread termination. Usage Notes  heap_alloc_value, heap_free_value, and dsa_alloc_value can all be enclosed in quotes. To initialize heap storage to the EBCDIC equivalent of a single quote, double it within the string delimited by single quotes or surround it with a pair of double quotes. Both of the following are correct ways to specify a single quote: STORAGE('''') STORAGE("'") Similarly, double quotes must be doubled within a string delimited by double quotes, or surrounded by a pair of single quotes. The following are correct ways to specify a double quote: STORAGE("""") STORAGE('"')  CICS consideration-The IBM-supplied default setting for STORAGE under CICS is STORAGE(NONE,NONE,NONE,0K). The out-of-storage condition is not raised under CICS.  OpenEdition MVS consideration-The STORAGE option applies to the enclave. Performance Considerations Using STORAGE to control initial values can increase program run time. If you specify a dsa_alloc_value, performance is likely to be poor. Therefore, use the dsa_alloc_value option only for debugging, not to initialize automatic variables or data structures. Use STORAGE(NONE,NONE,NONE) when you are not debugging. ═══ 2.1.35. TERMTHDACT ═══ TERMTHDACT sets the level of information that is produced when LE/370 percolates a condition of severity 2 or greater beyond the first routine's stack frame. The LE/370 service CEE3DMP is called for the TRACE and DUMP suboptions of TERMTHDACT. The following CEE3DMP options are passed for TRACE: NOENTRY CONDITION TRACEBACK THREAD(ALL) NOBLOCK NOSTORAGE NOVARIABLES NOFILES STACKFRAME(ALL) PAGESIZE(60) FNAME(CEEDUMP) The following options are passed for DUMP: THREAD(ALL) NOENTRY TRACEBACK FILES VARIABLES BLOCK STORAGE STACKFRAME(ALL) PAGESIZE(60) FNAME(CEEDUMP) CONDITION For more information about the CEE3DMP service and its parameters, see CEE3DMP-Generate Dump. If a message is printed (based upon the TERMTHDACT run-time option), the message is for the active condition immediately prior to the termination imminent step. In addition, if that active condition is a promoted condition (was not the original condition), the original condition's message is printed. If the TRACE run-time option is specified with the DUMP suboption, a dump containing the trace table, at a minimum, is produced. The contents of the dump depend on the values set in the TERMTHDACT run-time option. Under abnormal termination, the following dump contents are generated:  TERMTHDACT(TRACE)-generates a dump containing the trace table and the traceback  TERMTHDACT(QUIET)-generates a dump containing the trace table only  TERMTHDACT(MSG)-generates a dump containing the trace table only  TERMTHDACT(DUMP)-generates a dump containing thread/enclave/process storage and control blocks (the trace table is included as an enclave control block) Under normal termination, the following dump contents are generated:  Independent of the TERMTHDACT setting, LE/370 generates a dump containing the trace table only. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─TRACE─┐ │ │ >>──TERmthdact──(──┼───────┼──)───────────────────────────────────────────────────────────────>< │ │ ├─QUIET─┤ │ │ ├─MSG───┤ │ │ └─DUMP──┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ TRACE Specifies that when a thread terminates due to an unhandled condition of severity 2 or greater, LE/370 generates a message indicating the cause of the termination and a trace of the active routines on the activation stack. QUIET Specifies that LE/370 does not generate a message when a thread terminates due to an unhandled condition of severity 2 or greater. MSG Specifies that when a thread terminates due to an unhandled condition of severity 2 or greater, LE/370 generates a message indicating the cause of the termination. DUMP Specifies that when a thread terminates due to an unhandled condition of severity 2 or greater, LE/370 generates a message indicating the cause of the termination, a trace of the active routines on the activation stack, and an LE/370 dump. Usage Notes  PL/I considerations-After a normal return from a PL/I ERROR ON-unit or from a PL/I FINISH ON-unit, LE/370 considers the condition unhandled. If a GOTO is not performed and the resume cursor is not moved, the thread terminates. The TERMTHDACT setting guides the amount of information that is produced. The message is not presented twice.  CICS consideration-All TERMTHDACT output is written to a transient data queue named CESE.  OpenEdition MVS consideration-The TERMTHDACT option applies when a thread terminates abnormally. Abnormal termination of a single thread causes termination of the entire enclave. If an unhandled condition of severity 2 or higher percolates beyond the first routine's stack frame, the enclave terminates abnormally. If an enclave terminates due to a POSIX default signal action, TERMTHDACT applies only to conditions that result from program checks or abends. ═══ 2.1.36. TEST | NOTEST ═══ TEST specifies the conditions under which a debug tool such as the IBM SAA AD/Cycle Debug Tool/370 assumes control when the user application is being initialized. Parameters of the TEST and NOTEST run-time options are merged as one set of parameters. The IBM-supplied default is: NOTEST(ALL,*,PROMPT,INSPPREF). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─NOTest─┐ ┌─ALL───┐ ┌─PROMPT───┐ │ │ >>──┴─TEST───┴──(──┼───────┼──,──┬───────────────┬──,──┼──────────┼──,──┬─────────────────┬────> │ │ ├─ERROR─┤ ├─commands_file─┤ ├─NOPROMPT─┤ ├─preference_file─┤ │ │ └─NONE──┘ └─*─────────────┘ ├─*────────┤ └─*───────────────┘ │ │ ├─;────────┤ │ │ └─command──┘ │ │ │ │ >──)──────────────────────────────────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ALL Specifies that any of the following causes the debug tool to gain control even without a defined AT OCCURRENCE for a particular condition or AT TERMINATION:  The ATTENTION function  Any LE/370 condition of severity 1 or above  Application termination ERROR Specifies that only one of the following causes the debug tool to gain control without a defined AT OCCURRENCE for a particular condition or AT TERMINATION:  The ATTENTION function  Any LE/370-defined error condition of severity 2 or higher  Application termination NONE Specifies that no condition causes the debug tool to gain control without a defined AT OCCURRENCE for a particular condition or AT TERMINATION. commands_file A valid ddname, data set name (MVS), or file name (CMS), specifying the primary commands file for this run. If you do not specify this parameter all requests for commands go to the user terminal. You can enclose commands_file in single or double quotes to distinguish it from the rest of the TEST | NOTEST suboption list. It can have a maximum length of 80 characters. If the data set name provided could be interpreted as a ddname, it must be preceded by a slash (/). The slash and data set name must be enclosed in quotes. A primary commands file is required when running in a batch environment. * (asterisk-in place of commands_file) Specifies that no commands_file is supplied. The terminal, if available, is used as the source of the debug tool commands. PROMPT Specifies that the debug tool is invoked at LE/370 initialization. NOPROMPT Specifies that the debug tool is not invoked at LE/370 initialization. * (asterisk-in place of PROMPT/NOPROMPT) Specifies that the debug tool is not invoked at LE/370 initialization; equivalent to NOPROMPT. ; (semicolon-in place of PROMPT/NOPROMPT) Specifies that the debug tool is invoked at LE/370 initialization; equivalent to PROMPT. command A character string that specifies a valid debug tool command. The command list can be enclosed in single or double quotes to distinguish it from the rest of the TEST parameter list. It cannot contain DBCS characters. The list can have a maximum of 250 characters. preference_file A valid ddname, data set name (MVS), or file name (CMS), specifying the preference file to be used. A preference file is a type of commands file that you can use to specify settings for your debugging environment. It is analogous to creating a profile for a text editor, or initializing an S/370 terminal session. You can enclose preference_file in single or double quotes to distinguish it from the rest of the TEST parameter list. It can have a maximum of 80 characters. If a specified data set name could be interpreted as a ddname, it must be preceded by a slash (/). The slash and data set name must be enclosed in quotes. The IBM-supplied default setting for preference_file is INSPPREF. * (asterisk-in place of preference_file) Specifies that no preference_file is supplied. Usage Notes  You can specify parameters on the NOTEST option. If NOTEST is in effect when the application gains control, it is interpreted as TEST(NONE,,*,). If Debug Tool/370 is initialized using a CALL CEETEST or equivalent, the initial test level, the initial commands_file, and the initial preference_file are taken from the NOTEST run-time option setting.  OpenEdition MVS consideration-LE/370 honors the initial command string before the main routine runs on the initial thread. The test level (ALL, ERROR, NONE) applies to the enclave. LE/370 honors the preference file when the debug tool is initialized, regardless of which thread first requests the debug tool services. Performance Consideration To improve performance, use this option only while debugging. ═══ 2.1.37. TRACE ═══ TRACE controls run-time library tracing activity, the size of the in-storage trace table, the type of trace events to record, and it determines whether a dump containing, at a minimum, the trace table should be unconditionally taken when the application terminates. When you specify TRACE(ON), user-requested trace entries are intermixed with LE/370 trace entries in the trace table. Under normal termination conditions, if TRACE is active and you specify DUMP, only the trace table is written to the dump report, independent of the TERMTHDACT setting. Only one dump is taken for each termination. Under abnormal termination conditions, the type of dump taken (if one is taken) depends on the value of the TERMTHDACT run-time option and whether TRACE is active and the DUMP suboption is specified. For more information about the dump contents, see TERMTHDACT. The IBM-supplied default is TRACE(OFF,4K,DUMP,LE=0). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─OFF─┐ ┌─DUMP───┐ │ │ >>──TRACE──(──┼─────┼──┬────────────┬──┼────────┼──┬─────┬──)─────────────────────────────────>< │ │ └─ON──┘ └─table_size─┘ └─NODUMP─┘ └─LE=─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ OFF Indicates that the tracing facility is inactive. ON Indicates that the tracing facility is active. table_size Determines the size of the tracing table as specified in bytes (nK or nM). The upper limit is 16M. DUMP Requests that an LE/370-formatted dump (containing the trace table) be taken at program termination regardless of the setting of the TERMTHDACT run-time option. NODUMP Requests that an LE/370-formatted dump not be taken at program termination. LE=n Requests the type of trace events to be recorded. n is a hexadecimal number with a maximum of eight characters or digits. If you specify fewer than eight hexadecimal digits, the value is padded on the left with zeros. The possible settings for the trace events are: 0 No trace 1 Entry/exit members from LE/370 members 2 Mutex init/destroy and locks/unlocks from LE/370 members ═══ 2.1.38. TRAP ═══ TRAP specifies how LE/370 routines handle abends and program interrupts. TRAP(ON) must be in effect in order for applications to run successfully. This option is similar to the STAE | NOSTAE run-time option currently offered by COBOL and C and the SPIE | NOSPIE option offered by C and PL/I:  When only a single option is specified in input, TRAP is set according to that option: TRAP(OFF) for NOSTAE or NOSPIE, TRAP(ON) for STAE or SPIE.  When both options are specified in input (STAE/SPIE, SPIE/STAE, STAE/NOSPIE, NOSPIE/STAE, SPIE/NOSTAE, NOSTAE/SPIE), TRAP is set to ON unless both options are negative. In this case, TRAP is set to OFF. (This is for diagnosis only in LE/370.) However, if you specified STAE in one #pragma runopts statement, and NOSPIE in another, the result would be TRAP(OFF). In this case, the option in the last #pragma runopts determines the setting of TRAP.  If multiple instances of STAE | NOSTAE are encountered, all except the last instance are ignored. If multiple instances of SPIE | NOSPIE are encountered, all except the last instance are ignored.  If an options string has TRAP(ON) or TRAP(OFF) together with SPIE | NOSPIE and/or STAE | NOSTAE, the TRAP setting takes precedence over all of the others. The use of the CEESGL callable service remains unaffected by this option. See CEESGL-Signal a Condition for more information. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─ON──┐ │ │ >>──TRap──(──┼─────┼──)───────────────────────────────────────────────────────────────────────>< │ │ └─OFF─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ON Fully enables the LE/370 condition handler. OFF Prevents language condition handlers or handlers registered by CEEHDLR from being notified of abends or program checks; prevents application of POSIX signal handling semantics for abends and program checks. For more information about the CEEHDLR callable service, see CEEHDLR-Register User-Written Condition Handler. Usage Notes  During normal processing, LE/370 expects TRAP(ON) to be in effect for the application to run successfully, especially when the POSIX option is set to ON. Use TRAP(OFF) when a program exception needs to be analyzed before LE/370 handles it.  When you specify TRAP(OFF) in a non-CICS environment, neither ESPIE nor ESTAE is issued. LE/370 does not handle conditions raised by program interrupts or abends initiated by SVC 13 as LE/370 conditions, and does not print messages for such conditions.  Running with TRAP(OFF) (for exception diagnosis purposes) can cause many side effects, because LE/370 uses condition handling internally and requires TRAP(ON). When you run with TRAP(OFF), you can get side effects even if you do not encounter a software-raised condition, program check, or abend. If you do encounter a program check or an abend with TRAP(OFF) in effect, the following side effects can occur: - The ABTERMENC run-time option has no effect. - Resources acquired by LE/370 are not freed. - Files opened by HLLs are not closed by LE/370, so records might be lost. - The abnormal termination exit is not driven for enclave termination. - The assembler user exit is not driven for enclave termination. - User condition handlers are not enabled. - The debugger is not notified of the error. - No storage report or run-time options report is generated. - No LE/370 messages or LE/370 dump output is generated. - In OpenEdition MVS, POSIX signal handling semantics are not enabled for the abend. The enclave terminates abnormally if such conditions are raised.  TRAP(ON) must be in effect when you use the CEEBXITA assembler user exit for enclave initialization to specify a list of abend codes that LE/370 percolates.  If your application uses extended-precision arithmetic and runs on a 370-mode machine, you must specify TRAP(ON) and add the CMSLIB TXTLIB with the GLOBAL TXTLIB command.  CICS consideration-When you specify TRAP(OFF) in a CICS environment, the standard CICS system action occurs. LE/370 does not print messages for conditions raised by program interruptions or transaction abends.  OpenEdition MVS consideration-The TRAP option applies to the entire enclave and all threads within. ═══ 2.1.39. UPSI ═══ UPSI sets the eight UPSI switches on or off for applications that use COBOL routines. The IBM-supplied default setting is UPSI(00000000). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──UPSI──(──┬──────────┬──)──────────────────────────────────────────────────────────────────>< │ │ └─nnnnnnnn─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ nnnnnnnn n represents one UPSI switch between 0 and 7, the leftmost n representing the first switch. Each n can either be 0 (off) or 1 (on). Usage Note  When you specify this option in CEEDOPT or CEEUOPT, specify UPSI with a string of eight binary-valued flags; for example, UPSI(00000000). Use UPSI, not followed by a string, only on the command line. ═══ 2.1.40. VCTRSAVE ═══ VCTRSAVE specifies whether any language in the application uses the vector facility when the user-written condition handlers are called. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─OFF─┐ │ │ >>──Vctrsave──(──┼─────┼──)───────────────────────────────────────────────────────────────────>< │ │ └─ON──┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ OFF No language in the application uses the vector facility when user-provided condition handlers are called. ON A language in the application uses the vector facility when user-provided condition handlers are called. Usage Note  OpenEdition MVS consideration-The VCTRSAVE option applies to the entire enclave and all threads within. Performance Considerations When the condition handler plans to use the vector facility (that is, run any vector instructions), the entire vector environment has to be saved on every condition and restored on return to the application code. You can avoid this extra work by specifying VCTRSAVE(OFF) when you are not running an application under vector hardware. ═══ 2.1.41. XUFLOW ═══ XUFLOW specifies whether an exponent underflow causes a program interrupt. An exponent underflow occurs when a floating point number becomes too small to be represented. The underflow setting is determined at enclave initialization and is updated when new languages are introduced into the application (via fetch or dynamic call, for example). Otherwise, it does not vary while the application is running. LE/370 preserves the language semantics for C and COBOL regardless of the XUFLOW setting. LE/370 preserves the language semantics for PL/I only when XUFLOW is set to AUTO or ON. LE/370 does not preserve the language semantics for PL/I when XUFLOW is set to OFF. An exponent underflow caused by a C or COBOL routine does not cause a condition to be raised. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌─AUTO─┐ │ │ >>──Xuflow──(──┼──────┼──)────────────────────────────────────────────────────────────────────>< │ │ ├─ON───┤ │ │ └─OFF──┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ AUTO An exponent underflow causes or does not cause a program interrupt dynamically, based upon the HLLs that make up the application. Enablement is determined without user intervention. ON An exponent underflow causes a program interrupt. OFF An exponent underflow does not cause a program interrupt; the hardware takes care of the underflow. Usage Notes  When you set XUFLOW to OFF, the hardware processes exponent underflows. This is more efficient than condition handling to process the underflow. However, the semantics of PL/I require the underflow to be signaled.  XUFLOW(ON) causes condition management to process underflows regardless of the mix of languages; therefore, this setting might be less efficient in applications that consist of languages not requiring underflows to be processed by condition management.  XUFLOW(AUTO) causes condition management to process underflows only in those applications where the semantics of the application languages require it. Normally, XUFLOW(AUTO) provides the best efficiency while meeting language semantics.  OpenEdition MVS consideration-The XUFLOW option applies to the entire enclave and all threads within. ═══ 3. LE/370 Callable Services ═══ This chapter describes how LE/370 callable services are invoked under LE/370-conforming HLLs. It also provides an overview of LE/370 callable services, which you can invoke from the following languages:  LE/370-conforming C/370  COBOL/370  PL/I MVS & VM  Assembler coded by using the CEEENTRY and associated macros This section contains the following callable services: ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ CEE3ABD-Terminate Enclave with an Abend │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3CIB-Return Pointer to Condition Information Block │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3CTY-Set Default Country │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3DMP-Generate Dump │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3GRC-Get the Enclave Return Code │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3GRN-Get Name of Routine that Incurred Condition │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3LNG-Set National Language │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3MCS-Get Default Currency Symbol │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3MDS-Get Default Decimal Separator │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3MTS-Get Default Thousands Separator │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3PRM-Query Parameter String │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3RPH-Set Report Heading │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3SPM-Query and Modify LE/370 Hardware Condition Enablement │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3SRC-Set the Enclave Return Code │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEE3USR-Set or Query User Area Fields │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEECBLDY-Convert Date to COBOL Lilian Format │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEECMI-Store and Load Message Insert Data │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEECRHP-Create New Additional Heap │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEECZST-Reallocate (Change Size of) Storage │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEDATE-Convert Lilian Date to Character Format │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEDATM-Convert Seconds to Character Timestamp │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEDAYS-Convert Date to Lilian Format │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEDCOD-Decompose a Condition Token │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEDSHP-Discard Heap │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEDYWK-Calculate Day of Week from Lilian Date │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEFMDA-Get Default Date Format │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEFMDT-Get Default Date and Time Format │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEFMTM-Get Default Time Format │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEFRST-Free Heap Storage │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEGMT-Get Current Greenwich Mean Time │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEGMTO-Get Offset from Greenwich Mean Time to Local Time │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEGPID-Retrieve the LE/370 Version and Platform ID │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEGQDT-Retrieve q_data_token │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEGTST-Get Heap Storage │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEHDLR-Register User-Written Condition Handler │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEHDLU-Unregister User-Written Condition Handler │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEISEC-Convert Integers to Seconds │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEITOK-Return Initial Condition Token │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEELOCT-Get Current Local Date or Time │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEMGET-Get a Message │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEMOUT-Dispatch a Message │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEMRCR-Move Resume Cursor │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEMSG-Get, Format, and Dispatch a Message │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEENCOD-Construct a Condition Token │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEEQCEN-Query the Century Window │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEERAN0-Calculate Uniform Random Numbers │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEESCEN-Set the Century Window │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEESECI-Convert Seconds to Integers │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEESECS-Convert Timestamp to Number of Seconds │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEESGL-Signal a Condition │ ├──────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CEETEST-Invoke Debug Tool │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ CEEUTC-Get Coordinated Universal Time │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ This chapter contains the following sections to help you use the LE/370 callable services:  Invoking Callable Services  Data Type Definitions  Callable Services For a list of all the LE/370 callable services, see LE/370 Quick Reference Tables. ═══ 3.1. Invoking Callable Services ═══ You can invoke LE/370 callable services from assembler routines, HLL-generated object code, HLL library routines, other LE/370 library routines, and user-written HLL calls. User-written HLL calls and functions access LE/370 library routines by using the same mechanisms that HLLs currently use to support calls in general. LE/370 callable services provide functions that your LE/370-conforming language might not provide. You can use these services alone or with LE/370 run-time options, which customize your run-time environment. This section provides syntax and examples to help you request callable services from C/370, COBOL/370, and PL/I. ═══ 3.1.1. Imbedding Header, Copy, or Include Files ═══ Many of the programming examples in this chapter imbed header, copy, or include files. (Whether you call the files header files, copy files, or include files depends on the language you are using.) These files can save you time by providing declarations for symbolic feedback codes and LE/370 callable services that you would otherwise need to code in your program. They can also help you reduce errors by verifying correct usage of LE/370 callable services at compile time. The names and descriptions of the files imbedded in the callable service examples in this chapter are provided in Files Used in C/370, COBOL/370, and PL/I Examples. ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 10. Files Used in C/370, COBOL/370, and PL/I Examples │ ├─────────────┬────────────────────────────────────────────────────────────────────────────────────┤ │ FILE NAME │ DESCRIPTION │ ├─────────────┼────────────────────────────────────────────────────────────────────────────────────┤ │ CEEEDCCT │ C declarations for symbolic LE/370 feedback codes │ ├─────────────┼────────────────────────────────────────────────────────────────────────────────────┤ │ CEEIBMAW │ LE/370 callable service declarations for routines written in PL/I │ ├─────────────┼────────────────────────────────────────────────────────────────────────────────────┤ │ CEEIBMCI │ PL/I declarations for condition information block │ ├─────────────┼────────────────────────────────────────────────────────────────────────────────────┤ │ CEEIBMCT │ PL/I declarations for symbolic LE/370 feedback codes │ ├─────────────┼────────────────────────────────────────────────────────────────────────────────────┤ │ CEEIGZCI │ COBOL declarations for condition information block │ ├─────────────┼────────────────────────────────────────────────────────────────────────────────────┤ │ CEEIGZCT │ COBOL declarations for symbolic LE/370 feedback codes │ ├─────────────┼────────────────────────────────────────────────────────────────────────────────────┤ │ leawi │ Declarations of LE/370 callable services and OMIT_FC, which is used to explicitly │ │ │ omit the fc parm, for routines written in C │ ├─────────────┴────────────────────────────────────────────────────────────────────────────────────┤ │ NOTES: │ │ │ │ o A symbolic feedback code is a symbolic representation of a condition token. │ │ o PL/I routines that imbed CEEIBMAW require the MACRO compiler option. │ │ o The COBOL language does not require declarations of external programs; therefore, it not │ │ necessary for LE/370 to provide callable service declarations for routines written in COBOL. │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ All the files, except for leawi, are provided with LE/370: In MVS, they are contained in the SCEESAMP partitioned data set. In VM, they are on the LE/370 product disk. The header file leawi is provided with C/370: In MVS, it is contained in the SEDCDHDR partitioned data set. In VM, it is on the C/370 product disk. You can imbed these files using the statement appropriate for the language your routine is written in, as shown in Imbedding Files in Your Routines: ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 11. Imbedding Files in Your Routines │ ├─────────────────────────────────────────────────┬────────────────────────────────────────────────┤ │ TO IMBED A FILE IN A... │ USE... │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ C routine │ an "#include" statement │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ COBOL routine │ a "COPY" statement │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ PL/I routine │ an "%include" statement │ └─────────────────────────────────────────────────┴────────────────────────────────────────────────┘ Examples of these statements are shown in the following sections on syntax. ═══ 3.1.2. C/370 Syntax ═══ In C/370, use the following syntax to invoke an LE/370 callable service with a feedback code in effect: ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──ceeserv──(parm1, parm2, ...parmn, fc);────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ Note: '...' is "and so on," not the C ellipsis operator. Use the following syntax to invoke callable services with an omitted feedback code parameter: ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──ceeserv──(parm1, parm2, ...parmn, OMIT_FC);───────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ See Parameter List for Invoking Callable Services for a description of this syntax. You must invoke LE/370 callable services as procedures; you cannot invoke any callable service as a function. LE/370 callable services do not return values because they have the return type of void. Input strings for callable services are not NULL terminated in C/370. You can use the SEDCDHDR file leawi.h to declare LE/370 callable services, in conjunction with a C call to an LE/370 callable service, as shown below: Sample Callable Services Invocation Syntax for C/370 Users #include int main(void) { ceeserv(parm1, parm2, ... parmn, fc); } ═══ 3.1.3. COBOL/370 Syntax ═══ In COBOL/370, use the following syntax to invoke LE/370 callable services: ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CALL "ceeserv" USING── parm1, parm2, ...parmn, fc─────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ You can call LE/370 services either statically or dynamically from COBOL/370 applications. See Parameter List for Invoking Callable Services for a description of this syntax. You can use the SCEESAMP file CEEIGZCT to declare symbolic LE/370 feedback codes, in conjunction with a COBOL call to an LE/370 callable service to return a feedback code, as shown below: Sample Callable Services Invocation Syntax for COBOL/370 Users COPY CEEIGZCT CALL "ceeserv" USING parm1, parm2, ... parmn, fc ═══ 3.1.4. PL/I Syntax ═══ In PL/I, use the following syntax to invoke an LE/370 callable service with a feedback code in effect: ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CALL ceeserv──(parm1, parm2, ...parmn, fc);───────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ PL/I also allows you to omit arguments. In place of the argument, code an asterisk (*), as shown below: ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CALL ceeserv──(parm1, parm2, ...parmn, *);────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ Note that you cannot invoke callable services as function references. See Parameter List for Invoking Callable Services for a description of this syntax. The value of register 15 upon return from any LE/370 callable service is undefined. Use of OPTIONS(RETCODE) is not recommended, because a subsequent use of the PLIRETV built-in function returns an undefined value. If you code your own declarations for the LE/370 callable services, be sure to specify all required arguments in the CALL statement. An Invalid Call that Omits the fc Parameter illustrates a call in which the feedback code to CEEDATE has been incorrectly omitted. You can use the SCEESAMP file CEEIBMAW to declare LE/370 callable services, in conjunction with a PL/I call to an LE/370 callable service, as shown below: Sample Callable Services Invocation Syntax for PL/I Users %INCLUDE CEEIBMAW; . . . CALL ceeserv(parm1, parm2, ... parmn, fc); ═══ 3.1.5. Parameter List for Invoking Callable Services ═══ This section describes the syntax and parameters you need to invoke LE/370 callable services. ceeserv The name of the callable service. By including a reference to a header file in your code, you can avoid declaring each callable service as an external entry. See Imbedding Header, Copy, or Include Files for these file names. parm1 parm2 ... parmn Optional or required parameters passed to or returned from the called service. Some callable service parameters are optional, but for C/370 and PL/I users only. If you do not want to pass the parm or you do not want the return value, you can omit a parm. fc A feedback code that indicates the result of the service. fc can be omitted when you use C/370 and PL/I. COBOL does not allow omitted parameters. If you specify fc as an argument, feedback information in the form of a condition token is returned to the calling routine. The condition token indicates whether the service completed successfully or whether a condition was encountered while the service was running. In LE/370 you can decode the condition token so that it can be acted on. If you omit fc as an argument, the condition is signaled if the service was not successful. Because callable services call other services, these other services might generate feedback codes. General Usage Notes for Callable Services  You can invoke callable services from any LE/370-conforming HLL except where otherwise noted.  You might receive feedback codes from services other than the one you are invoking. This is because the callable services invoke other callable services that might return a feedback code.  Callable services that are intended to be available on any platform that LE/370 supports are prefixed with CEE. Callable services defined only for S/370 are prefixed with CEE3.  Routines that invoke callable services do not need to be AMODE(31). AMODE switching is performed implicitly without any action required by the calling routine, if you specify the ALL31(OFF) run-time option (see ALL31). However, if AMODE switching occurs and your program makes many calls to LE/370 callable services, the switching time can slow down your application. Run with AMODE(31), if possible, to avoid unnecessary mode switching.  Under LE/370, all parms are passed by reference, indirectly. The code in An Invalid Call that Omits the fc Parameter might cause unpredictable results: An Invalid Call that Omits the fc Parameter DCL CEEDATE ENTRY OPTIONS(ASM); CALL CEEDATE(x,y,z); /* invalid */ Valid Calls that Use the Optional fc Parameter illustrates valid calls: Valid Calls that Use the Optional fc Parameter DCL CEEDATE ENTRY(*,*,*,* OPTIONAL) OPTIONS(ASM); CALL CEEDATE(x,y,z,*); /* valid */ CALL CEEDATE(x,y,z,fc); /* valid */ ═══ 3.2. Data Type Definitions ═══ Parameters in LE/370 are defined as specific data types, such as:  Fullword binary integer  Short floating-point hexadecimal  Long floating-point hexadecimal  Fixed-length character string with a predefined length  Entry variable  Character string with a halfword prefix indicating its current length The table below includes data type definitions and their descriptions for COBOL/370: ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 12. Data Type Definitions for COBOL/370 │ ├────────────┬─────────────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────────┤ │ DATA TYPE │ DESCRIPTION │ COBOL/370 │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ INT2 │ A 2-byte signed integer │ PIC S9(4) USAGE IS BINARY │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ INT4 │ A 4-byte signed integer │ PIC S9(9) USAGE IS BINARY │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ FLOAT4 │ A 4-byte single-precision floating- │ COMP-1 │ │ │ point number │ │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ FLOAT8 │ An 8-byte double-precision │ COMP-2 │ │ │ floating-point number │ │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ FLOAT16 │ A 16-byte extended-precision │ Not available │ │ │ floating-point number │ │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ COMPLEX8 │ Short floating-point complex hex │ Not available │ │ │ number: an 8-byte complex number, │ │ │ │ whose real and imaginary parts are │ │ │ │ each 4-byte single-precision │ │ │ │ floating-point numbers. │ │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ COMPLEX16 │ Long floating-point complex hex │ Not available │ │ │ number: a 16-byte complex number, │ │ │ │ whose real and imaginary parts are │ │ │ │ each 8-byte double-precision │ │ │ │ floating-point numbers. │ │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ COMPLEX32 │ Extended floating-point hex number: │ Not available │ │ │ a 32-byte complex number, whose │ │ │ │ real and imaginary parts are each │ │ │ │ 16-byte extended-precision │ │ │ │ floating-point numbers. │ │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ POINTER │ A platform-dependent address │ USAGE IS POINTER │ │ │ pointer │ │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ CHARn │ A string (character array) of │ PIC X(n) │ │ │ length n │ │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ VSTRING │ A length-prefixed string (for │ 01 STRING_IN │ │ │ input); fixed-length 80 for output │ 02 LEN PIC S9(4) USAGE IS BINARY │ │ │ parameters. │ 02 TXT PIC X(N) │ │ │ │ 01 STRING_OUT PIC X(80) │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ FEED_BACK │ A mapping of the condition token │ Case 1: │ │ │ (fc) │ 01 FC │ │ │ │ 02 SEV PIC S9(4) USAGE IS BINARY │ │ │ │ 02 MSGNO PIC S9(4) USAGE IS BINARY │ │ │ │ 02 FLGS PIC X(1) │ │ │ │ 02 FACID PIC X(3) │ │ │ │ 02 ISI PIC X(4) │ │ │ │ Case 2: │ │ │ │ 01 FC │ │ │ │ 02 CLASS_CODE PIC X(2) │ │ │ │ 02 CAUSE_CODE PIC X(2) │ │ │ │ 02 FLGS PIC X(1) │ │ │ │ 02 FACID PIC X(3) │ │ │ │ 02 ISI PIC X(4) │ ├────────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤ │ CEE_ENTRY │ An HLL-dependent entry constant │ PROCEDURE_POINTER │ └────────────┴─────────────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────────┘ The table below includes data type definitions and their descriptions for C/370: ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 13. Data Type Definitions for C/370 │ ├────────────┬─────────────────────────────────────────────────┬───────────────────────────────────────────────────────────────────────────┤ │ DATA TYPE │ DESCRIPTION │ C/370 │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ INT2 │ A 2-byte signed integer │ signed short │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ INT4 │ A 4-byte signed integer │ signed int │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ FLOAT4 │ A 4-byte single-precision floating-point number │ float │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ FLOAT8 │ An 8-byte double-precision floating-point │ double │ │ │ number │ │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ FLOAT16 │ A 16-byte extended-precision floating-point │ long double │ │ │ number │ │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ COMPLEX8 │ Short floating-point complex hex number: an │ Not available │ │ │ 8-byte complex number, whose real and imaginary │ │ │ │ parts are each 4-byte single-precision │ │ │ │ floating-point numbers. │ │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ COMPLEX16 │ Long floating-point complex hex number: a │ Not available │ │ │ 16-byte complex number, whose real and imagi- │ │ │ │ nary parts are each 8-byte double-precision │ │ │ │ floating-point numbers. │ │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ COMPLEX32 │ Extended floating-point hex number: a 32-byte │ Not available │ │ │ complex number, whose real and imaginary parts │ │ │ │ are each 16-byte extended-precision floating- │ │ │ │ point numbers. │ │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ POINTER │ A platform-dependent address pointer │ void * │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ CHARn │ A string (character array) of length n │ char[n] │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ VSTRING │ A length-prefixed string (for input); fixed- │ struct _VSTRING( │ │ │ length 80 for output parameters. │ _INT2 length; │ │ │ │ char string[1]; │ │ │ │ }string-in; │ │ │ │ char string-out[80]; │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ FEED_BACK │ A mapping of the condition token (fc) │ Case 1: │ │ │ │ typedef struct { │ │ │ │ short tok_sev ; │ │ │ │ short tok_msgno ; │ │ │ │ int tok_case :2, │ │ │ │ tok_sever:3, │ │ │ │ tok_ctrl :3 ; │ │ │ │ char tok_facid[3]; │ │ │ │ int tok_isi ; │ │ │ │ } _FEEDBACK ; │ │ │ │ Case 2: │ │ │ │ typedef struct { │ │ │ │ short tok_sev ; │ │ │ │ short tok_msgno ; │ │ │ │ int tok_class_code :2, │ │ │ │ tok_cause_code:3, │ │ │ │ tok_ctrl :3 ; │ │ │ │ char tok_facid[3]; │ │ │ │ int tok_isi ; │ │ │ │ } _FEEDBACK ; │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ CEE_ENTRY │ An HLL-dependent entry constant │ FUNCTION POINTER │ └────────────┴─────────────────────────────────────────────────┴───────────────────────────────────────────────────────────────────────────┘ The table below includes data type definitions and their descriptions for PL/I: ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 14. Data Type Definitions for PL/I │ ├────────────┬─────────────────────────────────────────────────┬───────────────────────────────────────────────────────────────────────────┤ │ DATA TYPE │ DESCRIPTION │ PL/I │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ INT2 │ A 2-byte signed integer │ REAL FIXED BINARY (15,0) │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ INT4 │ A 4-byte signed integer │ REAL FIXED BINARY (31,0) │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ FLOAT4 │ A 4-byte single-precision floating-point number │ REAL FLOAT BINARY (21) or REAL FLOAT DECIMAL (6) │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ FLOAT8 │ An 8-byte double-precision floating-point │ REAL FLOAT BINARY (53) or REAL FLOAT DECIMAL (16) │ │ │ number │ │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ FLOAT16 │ A 16-byte extended-precision floating-point │ REAL FLOAT DECIMAL (33) or REAL FLOAT BINARY (109) │ │ │ number │ │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ COMPLEX8 │ Short floating-point complex hex number: an │ COMPLEX FLOAT DECIMAL(6) │ │ │ 8-byte complex number, whose real and imaginary │ │ │ │ parts are each 4-byte single-precision │ │ │ │ floating-point numbers. │ │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ COMPLEX16 │ Long floating-point complex hex number: a │ COMPLEX FLOAT DECIMAL(16) │ │ │ 16-byte complex number, whose real and imagi- │ │ │ │ nary parts are each 8-byte double-precision │ │ │ │ floating-point numbers. │ │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ COMPLEX32 │ Extended floating-point hex number: a 32-byte │ COMPLEX FLOAT DECIMAL (33) │ │ │ complex number, whose real and imaginary parts │ │ │ │ are each 16-byte extended-precision floating- │ │ │ │ point numbers. │ │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ POINTER │ A platform-dependent address pointer │ POINTER │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ CHARn │ A string (character array) of length n │ CHAR(n) │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ VSTRING │ A length-prefixed string (for input); fixed- │ DCL string_in CHAR(n) VARYING; │ │ │ length 80 for output parameters. │ DCL string_out CHAR(80); │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ FEED_BACK │ A mapping of the condition token (fc) │ Case 1: │ │ │ │ DCL 1 FEEDBACK BASED, │ │ │ │ 3 SEVERITY FIXED BINARY (15), │ │ │ │ 3 MSGNO FIXED BINARY (15), │ │ │ │ 3 FLAGS, │ │ │ │ 5 CASE BIT (2), │ │ │ │ 5 SEVERITY BIT (3), │ │ │ │ 5 CONTROL BIT (3), │ │ │ │ 3 FACID CHAR (3), │ │ │ │ 3 ISI FIXED BINARY (31); │ │ │ │ Case 2: │ │ │ │ DCL 1 FEEDBACK BASED, │ │ │ │ 3 CLASS_CODE FIXED BINARY (15), │ │ │ │ 3 CAUSE_CODE FIXED BINARY (15), │ │ │ │ 3 FLAGS, │ │ │ │ 5 CASE BIT (2), │ │ │ │ 5 SEVERITY BIT (3), │ │ │ │ 5 CONTROL BIT (3), │ │ │ │ 3 FACID CHAR (3), │ │ │ │ 3 ISI FIXED BINARY (31); │ ├────────────┼─────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤ │ CEE_ENTRY │ An HLL-dependent entry constant │ ENTRY │ └────────────┴─────────────────────────────────────────────────┴───────────────────────────────────────────────────────────────────────────┘ ═══ 3.3. Callable Services ═══ Following are the LE/370 callable services and examples of how to use them in C/370, COBOL/370, and PL/I. ═══ 3.3.1. CEE3ABD-Terminate Enclave with an Abend ═══ CEE3ABD requests that LE/370 terminate the enclave with an abend. The issuing of the abend can be either with or without clean-up. There is no return from this service, nor is there any condition associated with it. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3ABD──(──abcode──,──clean-up──)────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ abcode A fullword integer, no greater than 4095, specifying the abend code that is issued. When executing under CICS, this fullword integer is converted to the equivalent EBCDIC and then issued. clean-up Indicates whether the abend should result in clean-up of the enclave's resources. The acceptable values for clean-up are as follows: Value Meaning 0 Issue the abend without clean-up 1 Issue the abend with normal enclave termination processing. If an illegal value for clean-up is passed, the abend is issued without clean-up. If clean-up is 0, no LE/370 dump is generated. A system dump, however, is requested when issuing the abend. Under CICS, a transaction dump is taken. To obtain a dump under CMS, specify FILEDEF SYSABEND PRINTER or FILEDEF SYSUDUMP PRINTER. If clean-up is 0, LE/370 condition handling is disabled for the current enclave and termination activities are not performed. Event handlers are not driven; CODE/370 is not invoked; user exits are not invoked; and user condition handlers are not invoked. When clean-up is 1, the abend is processed in the same manner as if it were a non-LE/370 abend. Its processing is affected by the ABPERC and TRAP options, the filedef abends percolated in the assembler user exit, and other elements of the environment related to abend processing. In particular, the condition handler can intercept the abend and give the application a chance to handle the abend. If the condition remains unhandled, normal termination activities are performed: information such as an LE/370 dump is produced, depending on the setting of the TERMTHDACT option; event handlers are driven; Debug Tool/370 is invoked; and user exits are invoked. Assembler user exit settings control whether the application actually terminates with an abend. Usage Note  OpenEdition MVS consideration-CEE3ABD applies to the enclave. Examples  C/370 Example /*COMPILATION UNIT: EDC3ABD */ #include int main(void) { _INT4 code, timing; code = 0xdead; /* HEX value DEAD, see in R1 */ timing = 0; CEE3ABD(CODE/370,&timing); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3ABD ********************************************** ** Function: CEE3ABD - terminate ** ** enclave with an abend ** ********************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBL3ABD. DATA DIVISION. WORKING-STORAGE SECTION. 01 ABDCODE PIC S9(9) COMP. 01 TIMING PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLMGET. ** 3415 is the abend code to be issued, ** ** a timing of zero requests an abend ** ** without clean-up ** MOVE 3415 TO ABDCODE. MOVE 0 TO TIMING. CALL 'CEE3ABD' USING ABDCODE , TIMING. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBM3ABD /****************************************************/ /** */ /** Function: CEE3ABD - terminate enclave with an */ /** abend */ /** */ /** In this example, CEE3ABD is called with a */ /** timing value of 1. This requests an abend that */ /** is deferred until clean-up takes place. */ /** */ /****************************************************/ PLI3ABD: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL ABDCODE INT4; DCL TIMING INT4; ABDCODE = 3333; /* Choose code to abend with */ TIMING = 1; /* Specify 1, for an abend with */ /* clean-up */ /* Call CEE3ABD to request an abend 3333 with */ /* clean-up */ CALL CEE3ABD ( ABDCODE, TIMING ); END PLI3ABD; ═══ 3.3.2. CEE3CIB-Return Pointer to Condition Information Block ═══ CEE3CIB returns a pointer to a condition information block (CIB) associated with a given condition token. Use this service only during condition handling. For PL/I, and COBOL/370 applications, LE/370 provides macros (in SCEESAMP) that map to the CIB. For C/370 applications, the macros are in leawi.h. The CIB contains detailed information about the condition. Providing access to the CIB allows your application's condition handlers to make more informed decisions about the response to a condition. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3CIB──(──┬────────────┬──,──cib_ptr──,──fc──)──────────────────────────────────────────>< │ │ └─cond_token─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ cond_token The condition token passed to a user handler. If you do not specify this parameter, LE/370 returns the address of the most recently-raised condition. cib_ptr The address of the CIB associated with the condition token. fc A 12-byte feedback code, optional in some languages, that indicates the results of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE35S │ 1 │ 3260 │ No condition was active when a call to a con- │ │ │ │ │ dition management routine was made. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE35U │ 1 │ 3262 │ An invalid condition token was passed. The │ │ │ │ │ condition token does not represent an active │ │ │ │ │ condition. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  Because the CIB is used only for synchronous signals, you should not use CEE3CIB in signal catchers that are driven for asynchronous signals.  After the condition handling functions return control to your application, cib_ptr is no longer valid  OpenEdition MVS consideration-In multithread applications, CEE3CIB returns the CIB associated with the current token on only the current thread. Examples  C/370 Example /*COMPILATION UNIT: EDC3CIB */ #include #include #include void handler(_FEEDBACK *,_INT4 *,_INT4 *,_FEEDBACK *); int main(void) { _FEEDBACK fc; _ENTRY routine; _INT4 token; int x,y,z; /* set the routine structure to point to the handler */ /* and use CEEHDLR to register the user handler */ token = 99; routine.address = (_POINTER)&handler; routine.nesting = NULL; CEEHDLR(&routine,&token,&fc); /* verify that CEEHDLR was successful */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEHDLR failed with message number %d\n", fc.tok_msgno); exit(2999); } x = 5; y = 0; z = x / y; } /*******************************************************/ /* handler is a user condition handler */ /*******************************************************/ void handler(_FEEDBACK *fc, _INT4 *token, _INT4 *result, _FEEDBACK *newfc) { _CEECIB *cib_ptr; _FEEDBACK cibfc; CEE3CIB(fc, &cib_ptr, &cibfc); /* verify that CEE3CIB was successful */ if ( _FBCHECK ( cibfc , CEE000 ) != 0 ) { printf("CEE3CIB failed with message number %d\n", cibfc.tok_msgno); exit(2999); } printf("%s \n",(*cib_ptr).cib_eye); printf("%d \n",cib_ptr->cib_cond.tok_msgno); printf("%s \n",cib_ptr->cib_cond.tok_facid); *result = 10; }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3CIB ******************************************* ** ** Function: CEE3CIB - Return Pointer to ** Condition Information Block ** ******************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBL3CIB. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 TOKEN PIC S9(9) COMP. 01 FC PIC X(12). PROCEDURE DIVISION. PARA-CBL3CIB. SET ROUTINE TO ENTRY 'HANDLER'. CALL 'CEEHDLR' USING ROUTINE , TOKEN , FC. GOBACK. CBL LIB *COMPILATION UNIT: HANDLER IDENTIFICATION DIVISION. PROGRAM-ID. HANDLER. DATA DIVISION. WORKING-STORAGE SECTION. 01 CIB-PTR POINTER. 01 FC PIC S9(9) COMP. LINKAGE SECTION. 01 CURCOND PIC X(12). 01 TOKEN PIC S9(9) COMP. 01 RESULT PIC S9(9) COMP. 01 NEWCOND PIC X(12). PROCEDURE DIVISION USING CURCOND, TOKEN, RESULT, NEWCOND. PARA-HANDLER. CALL 'CEE3CIB' USING CURCOND CIB-PTR FC. SET ADDRESS OF CEECIB TO CIB-PTR. DISPLAY 'In Handler'. DISPLAY CIB-EYE. DISPLAY CIB-TOK-MSGNO. DISPLAY CIB-TOK-FACID. GOBACK.  PL/I Example *PROCESS OPT(0), MACRO; /*COMPILATION UNIT: IBM3CIB /********************************************/ /** **/ /** Function: CEE3CIB - example of CEE3CIB **/ /** invoked from PL/I **/ /** ON-unit **/ /** **/ /********************************************/ IBM3CIB: PROCEDURE OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; %INCLUDE CEEIBMCI; DECLARE CIB_PTR POINTER, 01 FC FEEDBACK, divisor FIXED BINARY(31) INITIAL(0); ON ZERODIVIDE BEGIN; CALL CEE3CIB(*, CIB_PTR, FC); IF FBCHECK( FC, CEE000 ) THEN DO; PUT SKIP LIST('Found ' || CIB_PTR->CIB_EYE || ' for message #' || CIB_PTR->CIB_TOK_MSGNO || ' from ' || CIB_PTR->CIB_TOK_FACID ); END; ELSE DO; DISPLAY( 'CEE3CIB failed with msg ' || FC.MsgNo ); END; END /* ON ZeroDivide */; divisor = 15 / divisor /* signals ZERODIVIDE */; END IBM3CIB; ═══ 3.3.3. CEE3CTY-Set Default Country ═══ CEE3CTY sets the default country. A calling routine can change or query the current national country setting. The country setting affects the date format, the time format, the currency symbol, the decimal separator, and the thousands separator. CEE3CTY also affects the default symbols for the national language support and date and time callable services. For a list of the default settings for a specified country, see Defaults Currency and Picture Strings Based on COUNTRY Setting. If you need to override your default country setting, you can do so with CEE3CTY. For example, if you live in the United States, the code for the United States is specified as the default at installation. If in a certain application you want to use the French defaults, however, you could use CEE3CTY to SET France as the national country setting. Then when you again wanted the defaults for the United States, you would PUSH the code for United States back to the top of the stack. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3CTY──(──function──,──country_code──,──fc──)───────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ function (input) A fullword binary integer specifying the service to be performed. The possible values for function are: 1-SET Establishes the country_code parameter as the current country. The top of the stack is, in effect, replaced with country_code. 2-QUERY Returns the current country code on the top of the stack to the calling routine. The current code is returned in the country_code parameter. 3-PUSH Pushes the country_code parameter onto the top of the country code stack, making it the current country code. Previous country codes on the stack are retained on a LIFO basis, which makes it possible to return to a prior country code at a later time. 4-POP Pops the current country code. The last country code that was PUSHed now becomes the current country_code. On return to the calling routine, the country_code parameter contains the discarded country code. If the stack contains only one country code, the code cannot be POPped because the stack would be empty after the call. Therefore, no action is taken and a feedback code indicating such is returned to the calling routine. country_code (input/output) A 2-character fixed-length string. country_code is not case-sensitive. It is used in the following ways for the different functions: ┌───────────────────┬──────────────────────────────────────────────────────────────────────────────┐ │ If function is │ then country_code: │ │ specified as: │ │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 1 or 3 │ Contains the desired 2-character country code. In this case, it is an input │ │ │ parameter. Defaults Currency and Picture Strings Based on COUNTRY Setting │ │ │ contains a list of valid country codes. │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 2 │ Returns the current 2-character country code on top of the stack. In this │ │ │ case, it is an output parameter. │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 4 │ Returns the discarded 2-character country code. In this case, it is an │ │ │ output parameter. │ └───────────────────┴──────────────────────────────────────────────────────────────────────────────┘ fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ LE FEEDBACK │ │ │ │ │ CODE (FC) │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3BV │ 2 │ 3455 │ Only one country code was on the stack when a │ │ │ │ │ POP request was made to CEE3CTY. The current │ │ │ │ │ country code was returned in the country code │ │ │ │ │ parameter. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3C0 │ 3 │ 3456 │ The country code country-code for the PUSH or │ │ │ │ │ SET function for CEE3CTY was invalid. No │ │ │ │ │ operation was performed. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3C1 │ 3 │ 3457 │ The function function specified for CEE3CTY │ │ │ │ │ was not recognized. No operation was per- │ │ │ │ │ formed. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  The bytes X'0E' and X'0F' representing shift-out and shift-in codes are not affected by any country_code setting.  The current national country setting affects the format of the date and time in the reports generated by the RPTOPTS and RPTSTG run-time options. For more information on these run-time options, see RPTOPTS and RPTSTG.  C/370 considerations-C/370 provides locales that map to German, Spanish, French, U.S. English, and other languages. They establish default formats for items such as currency symbols, and names of the days of the week. To change the locale, you can use the setlocale() library function. The settings of setlocale() and the CEE3CTY run-time option do not affect one another. CEE3CTY affects only LE/370 services; setlocale() affects only C/370 functions. To ensure that everything is set properly for your country, use both CEE3CTY and setlocale().  OpenEdition MVS considerations-CEE3CTY applies to the enclave. Every thread in the enclave has the same country setting. Examples  C/370 Example /*COMPILATION UNIT: EDC3CTY */ #include #include #include #include int main(void) { _FEEDBACK fc; _INT4 function; _CHAR2 country; /* query the current country setting */ function = 2; /* function 2 is query */ CEE3CTY(&function,country,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3CTY failed with message number %d\n", fc.tok_msgno); exit(2999); } /* if the current country is not Canada then set */ /* it to Canada */ if (memcmp(country,"CA",2) != 0) { memcpy(country,"CA",2); function = 1; /* function 1 is set */ CEE3CTY(&function,country,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3CTY failed with message number %d\n", fc.tok_msgno); exit(2999); } } }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3CTY ************************************************ ** ** ** Function: CEE3CTY - set default country ** ** ** ************************************************ IDENTIFICATION DIVISION. PROGRAM-ID. CBL3CTY. DATA DIVISION. WORKING-STORAGE SECTION. 01 FUNCTN PIC S9(9) COMP. 01 COUNTRY PIC X(2). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-3CTYQRY. ** Call CEE3CTY with the QUERY function, ** and display current country code. MOVE 2 TO FUNCTN. CALL 'CEE3CTY' USING FUNCTN , COUNTRY , FC. IF CEE000 of FC THEN DISPLAY 'THE CURRENT COUNTRY CODE IS ' COUNTRY ELSE DISPLAY 'CEE3CTY(query) failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. PARA-3CTYSET. ** If the current country code is not the US, call ** CEE3CTY with the SET function to make it ** the US. display result. IF ( COUNTRY IS NOT = 'US' ) THEN MOVE 1 TO FUNCTN; MOVE 'US' TO COUNTRY; CALL 'CEE3CTY' USING FUNCTN , COUNTRY , FC; IF CEE000 of FC THEN DISPLAY 'THE NEW COUNTRY CODE IS ', COUNTRY; ELSE DISPLAY 'CEE3CTY(set) failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBM3CTY */ /**************************************************/ /** */ /** Function: CEE3CTY - set current country */ /** */ /** In this example, a call is made to the query */ /** function of CEE3CTY to return the current */ /** default country setting. This is then */ /** printed out. If the current country code is */ /** not 'US', then it is set to 'US' and printed. */ /** */ /**************************************************/ PLI3CTY: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL FUNCTN INT4; DCL COUNTRY CHARACTER ( 2 ); DCL 01 FC FEEDBACK; FUNCTN = 2; /* Specify 2 for the query function */ /* Call CEE3CTY with the query function to */ /* return the current country setting */ CALL CEE3CTY ( FUNCTN, COUNTRY, FC ); /* If CEE3CTY ran successfully, print the */ /* current country */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The current country code is "' || COUNTRY || '".' ); END; ELSE DO; DISPLAY( 'CEE3CTY failed with msg ' || FC.MsgNo ); STOP; END; /* If the current default country is not the US, */ /* set it to the US */ IF COUNTRY к= 'US' THEN DO; FUNCTN = 1; /* Specify 1 for the set function */ COUNTRY = 'US'; /* Specify country code for US*/ CALL CEE3CTY ( FUNCTN, COUNTRY, FC ); /* If CEE3CTY ran successfully print the */ /* current country */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The new country code is "' || COUNTRY || '".' ); END; ELSE DO; DISPLAY( 'CEE3CTY failed with msg ' || FC.MsgNo ); STOP; END; END; END PLI3CTY; ═══ 3.3.4. CEE3DMP-Generate Dump ═══ CEE3DMP generates a dump of LE/370 and the member language libraries. Sections of the dump are selectively included, depending on options specified with the options parameter. Output from CEE3DMP is written to the default ddname CEEDUMP, unless you specify the ddname of another file by using the FNAME option of CEE3DMP. (See the CEE3DMP OpenEdition MVS usage note for more information about the dump output filename.) Dumps are written only in mixed-case U.S. English. If longer than 60 characters, the dump title is truncated to 60 characters in order to match the record size of the dump file. Only nested enclaves within a single process are supported. CEE3DMP establishes a condition handler that captures all conditions that occur during dump processing. It terminates the section of the dump in progress when a condition occurs and inserts the following line into the dump: Exception occurred during dump processing at nnnnnnnn nnnnnnnn is the instruction address at the time of the exception. After this line is inserted in the report, dump processing continues for other member languages until CEE3DMP is complete. If an abend occurs, or if any other condition occurs or is signaled, the condition manager attempts to handle it. If the condition remains unhandled, and it is of sufficient severity, the condition manager might (based on the TERMTHDACT option) invoke dump services and then terminate the program. You do not have to call CEE3DMP to use the dump services. Any routine can use them. To support this case, dump services are invoked as follows:  The title is 'Condition processing resulted in the unhandled condition' to indicate why the dump was produced.  The dump options are 'TRACE COND THR(ALL) BLOCKS STOR NOENTRY' for dump output and 'TRACE COND THR(ALL) NOBLOCK NOSTOR NOENTRY' for trace output. Reprinting of section title and control block name at the top of each page is suppressed. Only the main title 'CEE3DMP: ...' is reprinted. The IBM-supplied default settings for the CEE3DMP options are: TRACEBACK THREAD(CURRENT) FILES VARIABLES NOBLOCKS NOSTORAGE STACKFRAME(ALL) PAGESIZE(60) FNAME(CEEDUMP) CONDITION ENTRY ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3DMP──(──title──,──options──,──fc──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ title (input) An 80-byte fixed-length character string containing a title printed at the top of each page of the dump. options A 255-byte fixed-length character string enclosed in single quotes containing options describing the type, format, and destination of dump information. Options are declared as a string of keywords separated by blanks or commas. Some options have suboptions that follow the option keyword and are contained in parentheses. The options can be specified in any order, but the last option declaration is honored if there is a conflict between it and any preceding options. The following options are recognized by LE/370: ENCLave(ALL | CURrent | n) Dumps the current enclave, a fixed number of enclaves, or all enclaves associated with the current process. n is an integer ranging from 1 to 2**31-1, inclusive, that indicates the maximum number of enclaves that should be dumped. ENCLAVE(CURRENT) and ENCLAVE(1) are equivalent. THRead(ALL|CURrent) Dumps the current thread (the thread that invoked this service) or all threads associated with the current enclave. When you specify THREAD(ALL) and more than one thread is running, the library quiesces all threads before writing the dump. Therefore, the state of the library changes from the time the dump is requested to the time the dump is written. TRACEback Includes a traceback of all routines on the call chain. The traceback shows transfers of control from either calls or exceptions. The traceback extends backwards to the main program of the current thread. PL/I transfers of control into BEGIN-END blocks or ON-units are considered calls. NOTRACEback Does not include a traceback. FILEs Includes attributes of all open files and the buffer contents used by the files. The particular attributes displayed are defined by the member languages. File buffers are dumped when FILE and STORAGE are specified. File control blocks are dumped when FILE and BLOCKS are specified. NOFILEs Does not include file attributes of open files. VARiables Includes a symbolic dump of all variables, arguments, and registers. Variables include arrays and structures. Register values are those saved in the stack frame at the time of call. There is no way to print a subset of this information. Variables and arguments are printed only if the symbol tables are available. A symbol table is generated when a program is compiled with the options shown below for each HLL, except for PL/I, which does not support the VARIABLE option. Language Compile-Time Option C TEST(SYM) COBOL TEST or TEST(h,SYM) The variables, arguments, and registers are dumped, beginning with the routine that called CEE3DMP. The dump proceeds up the chain for the number of routines specified by the STACKFRAME option. See below for a description of the STACKFRAME option. NOVARiables Does not include a dump of variables, arguments, and registers. BLOCKs Dumps the control blocks used in LE/370 and member language libraries. Global control blocks, as well as control blocks associated with routines on the call chain, are printed. Control blocks are printed for the routine that called CEE3DMP. The dump proceeds up the call chain for the number of routines specified by the STACKFRAME option (see below). Control blocks for files are also dumped if the FILES option was specified. See the FILES option above for more information. If the TRACE run-time option is set to ON, the trace table is dumped when BLOCKS is specified. NOBLOCKs Suppresses the dump of control blocks. STORage Dumps the storage used by the program. The storage is displayed in hexadecimal and character format. Global storage, as well as storage associated with each routine on the call chain, is printed. Storage is dumped for the routine that called CEE3DMP, which proceeds up the call chain for the number of routines specified by the STACKFRAME option. Storage for all file buffers is also dumped if the FILES option was specified (see above). NOSTORage Suppresses storage dumps. StackFrame(n|ALL) Specifies the number of stack frames dumped from the call chain. If STACKFRAME(ALL) is specified, all stack frames are dumped. No stack frame storage is dumped if STACKFRAME(0) is specified. The particular information dumped for each stack frame depends on the VARIABLE, BLOCK, and STORAGE option declarations specified for CEE3DMP. The first stack frame dumped is the one associated with the routine that called CEE3DMP, followed by its caller, and proceeding backwards up the call chain. PAGEsize(n) Specifies the number of lines on each page of the dump. This value must be greater than 9. A value of 0 indicates that there should be no page breaks in the dump. The default setting is PAGESIZE(60). FNAME(ddname) Specifies the ddname of the file to which the dump report is written. The ddname supplied in this option must be a valid ddname for the system on which the application is running. CEE3DMP does not check the ddname for validity, nor does CEE3DMP translate or modify the ddname. Supplying an invalid ddname can result in unpredictable behavior. The default ddname CEEDUMP is used if this option is not specified. CONDition Specifies that for each active condition on the call chain, the following information is dumped from the CIB:  The address of the CIB.  The message associated with the current condition token.  The message associated with the original condition token, if different from the current one.  The location of the error.  The machine state at the time the condition manager was invoked, if an abend or hardware condition occurred.  The abend code and reason code, if the condition occurred as a result of an abend.  Language-specific error information. The information supplied by LE/370-conforming languages differs. PL/I supplies DATAFIELD, ONCHAR, ONCOUNT, ONFILE, ONKEY, and ONSOURCE values. These built-in function (BIF) values are shown in the context of the condition raised. This option does not apply to asynchronous signals. NOCONDition Does not dump condition information for active conditions on the call chain. ENTRY Includes in the dump a description of the routine that called CEE3DMP and the contents of the registers on entry to CEE3DMP. NOENTRY Does not include in the dump a description of the routine that called CEE3DMP and the contents of the registers on entry to CEE3DMP. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE30U │ 2 │ 3102 │ Unsupported or incompatible CEE3DMP options or │ │ │ │ │ suboptions were found and ignored. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE30V │ 3 │ 3103 │ An error occurred in writing messages to the │ │ │ │ │ dump file. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  CICS consideration-Only ENCLAVE(CURRENT) and ENCLAVE(1) are supported on CICS.  CMS considerations-All values for the ENCLAVE option are supported on CMS for nested enclaves created by the C/370 system() function. Only ENCLAVE(CURRENT) and ENCLAVE(1) are supported on CMS for nested enclaves created by SVC LINK, CMSCALL or PL/I FETCH and CALL of a fetchable main.  MVS consideration-On MVS, all values for the ENCLAVE option are supported.  OpenEdition MVS consideration-CEE3DMP applies to the enclave. When you call CEE3DMP in a multithread environment, the current thread or all threads might be dumped. Enclave- and process-related storage (along with storage related to threads other than the current thread) might have changed in value from the time the dump request was issued. If the CEEDUMP DD has a PATH= parameter, the dump is directed to the hierarchic file system (HFS) file specified. If your application is running under OpenEdition MVS and is either running in an address space created by using the fork() function or is invoked by one of the exec family of functions, the dump is written to the HFS. LE/370 writes the dump to a file in your current working directory, unless that directory is the root directory, in which case the dump is written to a file in the directory /tmp.. The name of this file changes with each dump and uses the following format: /path/Fname.Date.Time.Pid path The current working directory Fname The name specified in the FNAME parameter on the call to CEE3DMP (default is CEEDUMP) Date The date the dump is taken, appearing in the format YYYYMMDD (such as 19940325 for March 25, 1994) Time The time the dump is taken, appearing in the format HHMMSS (such as 175501 for 05:01 PM) Pid The process ID the application is running in when the dump is taken Examples  C/370 Example /*COMPILATION UNIT: EDC3DMP */ #include #include #include int main(void) { _CHAR80 title = "This is the title of the dump report"; _CHAR255 options = "THREAD(CURRENT) TRACEBACK FILES"; FILE *f; _FEEDBACK fc; f = fopen("my.file","wb"); fprintf(f,"my file record 1\n"); CEE3DMP(title,options,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3DMP failed with msgno %d\n", fc.tok_msgno); exit(2999); } }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3DMP ************************************************* ** ** ** Function: CEE3DMP - generate dump ** ** ** ** In this example, a call to CEE3DMP is made ** ** to request a dump of the run-time ** ** environment. Several options are specified ** ** to customize the the dump. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBL3DMP. DATA DIVISION. WORKING-STORAGE SECTION. 01 DMPTITL PIC X(80). 01 OPTIONS PIC X(255). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. ** Specify title to appear on each page of the ** dump report. ** Specify options that will request that a ** traceback be provided, but no variables, ** stack frames, condition information, or ** registers be dumped. PARA-CBL3DMP. MOVE 'This is the title for the dump report.' TO DMPTITL. MOVE 'TRACE NOVAR SF(0) NOCOND NOENTRY' TO OPTIONS. CALL 'CEE3DMP' USING DMPTITL , OPTIONS , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEE3DMP failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBM3DMP */ /***************************************************/ /** */ /** Function: CEE3DMP - generate dump */ /** */ /** In this example, a call to CEE3DMP is made to */ /** request a dump of the run-time environment. */ /** Several options are specified, to customize */ /** the dump. */ /** */ /** */ /***************************************************/ PLI3DMP: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL DMPTITL CHAR80; DCL OPTIONS CHARACTER ( 255 ); DCL 01 FC FEEDBACK; /* Specify a string to be printed at the top of */ /* each page of dump */ DMPTITL = 'This is the title for the dump report.'; /* Request that a traceback be provided, but */ /* no variables, stack frames, condition */ /* information, or registers be dumped */ OPTIONS = 'TRACE NOVAR SF(0) NOCOND NOENTRY'; /* Call CEE3DMP with options to customize dump */ CALL CEE3DMP ( DMPTITL, OPTIONS, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Successfully produced dump with' || ' title "' || DMPTITL || '"' ); PUT SKIP LIST( ' and options: ' || OPTIONS ); END; ELSE DO; DISPLAY( 'CEE3DMP failed with msg ' || FC.MsgNo ); STOP; END; END PLI3DMP; ═══ 3.3.5. CEE3GRC-Get the Enclave Return Code ═══ CEE3GRC retrieves the current value of the user enclave return code. Use CEE3GRC in conjunction with CEE3SRC (see CEE3SRC-Set the Enclave Return Code) to get and then set user enclave return codes. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3GRC──(──return_code──,──fc──)─────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ return_code(output) The enclave return code. fc (output) A feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS consideration-CEE3GRC applies to the enclave. Examples  C/370 Examples C/370 main() Routine that Calls CEEHDLR and CEE3GRC /*COMPILATION UNIT: EDC3GRC */ #include #include #include #include /*****************************************************/ /** */ /** Function: CEEHDLR - Register user condition */ /** handler */ /** : CEE3GRC - Get enclave return code */ /* */ /* 1. Register the user-written condition handler */ /* CESETRC. */ /* 2. Call CERCDIV, which performs a divide-by-zero. */ /* 3. CESETRC is entered, sets the enclave return */ /* code to 999998 and resumes. */ /* 4. The main routine regains control and */ /* retrieves the enclave return code */ /*****************************************************/ /***************************************************** Declaration of user-written condition handler *****************************************************/ void CESETRC(_FEEDBACK *, _INT4*, _INT4 *, _FEEDBACK *); void CERCDIV(int); main() { _INT4 idivisor = 0; _INT4 enclave_RC; _FEEDBACK feedback, new_feedback; _ENTRY pgmptr; _INT4 token; /***************************************************** The condition handler CESETRC is registered *****************************************************/ pgmptr.address = (_POINTER)&CESETRC; pgmptr.nesting = NULL; token = 97; CEEHDLR(&pgmptr, &token, &feedback); /***************************************************** A divide-by-zero is accomplished by calling CERCDIV. *****************************************************/ CERCDIV(idivisor); /* this causes a zero divide */ /***************************************************** Call CEE3GRC and check that enclave return code was set. *****************************************************/ CEE3GRC(&enclave_RC, &feedback); if ( _FBCHECK ( feedback , CEE000 ) != 0 ) { printf("CEE3GRC failed with message number %d\n", feedback.tok_msgno); exit(2999); } if (enclave_RC != 999998) printf ("Error setting enclave return code"); } C / 370User - WrittenConditionHandlerthatSetsaUserEnclaveReturnCode /*COMPILATION UNIT: EDC3SRC */ /*****************************************************/ /** */ /** Function: CEE3SRC - Set the enclave return code. */ /* */ /* This is the user-written condition handler */ /* registered by CEGETRC. It invokes CEE3SRC to set */ /* the enclave return code to 999998 */ /* when a divide-by-zero condition is encountered. */ /** */ /*****************************************************/ #include #include #include #include #define RESUME 10 #define PERCOLATE 20 /*****************************************************/ void CESETRC (_FEEDBACK *cond, _INT4 *input_token, _INT4 *result, _FEEDBACK *new_cond) { _INT4 enclave_RC; _FEEDBACK feedback; if ( _FBCHECK ( *cond , CEE349 ) == 0 ) { enclave_RC = 999998; CEE3SRC(&enclave_RC, &feedback); *result = RESUME; } else { *result = PERCOLATE; } } C/370 Subroutine that Generates the Divide-by-Zero Condition /*COMPILATION UNIT: EDCDIV */ #include #include /**************************************************/ /** */ /* This is a divide-by-zero routine. It divides */ /* an input integer by a constant. */ /** */ /**************************************************/ void CERCDIV (int Integer) { int num; num = 1/Integer; }  COBOL/370 Examples COBOL Main Routine that Calls CEEHDLR and CEE3GRC CBL LIB,APOST,C,RENT,OPTIMIZE,NODYNAM *COMPILATION UNIT: IGZT3GRC ************************************************** ** ** ** Function: CEEHDLR - register user condition ** ** handler ** ** : CEE3GRC - get enclave return code ** ** ** ** 1. Registers user condition handler CESETRC. ** ** 2. Program then calls CERCDIV which performs ** ** a divide by zero operation. ** ** 3. CESETRC gets control and set the enclave ** ** return code to 999998 and resumes. ** ** 4. Regains control and retrieves the enclave ** ** return code. ** ************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBL3GRC. ************************************************** ** D A T A D I V I S I O N *** ************************************************** DATA DIVISION. WORKING-STORAGE SECTION. 01 TOKEN PIC X(4). 01 IDIVISOR PIC S9(9) COMP VALUE ZERO. 01 ENCLAVE-RC PIC S9(9) COMP. ** ** Declares for condition handling ** 01 PGMPTR USAGE IS PROCEDURE-POINTER. 01 FBCODE. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. ************************************************* ** P R O C D I V I S I O N *** ************************************************* PROCEDURE DIVISION. 0001-BEGIN-PROCESSING. ** ********************************************** ** Register user condition handler CESETRC using ** CEEHDLR ** ********************************************** SET PGMPTR TO ENTRY 'CESETRC'. MOVE 97 TO TOKEN CALL 'CEEHDLR' USING PGMPTR TOKEN FBCODE. IF NOT CEE000 of FBCODE THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FBCODE UPON CONSOLE; STOP RUN; END-IF. ** ********************************************** ** Call CERCDIV to cause a divide by zero ** condition ** ********************************************** CALL 'CERCDIV' USING IDIVISOR. ** ********************************************** ** Call CEE3GRC to get the enclave return code ** ********************************************** CALL 'CEE3GRC' USING ENCLAVE-RC FBCODE. IF NOT CEE000 of FBCODE THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FBCODE UPON CONSOLE; STOP RUN; END-IF. IF (ENCLAVE-RC = 999998) THEN DISPLAY 'Enclave return code ' 'set and retrieved.' ELSE DISPLAY '*** Unexpected enclave return ' 'code of ' ENCLAVE-RC ' encountered' END-IF. GOBACK. End program CBL3GRC. COBOL Condition Handler that Sets a User Enclave Return Code and Resumes when a Divide-by-Zero Condition Occurs CBL C,RENT,Q,OPTIMIZE,NODYNAM,LIB,APOST *COMPILATION UNIT: IGZT3SRC ************************************************* ** ** ** DRV3SRC - Drive sample program for CEE3SRC. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. DRV3SRC. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 DENOMINATOR PIC S9(9) COMP. 01 NUMERATOR PIC S9(9) COMP. 01 RATIO PIC S9(9) COMP. 01 TOKEN PIC S9(9) COMP VALUE 0. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. REGISTER-HANDLER. ** Register handler SET ROUTINE TO ENTRY 'CBL3SRC'. CALL 'CEEHDLR' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. RAISE-CONDITION. ** Cause a zero-divide condition. MOVE 0 TO DENOMINATOR. MOVE 1 TO NUMERATOR. DIVIDE NUMERATOR BY DENOMINATOR, GIVING RATIO. UNREGISTER-HANDLER. ** UNregister handler CALL 'CEEHDLU' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLU failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. STOP RUN. END PROGRAM DRV3SRC. *COMPILATION UNIT: CBL3SRC ************************************************ ** ** ** Function: CEE3SRC - Set the enclave ** ** return code ** ** ** ** This is an example of a user-written ** ** condition handler that sets a user ** ** enclave return code and resumes when ** ** a divide-by-zero condition occurs. ** ************************************************ IDENTIFICATION DIVISION. PROGRAM-ID. CBL3SRC. DATA DIVISION. WORKING-STORAGE SECTION. 01 ENCLAVE-RC PIC S9(9) BINARY. 01 FEEDBACK. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. LINKAGE SECTION. 01 TOKEN PIC X(4). 01 RESULT-CODE PIC S9(9) BINARY. 88 RESUME VALUE +10. 88 PERCOLATE VALUE +20. 01 CURRENT-CONDITION. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 NEW-CONDITION. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. ************************************************* ** P R O C D I V I S I O N *** ************************************************* PROCEDURE DIVISION USING CURRENT-CONDITION TOKEN RESULT-CODE NEW-CONDITION. HANDLE-CONDITION. ** Check for divide-by-zero condition (CEE349) IF CEE349 of CURRENT-CONDITION THEN MOVE 761 TO ENCLAVE-RC CALL 'CEE3SRC' USING ENCLAVE-RC, FEEDBACK IF NOT CEE000 of FEEDBACK THEN DISPLAY 'CEE3SRC failed with msg ' Msg-No of FEEDBACK UPON CONSOLE; END-IF; END-IF. SET PERCOLATE TO TRUE GOBACK. END PROGRAM CBL3SRC. COBOL Subroutine that Generates a Divide-by-Zero CBL LIB,APOST,C,RENT,OPTIMIZE,NODYNAM *COMPILATION UNIT: IGZTDIV ************************************************ ** ** **Function : ** ** ** ** A divide by zero is attempted. This ** ** induces the invocation of user condition ** ** handler CESETRC registered in program ** ** CEGETRC. ** ** : ** ************************************************ IDENTIFICATION DIVISION. PROGRAM-ID. CERCDIV. ************************************************ ** D A T A D I V I S I O N *** ************************************************ DATA DIVISION. WORKING-STORAGE SECTION. 01 TO-DIVIDE PIC S9(9) COMP VALUE 1. LINKAGE SECTION. 01 IDIVISOR PIC S9(9) COMP. ************************************************ ** P R O C D I V I S I O N *** ************************************************ PROCEDURE DIVISION USING IDIVISOR. PARA-CND01A. ** ** divide a constant by IDIVISOR. ** DIVIDE IDIVISOR INTO TO-DIVIDE. GOBACK. End program CERCDIV.  PL/I Example PL/I Example that Sets and Retrieves the User Enclave Return Code when a Divide-by-Zero is Generated *Process lc(101),opt(0),s,map,list,stmt,a(f),ag,macro ; /*COMPILATION UNIT: IBMDIV /****************************************************/ /** */ /** Function: CEE3SRC - Set the enclave return code */ /** : CEE3GRC - Get the enclave return code */ /* */ /* 1. A user ZERODIVIDE ON-unit is established by */ /* CESETRC. */ /* 2. A sub-program, sdivide, is called and causes */ /* a ZERODIVIDE condition to occur. */ /* 3. The ON-unit for ZERODIVIDE is entered. */ /* The ON-unit calls CEE3GRC to get the current */ /* enclave return code. It increments the return */ /* code by 4444, and sets the enclave return */ /* code to this new value. */ /* 4. On completion, the program prints the enclave */ /* return code. */ /****************************************************/ CESETRC: Proc Options(Main) ; %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL Enclave_RC INT4; DCL 01 FC FEEDBACK ; /****************************************************/ /* A ZERODIVIDE ON-unit is established */ /****************************************************/ on zerodivide begin; call CEE3GRC (Enclave_RC, fc); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Original Enclave RC was ' || Enclave_RC ); END; ELSE DO; DISPLAY( 'CEE3GRC failed with msg ' || FC.MsgNo ); STOP; END; Enclave_RC = Enclave_RC + 4444; call CEE3SRC (Enclave_RC, fc); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'New Enclave RC is ' || Enclave_RC ); END; ELSE DO; DISPLAY( 'CEE3SRC failed with msg ' || FC.MsgNo ); STOP; END; goto resume; end; /****************************************************/ /* Call sdivide to cause a ZERODIVIDE condition. */ /****************************************************/ call sdivide; resume: put skip edit('Enclave return code is ', Enclave_RC) (A, F(10)); /****************************************************/ /* The sdivide routine causes a ZERODIVIDE condition*/ /****************************************************/ sdivide: proc; dcl int fixed bin (15,0); dcl int_2 fixed bin (15,0) init(5); dcl int_3 fixed bin (15,0) init(0); int = int_2 / int_3; end sdivide; End cesetrc; ═══ 3.3.6. CEE3GRN-Get Name of Routine that Incurred Condition ═══ CEE3GRN gets the name of the most current LE/370-conforming routine where a condition occurred. If there are nested conditions, the most recently signaled condition is used. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3GRN──(──name──,──fc──)────────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ name (output) VSTRING, a fixed-length 80-character string, that contains the name of the routine that was executing when the condition was raised. name is left-justified within the field and right-padded with blanks. If there are nested conditions, the most recently activated condition is used to determine name. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE35S │ 1 │ 3260 │ No condition was active when a call to a con- │ │ │ │ │ dition management routine was made. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS consideration-In multithread applications, CEE3GRN gets the name of the routine that incurred the condition on the current thread. Examples  C/370 Example /*COMPILATION UNIT: EDC3GRN */ #include #include #include #include void handler(_FEEDBACK *,_INT4 *,_INT4 *,_FEEDBACK *); int main(void) { _FEEDBACK fc,condtok; _ENTRY routine; _INT4 token,qdata; _INT2 c_1,c_2,cond_case,sev,control; _CHAR3 facid; _INT4 isi; /* . . . */ /* register condition handler */ token = 99; routine.address = (_POINTER)&handler; routine.nesting = NULL; CEEHDLR(&routine,&token,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEHDLR failed with message number %d\n", fc.tok_msgno); exit (2999); } /* . . . */ /* set up any condition sev 2 or higher */ c_1 = 3; c_2 = 99; cond_case = 1; sev = 3; control = 0; memcpy(facid,"ZZZ",3); isi = 0; CEENCOD(&c_1,&c_2,&cond_case,&sev,&control, facid,&isi,&condtok,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEENCOD failed with message number %d\n", fc.tok_msgno); exit(2999); } /* signal condition */ CEESGL(&condtok,&qdata,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEESGL failed with message number %d\n", fc.tok_msgno); exit (2999); } } void handler(_FEEDBACK *fc, _INT4 *token, _INT4 *result, _FEEDBACK *newfc) { _CHAR80 name; _FEEDBACK grnfc; /* get name of the routine that signal the /* condition */ CEE3GRN(name,&grnfc); if ( _FBCHECK ( grnfc , CEE000 ) != 0 ) { printf("CEESGL failed with message number %d\n", grnfc.tok_msgno); exit (2999); } printf("the routine that called this condition"); printf(" handler is:\n %.80s\n",name); *result = 10; return; }  COBOL/370 Example CBL LIB,APOST,NOOPT *COMPILATION UNIT: IGZT3GRN ************************************************* ** ** ** DRV3GRN - Drive sample program for CEE3GRN. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. DRV3GRN. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 DENOMINATOR PIC S9(9) COMP. 01 NUMERATOR PIC S9(9) COMP. 01 RATIO PIC S9(9) COMP. 01 TOKEN PIC S9(9) COMP VALUE 0. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. REGISTER-HANDLER. ** Register handler SET ROUTINE TO ENTRY 'CBL3GRN'. CALL 'CEEHDLR' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. RAISE-CONDITION. ** Cause a zero-divide condition. MOVE 0 TO DENOMINATOR. MOVE 1 TO NUMERATOR. DIVIDE NUMERATOR BY DENOMINATOR, GIVING RATIO. UNREGISTER-HANDLER. ** UNregister handler CALL 'CEEHDLU' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLU failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. STOP RUN. END PROGRAM DRV3GRN. *COMPILATION UNIT: CBL3GRN ************************************************** ** ** ** Function: CEE3GRN - Get name of routine that ** ** incurred condition. ** ** ** ************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBL3GRN. DATA DIVISION. WORKING-STORAGE SECTION. 01 RNAME PIC X(80). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. LINKAGE SECTION. 01 TOKEN PIC S9(9) COMP. 01 RESULT PIC S9(9) COMP. 88 RESUME VALUE 10. 01 CURCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 NEWCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION USING CURCOND, TOKEN, RESULT, NEWCOND. PARA-CBL3GRN. CALL 'CEE3GRN' USING RNAME , FC. IF CEE000 of FC THEN DISPLAY 'Name of routine which ' 'incurred the condition is: ' RNAME; ELSE DISPLAY 'CEE3GRN failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. PARA-HANDLER. ** In user handler - resume execution SET RESUME TO TRUE. GOBACK. END PROGRAM CBL3GRN.  PL/I Example *PROCESS OPT(0), MACRO; /*COMPILATION UNIT: IBM3GRN /********************************************/ /** **/ /** Function: CEE3GRN - example of CEE3GRN **/ /** invoked from PL/I **/ /** ON-unit **/ /** **/ /********************************************/ IBM3GRN: PROCEDURE OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DECLARE RNAME CHAR80, 01 FC FEEDBACK, divisor FIXED BINARY(31) INITIAL(0); ON ZERODIVIDE BEGIN; /* Call CEE3GRN to get the name of the */ /* routine that incurred the most recently */ /* signaled condition */ CALL CEE3GRN ( RNAME, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The most recently signaled' || 'condition incurred by' || RNAME ); END; ELSE DO; DISPLAY( 'CEE3GRN failed with msg ' || FC.MsgNo ); END; END /* ON ZeroDivide */; divisor = 15 / divisor /* signal ZERODIVIDE */; END IBM3GRN; ═══ 3.3.7. CEE3LNG-Set National Language ═══ CEE3LNG sets or queries the current national language. The national language is recorded on a LIFO national language stack. Changing the national language changes the languages in which error messages are displayed and printed, and of the names of the days of the week, and the names of the months. More than one national language can be PUSHed. Languages are POPped in LIFO order. Message modules associated with a national language are not loaded until they are actually needed in order to format a message. If you specify a national_language not available on your system, the IBM-supplied default national_language is used. In LE/370, this is ENU (mixed-case U.S. English). CEEUOPT and CEEDOPT can specify an unknown national language code. They give a return code of 4 and a warning message. If an invalid language is specified, the IBM-supplied default ENU (mixed-case U.S. English) is used. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3LNG──(──function──,──desired_language──,──fc──)───────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ function (input) A fullword binary integer that specifies the service to perform. The possible values for function are: 1-SET Establishes the desired_language specified in the call to CEE3LNG as the current language. In effect, it replaces the current language on the top of the stack with the desired_language that you specify. When setting the national language, the desired_language is folded to uppercase. "enu" and "ENU", for example, are considered to be the same national language. 2-QUERY Identifies the current language on the top of the stack to the calling routine by returning it in the desired_language parameter of CEE3LNG. The desired_language retained as the result of the QUERY function is in uppercase. 3-PUSH Pushes the desired_language specified in the call to CEE3LNG on to the top of the language stack, making it the current language. Previous languages are retained on the stack on a LIFO basis, making it possible to return to a prior language at a later time. 4-POP Pops the current language off the stack. The previous language that was PUSHed on to the stack now becomes the new current language. Upon return to the caller, the desired_language parameter contains the discarded language. If the stack contains only one language and would be empty after the call, no action is taken and a feedback code indicating such is returned. desired_language (input/output) A 3-character fixed-length string. The string is not case-sensitive and is used in the following ways for different functions: ┌───────────────────┬──────────────────────────────────────────────────────────────────────────────┐ │ If function is │ Then desired_language: │ │ specified as: │ │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 1 or 3 │ Contains the desired national language identification. In this case, it is │ │ │ an input parameter. National Language Codes contains a list of national │ │ │ language identifiers. │ │ │ │ │ │ NOTE: LE/370 supports only these national languages: │ │ │ │ │ │ ENU Mixed-case U.S. English │ │ │ │ │ │ UEN Uppercase U.S. English │ │ │ │ │ │ JPN Japanese. │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 2 │ Returns the current language on top of the stack. In this case, it is an │ │ │ output parameter. │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 4 │ Returns the discarded national language. In this case, it is an output │ │ │ parameter. │ └───────────────────┴──────────────────────────────────────────────────────────────────────────────┘ fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3BQ │ 2 │ 3450 │ Only one language was on the stack when a POP │ │ │ │ │ request was made to CEE3LNG. The current lan- │ │ │ │ │ guage was returned in the desired language │ │ │ │ │ parameter. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3BR │ 3 │ 3451 │ The desired language desired-language for the │ │ │ │ │ PUSH or SET function for CEE3LNG was invalid. │ │ │ │ │ No operation was performed. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3BS │ 3 │ 3452 │ The function function specified for CEE3LNG │ │ │ │ │ was not recognized. No operation was per- │ │ │ │ │ formed. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  C/370 considerations-C/370 provides locales that map to German, Spanish, French, U.S. English, and other languages. These locales establish default formats for items such as currency symbols, and names of the days of the week. To change the locale, you use the setlocale() library function. The settings of setlocale() and the CEE3LNG run-time option do not affect one another. CEE3LNG affects only LE/370 services and error messages; setlocale() affects only C/370 functions. To ensure that everything is set properly for your country, use both CEE3LNG and setlocale().  OpenEdition MVS consideration-CEE3LNG applies to the enclave. Each enclave has a single current national language setting. Examples  C/370 Example /*COMPILATION UNIT: EDC3LNG */ #include #include #include #include int main(void) { _FEEDBACK fc; _INT4 function; _CHAR3 lang; /* Query the current language setting */ function = 2; /* function 2 is query */ CEE3LNG(&function,lang,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3LNG failed with message number %d\n", fc.tok_msgno); exit(2999); } /* if the current language is not mixed-case */ /* American English set the current language to */ /* mixed-case American English */ if (memcmp(lang,"ENU",3) != 0) { memcpy(lang,"ENU",3); function = 1; /* function 1 is set */ CEE3LNG(&function,lang,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3LNG failed with message number %d\n", fc.tok_msgno); exit(2999); } } }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3LNG ************************************************* ** ** ** Function: CEE3LNG - Set national language ** ** ** ** In this example, CEE3LNG is called to query ** ** the current national language setting. If ** ** the setting is not mixed-case U.S. English, ** ** CEE3LNG is called to change the setting. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBL3LNG. DATA DIVISION. WORKING-STORAGE SECTION. 01 FUNCTN PIC S9(9) COMP. 01 LANG PIC X(3). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-3LNGQRY. ** Specify 2 for QUERY function. ** Call CEE3LNG to query the current ** national language setting MOVE 2 TO FUNCTN. CALL 'CEE3LNG' USING FUNCTN , LANG , FC. IF CEE000 of FC THEN DISPLAY 'Current National Language is: ' LANG; ELSE DISPLAY 'CEE3LNG(query) failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. PARA-3LNGSET. ** If the current national language is not ** mixed-case U.S. English, then call ** CEE3LNG with the SET function (1) to ** change the national language to mixed-case ** U.S. English IF ( LANG IS NOT = 'ENU' ) THEN MOVE 1 TO FUNCTN CALL 'CEE3LNG' USING FUNCTN , LANG , FC IF NOT CEE000 of FC THEN DISPLAY 'CEE3LNG(set) failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF; DISPLAY 'The national language has ', 'been changed to mixed-case ' 'U.S. English (ENU).' END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBM3LNG /****************************************************/ /** */ /** Function: CEE3LNG - set national language */ /** */ /** In this example, CEE3LNG is called to query the */ /** current national language setting. If the */ /** setting is not mixed case American English, */ /** CEE3LNMG is called to change the setting to that*/ /** */ /****************************************************/ PLI3LNG: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL FUNCTN INT4; DCL LANG CHARACTER ( 3 ); DCL 01 FC FEEDBACK; FUNCTN = 2; /* Specify code to query current */ /* national language */ /* Call CEE3LNG with function code 2 to query */ /* national language */ CALL CEE3LNG ( FUNCTN, LANG, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST('The current national language is ' || LANG ); END; ELSE DO; DISPLAY( 'CEE3LNG failed with msg ' || FC.MsgNo ); STOP; END; /* If the current language is not mixed-case */ /* American English, set it to mixed-case */ /* American English */ IF LANG к= 'ENU' THEN DO; FUNCTN = 1; CALL CEE3LNG ( FUNCTN, 'ENU', FC); IF к FBCHECK( FC, CEE000) THEN DO; DISPLAY( 'CEE3LNG failed with msg ' || FC.MsgNo ); STOP; END; CALL CEE3LNG ( 2, LANG, FC); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST('The national language is now ' || LANG ); END; ELSE DO; DISPLAY( 'CEE3LNG failed with msg ' || FC.MsgNo ); STOP; END; END /* Language is not ENU */; END PLI3LNG; ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 15. National Language Codes │ ├─────────────────────────────────────────────────┬────────────────────────────────────────────────┤ │ ID │ NATIONAL LANGUAGE │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ AFR │ Afrikaans │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ ARA │ Arab Countries │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ BGR │ Bulgarian │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CAT │ Catalan │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CHT │ Traditional Chinese │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CHS │ Simplified Chinese │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CSY │ Czech │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ DAN │ Danish │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ DEU │ German │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ DES │ Swiss German │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ ELL │ Greek │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ ENG │ U.K. English │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ ENU │ U.S. English │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ ESP │ Spanish │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ FIN │ Finnish │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ FRA │ French │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ FRB │ Belgian French │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ FRC │ Canadian French │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ FRS │ Swiss French │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ HEB │ Hebrew │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ HUN │ Hungarian │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ ISL │ Icelandic │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ ITA │ Italian │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ ITS │ Swiss Italian │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ JPN │ Japanese │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ KOR │ Korean │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ NLD │ Dutch │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ NLB │ Belgian Dutch │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ NOR │ Norwegian - Bokmal │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ NON │ Norwegian - Nynorsk │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ PLK │ Polish │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ PTG │ Portuguese │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ PTB │ Brazilian Portuguese │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ RMS │ Rhaeto-Romanic │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ ROM │ Romanian │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ RUS │ Russian │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ SHC │ Serbo-Croatian (Cyrillic) │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ SHL │ Serbo-Croatian (Latin) │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ SKY │ Slovakian │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ SQI │ Albanian │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ SVE │ Swedish │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ THA │ Thai │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ TRK │ Turkish │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ UEN │ U.S. Uppercase English │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ URD │ Urdu │ ├─────────────────────────────────────────────────┴────────────────────────────────────────────────┤ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ═══ 3.3.8. CEE3MCS-Get Default Currency Symbol ═══ CEE3MCS returns the default currency symbol for the country you specify with country_code. If you specify an invalid country_code, the default currency symbol is X'9F40'. In the United States, it is shown as a '$'followed by three blanks. For a list of the default settings for a specified country, see Defaults Currency and Picture Strings Based on COUNTRY Setting. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3MCS──(──country_code──,──currency_symbol──,──fc──)────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ country_code (input) A 2-character fixed-length string representing one of the country codes found in Defaults Currency and Picture Strings Based on COUNTRY Setting. country_code is not case-sensitive. If no value is specified, the default country code, as set by the COUNTRY run-time option or the CEE3CTY callable service, is used. See COUNTRY for an explanation of the COUNTRY run-time option and CEE3CTY-Set Default Country for an explanation of the CEE3CTY callable service. currency_symbol (output) A 4-character fixed-length string returned to the calling routine. It contains the default currency symbol for the country specified. The currency symbol is left-justified and padded on the right with blanks, if necessary. fc (output) A feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3C6 │ 2 │ 3462 │ The currency symbol 'currency-symbol' was │ │ │ │ │ truncated and was not defined in CEE3MCS. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3C7 │ 2 │ 3463 │ The country code country-code was invalid for │ │ │ │ │ CEE3MCS. The default currency symbol │ │ │ │ │ 'currency-symbol' was returned. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-CEE3MCS applies to the enclave. Every enclave has a single current country setting that has a single currency symbol. Every thread in every enclave has the same default. Examples  C/370 Example /*COMPILATION UNIT: EDC3MCS */ #include #include #include #include int main(void) { _FEEDBACK fc; _CHAR2 country,currency; /* get the default currency symbol for Canada */ memcpy(country,"CA",2); CEE3MCS(country,currency,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3MCS failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("The default currency symbol for Canada is:" " %.2s\n",currency); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3MCS ************************************************** ** ** ** FUNCTION: CEE3MCS - Obtain default currency ** ** symbol ** ** ** ************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBL3MCS. DATA DIVISION. WORKING-STORAGE SECTION. 01 COUNTRY PIC X(2). 01 CURSYM PIC X(2). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBL3MCS. ** Specify country code for the US in the call ** to CEE3MCS MOVE 'US' TO COUNTRY. CALL 'CEE3MCS' USING COUNTRY , CURSYM , FC. ** If CEE3MCS runs successfully, display result. IF CEE000 of FC THEN DISPLAY 'The default currency symbol ' 'for the ' COUNTRY ' is: ' CURSYM ELSE DISPLAY 'CEE3MCS failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBM3MCS */ /****************************************************/ /** */ /** Function: CEE3MCS - Obtain default currency */ /** symbol */ /** */ /****************************************************/ PLI3MCS: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL COUNTRY CHARACTER ( 2 ); DCL CURSYM CHARACTER ( 4 ); DCL 01 FC FEEDBACK; COUNTRY = 'US'; /* Specify country code for the */ /* United States */ /* Call CEE3MCS to return currency symbol for */ /* the United States */ CALL CEE3MCS ( COUNTRY, CURSYM, FC ); /* Print the default currency symbol for the US */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The default currency symbol for the ' || COUNTRY || ' is "' || CURSYM || '"'); END; ELSE DO; DISPLAY( 'CEE3MCS failed with msg ' || FC.MsgNo ); STOP; END; END PLI3MCS; ═══ 3.3.9. CEE3MDS-Get Default Decimal Separator ═══ CEE3MDS returns the default decimal separator for the country specified by country_code. If you specify an invalid country_code, the default decimal separator is a period (.). For a list of the default settings for a specified country, see Defaults Currency and Picture Strings Based on COUNTRY Setting. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3MDS──(──country_code──,──decimal_separator──,──fc──)──────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ country_code (input) A 2-character fixed-length string representing one of the country codes found in Defaults Currency and Picture Strings Based on COUNTRY Setting. country_code is not case-sensitive. If no value is specified, the default country code, as set by the COUNTRY run-time option or the CEE3CTY callable service, is used. See COUNTRY for an explanation of the COUNTRY run-time option and CEE3CTY-Set Default Country for an explanation of the CEE3CTY callable service. decimal_separator (output) A 2-character fixed-length string containing the default decimal separator for the country specified. The decimal separator is left-justified and padded on the right with a blank. fc (output) A 12-byte feedback code, optional in some languages, indicating the service result. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3C4 │ 2 │ 3460 │ The decimal separator 'decimal-separator' was │ │ │ │ │ truncated and was not defined in CEE3MDS. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3C5 │ 2 │ 3461 │ The country code country-code was invalid for │ │ │ │ │ CEE3MDS. The default decimal separator │ │ │ │ │ 'decimal-separator' was returned. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-CEE3MDS applies to the enclave. Every enclave has a single current country setting that has a single decimal separator. Every thread in every enclave has the same default. Examples  C/370 Example /*COMPILATION UNIT: EDC3MDS */ #include #include #include #include int main(void) { _FEEDBACK fc; _CHAR2 country,decimal; /* get the default decimal separator for Canada */ memcpy(country,"CA",2); CEE3MDS(country,decimal,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3MDS failed with message number %d\n", fc.tok_msgno); exit(2999); } /* print out the default decimal separator */ printf("The default decimal separator for"); printf(" Canada is: %.2s\n",decimal); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3MDS ********************************************* ** ** ** Function: CEE3MDS - get default decimal ** ** separator ** ** ** ********************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBL3MDS. DATA DIVISION. WORKING-STORAGE SECTION. 01 COUNTRY PIC X(2). 01 DECSEP PIC X(2). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. ** Specify the country code for the US in the ** call to CEE3MDS. ** If call was successful, print result. PARA-CBL3MDS. MOVE 'US' TO COUNTRY. CALL 'CEE3MDS' USING COUNTRY , DECSEP , FC. IF CEE000 of FC THEN DISPLAY 'The default Decimal Separator ' 'for ' COUNTRY ' is "' DECSEP '"' ELSE DISPLAY 'CEE3MDS failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBM3MDS */ /**************************************************/ /** */ /** Function: CEE3MDS - get default decimal */ /** separator */ /**************************************************/ PLI3MDS: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL COUNTRY CHARACTER ( 2 ); DCL DECSEP CHARACTER ( 2 ); DCL 01 FC FEEDBACK; COUNTRY = 'US'; /* Specify country code for */ /* the United States */ /* Call CEE3MDS to get default decimal */ /* separator for the US */ CALL CEE3MDS ( COUNTRY, DECSEP, FC ); /* Print the default decimal separator for */ /* the US */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The default decimal separator for the ' || COUNTRY || ' is "' || DECSEP || '"' ); END; ELSE DO; DISPLAY( 'CEE3MDS failed with msg ' || FC.MsgNo ); STOP; END; END PLI3MDS; ═══ 3.3.10. CEE3MTS-Get Default Thousands Separator ═══ CEE3MTS returns the default thousands separator for the specified country with country_code. If you specify an invalid country_code, the default thousands separator is a comma (,). For a list of the default settings for a specified country, see Defaults Currency and Picture Strings Based on COUNTRY Setting. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3MTS──(──country_code──,──thousands_separator──,──fc──)────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ country_code (input) A 2-character fixed-length string representing one of the country codes found in Defaults Currency and Picture Strings Based on COUNTRY Setting. country_code is not case-sensitive. If no value is specified, the default country code, as set by the COUNTRY run-time option or the CEE3CTY callable service, is used. See COUNTRY for an explanation of the COUNTRY run-time option, and CEE3CTY-Set Default Country for an explanation of the CEE3CTY callable service. thousands_separator (output) A 2-character fixed-length string representing the default thousands separator for the country specified. The thousands separator is left-justified and padded on the right with a blank. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3C8 │ 2 │ 3464 │ The thousands separator 'thousands-separator' │ │ │ │ │ was truncated and was not defined in CEE3MTS. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3C9 │ 2 │ 3465 │ The country code country-code was invalid for │ │ │ │ │ CEE3MTS. The default thousands separator │ │ │ │ │ 'thousands-separator' was returned. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-CEE3MTS applies to the enclave. Every enclave has a single current country setting that has a single thousands separator. Every thread in every enclave has the same default. Examples  C/370 Example /*COMPILATION UNIT: EDC3MTS */ #include #include #include #include int main(void) { _FEEDBACK fc; _CHAR2 country,thousand; /* get the default thousands separator for Canada */ memcpy(country,"CA",2); CEE3MTS(country,thousand,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3MTS failed with message number %d\n", fc.tok_msgno); exit(2999); } /* print out the default thousands separator */ printf("The default thousands separator for Canada"); printf(" is: %.2s\n",thousand); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3MTS ************************************************** ** ** ** Function: CEE3MTS - obtain default thousands ** ** separator ** ** ** ************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBL3MTS. DATA DIVISION. WORKING-STORAGE SECTION. 01 COUNTRY PIC X(2). 01 THOUSEP PIC X(2). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBL3MTS. ** Specify the country code for the US in the ** call to CEE3MTS. MOVE 'US' TO COUNTRY. CALL 'CEE3MTS' USING COUNTRY , THOUSEP , FC. ** If CEE3MTS runs successfully, display result IF CEE000 of FC THEN DISPLAY 'The default Thousands Separator' ' for ' COUNTRY ' is "' THOUSEP '"' ELSE DISPLAY 'CEE3MDS failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBM3MTS */ /***************************************************/ /** */ /** Function: CEE3MTS - obtain default thousands */ /** separator */ /** */ /***************************************************/ PLI3MTS: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL COUNTRY CHARACTER ( 2 ); DCL THOUSEP CHARACTER ( 2 ); DCL 01 FC FEEDBACK; COUNTRY = 'US'; /* Specify US as the country */ /* code for the United States */ /* Call CEE3MTS to return default thousands */ /* separator for the US */ CALL CEE3MTS ( COUNTRY, THOUSEP, FC ); /* If CEE3MTS ran successfully print out result */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The default thousands separator for the ' || COUNTRY || ' is "' || THOUSEP || '"' ); END; ELSE DO; DISPLAY( 'CEE3MTS failed with msg ' || FC.MsgNo ); STOP; END; END PLI3MTS; ═══ 3.3.11. CEE3PRM-Query Parameter String ═══ CEE3PRM queries and returns to the calling routine the parameter string specified at invocation of the program. The returned parameter string contains only program arguments. If no program arguments are available, a blank string is returned. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3PRM──(──char_parm_string──,──fc──)────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ char_parm_string (output) An 80-byte fixed-length string passed by CEE3PRM. On return from this service, the char_parm_string contains the parameter string specified at invocation of the program. If this parameter string is longer than 80 characters, it is truncated. If the parameter string is shorter than 80 characters, the returned string is padded with blanks. If the program argument passed to the service is absent, or is not a character string, char_parm_string is blank. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3I1 │ 1 │ 3649 │ The parameter string returned from CEE3PRM │ │ │ │ │ exceeded the maximum length of 80 bytes and │ │ │ │ │ was truncated. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  C/370 consideration-C users can use the __osplist to return a program argument longer than 80 characters.  OpenEdition MVS considerations-CEE3PRM is allowed only in the initial thread. Examples  C/370 Example /*COMPILATION UNIT: EDC3PRM */ #include #include #include int main() { _CHAR80 parm; _FEEDBACK fc; CEE3PRM(parm,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3PRM failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("%s\n",parm); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3PRM ************************************************ ** ** ** Function: CEE3PRM - query parameter string ** ** ** ** In this example, a call is made to ** ** CEE3PRM to return the parameter string ** ** that was specified at invocation of the ** ** program. The string is then displayed. ** ** ** ************************************************ IDENTIFICATION DIVISION. PROGRAM-ID. CBL3PRM. DATA DIVISION. WORKING-STORAGE SECTION. 01 PARMSTR PIC X(80). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBL3PRM. CALL 'CEE3PRM' USING PARMSTR , FC. IF CEE000 THEN DISPLAY 'Program arguments specified: "' PARMSTR '"' ELSE DISPLAY 'CEE3PRM failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBM3PRM */ /***************************************************/ /** */ /** Function: CEE3PRM - Query Parameter String */ /** */ /***************************************************/ PLI3PRM: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL PARMSTR CHAR80; DCL 01 FC FEEDBACK; /* Call CEE3PRM to return the program arguments */ /* specified at invocation of the program */ CALL CEE3PRM ( PARMSTR, FC ); /* There are no non-zero feedback codes to */ /* check, so print result */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'These program arguments were specified: "' || PARMSTR || '"'); END; ELSE DO; DISPLAY( 'CEE3PRM failed with msg ' || FC.MsgNo ); STOP; END; END PLI3PRM; ═══ 3.3.12. CEE3RPH-Set Report Heading ═══ CEE3RPH sets the heading displayed at the top of the storage or options report generated when you specify the RPTSTG(ON) or RPTOPTS(ON) run-time options. Storage Report Produced by LE/370 Run-Time Option RPTSTG(ON) contains a sample storage report, and Options Report Produced by LE/370 Run-Time Option RPTOPTS(ON) contains a sample options report. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3RPH──(──report_heading──,──fc──)──────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ report_heading (input) An 80-character fixed-length string. report_heading sets the identifying character string displayed at the top of the storage or options report. LE/370 uses only the first 79 bytes of report_heading; the last byte is ignored. report_heading can contain DBCS characters surrounded by X'0E' (shift-out) and X'0F' (shift-in). fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3JK │ 0 │ 3700 │ The storage and options report heading │ │ │ │ │ replaced a previous heading. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  PL/I considerations-CEE3RPH is designed to provide an equivalent function to the special PL/I variable PLIXHD.  OpenEdition MVS considerations-CEE3RPH applies to the enclave. Examples  C/370 Example /*COMPILATION UNIT: EDC3RPH */ #pragma runopts(REPORT) #include #include #include int main(void) { _CHAR80 heading; /* initialize heading to blanks and then set the */ /* heading */ memset(heading,' ',80); memcpy(heading,"User Defined Report Heading",27); /* set the report heading...do not need to check */ /* feedback token because all return codes are */ /* successful */ CEE3RPH(heading,NULL); /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3RPH ************************************************** ** ** ** Function: CEE3RPH - set report heading ** ** ** ** In this example, a call is made to CEE3RPH ** ** to set the report heading that appears at ** ** the top of each page of the options report ** ** (generated by RPTOPTS) and storage report ** ** (generated by RPTSTG). ** ** ** ************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBL3RPH. DATA DIVISION. WORKING-STORAGE SECTION. 01 RPTHEAD PIC X(80). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. ** Specify user-defined report heading via CEE3RPH PARA-CBL3RPH. MOVE 'My options and storage reports heading' TO RPTHEAD. CALL 'CEE3RPH' USING RPTHEAD , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEE3RPH failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBM3RPH */ /********************************************/ /** */ /** Function: CEE3RPH - set report heading */ /** */ /********************************************/ PLI3RPH: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL RPTHEAD CHAR80; DCL 01 FC FEEDBACK; /* Define report heading */ RPTHEAD = 'My storage report heading'; /* Set report heading in call to CEE3RPH */ CALL CEE3RPH ( RPTHEAD, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Report heading now set to "' || RPTHEAD || '"' ); END; ELSE DO; DISPLAY( 'CEE3RPH failed with msg ' || FC.MsgNo ); STOP; END; END PLI3RPH; ═══ 3.3.13. CEE3SPM-Query and Modify LE/370 Hardware Condition Enablement ═══ CEE3SPM queries and modifies the enablement of LE/370 hardware conditions. You can use the CEE3SPM service to:  Alter the settings of the LE/370 conditions to those specified by the caller.  Query the current settings of the LE/370 conditions and return the settings to the caller.  Push the current settings of the LE/370 conditions on to the LE/370-managed condition stack, where all program math settings are kept.  Pop the pushed settings of the LE/370 conditions from the LE/370-managed condition stack and set the current settings of the LE/370 conditions to those popped.  Push the current settings of the LE/370 conditions on to the LE/370-managed condition stack and alter the settings of the LE/370 conditions to those supplied by the caller. The enabled or disabled LE/370 conditions are: fixed-overflow When enabled, raises the fixed-overflow condition when an overflow occurs during signed binary arithmetic or signed left-shift operations. decimal-overflow When enabled, raises the decimal-overflow condition when one or more nonzero digits are lost because the destination field in a decimal operation is too short to contain the results. underflow When enabled, raises the underflow condition when the result characteristic of a floating-point operation is less than zero and the result fraction is not zero. For an extended-format floating-point result, the condition is raised only when the high-order characteristic underflows. significance When enabled, raises the significance condition when the resulting fraction in floating-point addition or subtraction is zero. When you use the CEE3SPM callable service, maintenance of the condition stack is required. For example, one user-written condition handler can disable a hardware condition while another enables it. Therefore, do not assume that the program mask is at a given setting. The program mask is set differently based on different HLL requirements. You can find out what the current setting is by using the QUERY function of CEE3SPM. LE/370 initialization sets conditions based on the languages in the initial load module. Each language present adds to the conditions that are enabled. Some S/370 hardware interrupt codes and their matching LE/370 feedback codes appear in S/370 Interrupt Code Descriptions. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3SPM──(──action──,──cond_string──,──fc──)──────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ action (input) The action to be performed. action is specified as a fullword binary signed integer corresponding to one of the numbers in the following list: 1-SET Alters the settings of the LE/370 conditions to those specified in the cond_string parameter. 2-QUERY Queries the current settings of the LE/370 conditions and return the settings in the cond_string parameter. 3-PUSH Pushes the current settings of the LE/370 conditions on to the LE/370-managed condition stack. 4-POP Pops the pushed settings of the LE/370 conditions from the LE/370-managed condition stack and sets the current settings of the LE/370 conditions to those popped. 5-PUSH, SET Pushes the current settings of the LE/370 conditions on to the LE/370-managed condition stack and alters the settings of the LE/370 conditions to those supplied by the caller in the cond_string parameter. cond_string (input/output) A fixed-length string of 80 bytes containing a sequence of identifiers representing the requested settings for the LE/370 conditions that can be enabled and disabled. A list of conditions enabled and disabled and their associated identifiers is given below: Condition Identifier fixed-overflow F (NOF for disablement) decimal-overflow D (NOD for disablement) underflow U (NOU for disablement) significance S (NOS for disablement) An identifier with the 'NO' prefix is used to disable the condition it represents. An identifier without the 'NO' prefix is used to enable the condition that it represents. For example, the token 'F' is used to enable the fixed-overflow condition. The identifier 'NOF' is used to disable the fixed-overflow condition. The rightmost option takes effect in the event of a conflict. Identifiers are separated by blanks or commas. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE36V │ 4 │ 3295 │ The condition string from CEE3SPM did not │ │ │ │ │ contain all of the settings, because the │ │ │ │ │ returned string was truncated. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE370 │ 4 │ 3296 │ Some of the data in the condition string from │ │ │ │ │ CEE3SPM could not be recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE371 │ 4 │ 3297 │ The service completed successfully for recog- │ │ │ │ │ nized condition(s), unsuccessfully for unrec- │ │ │ │ │ ognized (unsupported) condition(s). │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE372 │ 4 │ 3298 │ A call to CEE3SPM attempted to PUSH settings │ │ │ │ │ onto a full stack. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE373 │ 4 │ 3299 │ A call to CEE3SPM attempted to POP settings │ │ │ │ │ off an empty stack. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE374 │ 4 │ 3300 │ The action parameter in CEE3SPM was not one of │ │ │ │ │ the digits 1 to 5. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  C/370 consideration-C/370 ignores the fixed-overflow, decimal-overflow, underflow, and significance interrupts, no matter what you specify in CEE3SPM.  COBOL/370 consideration-COBOL/370 ignores the fixed-overflow and decimal-overflow interrupts, no matter what you specify in CEE3SPM.  OpenEdition MVS consideration-In multithread applications, CEE3SPM affects only the calling thread. ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 16. S/370 Interrupt Code Descriptions │ ├────────────┬────────────────────────────────────┬──────────┬────────────┬───────────┬────────────┤ │ S/370 │ DESCRIPTION │ MASKABLE │ SYMBOLIC │ MESSAGE │ SEVERITY │ │ INTERRUPT │ │ │ FEEDBACK │ NUMBER │ │ │ CODE │ │ │ CODE │ │ │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 0001 │ Operation exception │ No │ CEE341 │ 3201 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 0002 │ Privileged operation exception │ No │ CEE342 │ 3202 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 0003 │ Execute exception │ No │ CEE343 │ 3203 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 0004 │ Protection exception │ No │ CEE344 │ 3204 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 0005 │ Addressing exception │ No │ CEE345 │ 3205 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 0006 │ Specification exception │ No │ CEE346 │ 3206 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 0007 │ Data exception │ No │ CEE347 │ 3207 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 0008 │ Fixed-point overflow exception │ Yes │ CEE348 │ 3208 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 0009 │ Fixed-point divide exception │ No │ CEE349 │ 3209 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 000A │ Decimal-overflow exception │ Yes │ CEE34A │ 3210 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 000B │ Decimal divide exception │ No │ CEE34B │ 3211 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 000C │ Exponent-overflow exception │ No │ CEE34C │ 3212 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 000D │ Exponent-underflow exception │ Yes │ CEE34D │ 3213 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ 000E │ Significance exception │ Yes │ CEE34E │ 3214 │ 3 │ ├────────────┼────────────────────────────────────┼──────────┼────────────┼───────────┼────────────┤ │ nn0F │ Floating-point divide exception │ No │ CEE34F │ 3215 │ 3 │ └────────────┴────────────────────────────────────┴──────────┴────────────┴───────────┴────────────┘ Examples  C/370 Example You cannot use CEE3SPM to enable the fixed-overflow, decimal-overflow, underflow or significance interrupts. You can, however, query the settings of CEE3SPM. /*COMPILATION UNIT: EDC3SPM */ /*****************************************************/ /* This example queries the enablement of LE/370 */ /* hardware conditions. */ /*****************************************************/ #include #include #include #include int main(void) { _FEEDBACK fc; _INT4 action; _CHAR80 cond_string; char *cond; /* query the current settings */ action = 2; CEE3SPM(&action,cond_string,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3SPM query failed with message %\n", fc.tok_msgno); exit(2999); } }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3SPM ************************************************* ** ** ** Function: CEE3SPM - query and modify LE/370 ** ** hardware condition enablement ** ** ** ** In this example, a call is made to CEE3SPM ** ** to check the setting of the program mask. ** ** See the parameter list of CEE3SPM to ** ** interpret what is returned as CONDSTR in ** ** this example. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBL3SPM. DATA DIVISION. WORKING-STORAGE SECTION. 01 ACTION PIC S9(9) COMP. 01 CONDSTR PIC X(80). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. ** Specify 2 for the QUERY function. ** Pass ACTION in the call to CEE3SPM to return ** the condition string DISPLAY results. PARA-CBL3SPM. MOVE 2 TO ACTION. CALL 'CEE3SPM' USING ACTION , CONDSTR , FC. IF CEE000 of FC THEN DISPLAY 'The current setting of the ', 'program mask is: ' CONDSTR ELSE DISPLAY 'CEE3SPM failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBM3SPM */ /****************************************************/ /** */ /** Function: CEE3SPM - Query and Modify LE/370 */ /** Hardware Condition Enablement */ /** */ /** This example calls CEE3SPM to query the current */ /** setting of the program mask. See the parameter */ /** list of CEE3SPM to interpret what is returned */ /** as CONDSTR in this example. */ /** */ /****************************************************/ PLI3SPM: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL ACTION INT4; DCL CONDSTR CHAR80; DCL 01 FC FEEDBACK; /* Call CEE3SPM to query the current setting of */ /* the program mask */ ACTION = 2 /* Specify action code 2 to query */ /* the program mask */; CALL CEE3SPM ( ACTION, CONDSTR, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The initial setting of the program mask is: ' || CONDSTR ); END; ELSE DO; DISPLAY( 'CEE3SPM failed with msg ' || FC.MsgNo ); STOP; END; /* Call CEE3SPM to enable specification exceptions */ ACTION = 1 /* Specify action code 1 to SET the */ /* program mask */; CONDSTR = 'S' /* Specify a program mask that will */ /* allow specification exceptions */ /* (all others remain unchanged) */; CALL CEE3SPM ( ACTION, CONDSTR, FC ); IF к FBCHECK( FC, CEE000) THEN DO; DISPLAY( 'CEE3SPM failed with msg ' || FC.MsgNo ); STOP; END; CALL CEE3SPM ( 2, CONDSTR, FC ); /* Query settings */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The new setting of the program mask is: ' || CONDSTR ); END; ELSE DO; DISPLAY( 'CEE3SPM failed with msg ' || FC.MsgNo ); STOP; END; END PLI3SPM; ═══ 3.3.14. CEE3SRC-Set the Enclave Return Code ═══ CEE3SRC sets the user enclave return code. The value set is used in the calculation of the final enclave return code at enclave termination. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3SRC──(──return_code──,──fc──)─────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ return_code(input) The enclave return code to be set should be <= 999,999 and >= 0 to be in the LE/370-preferred range, but other values are accepted. (The initial value is 0.) fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0HA │ 1 │ 0554 │ A value outside the LE/370-preferred range of │ │ │ │ │ 0 through 999,999 was supplied. However, the │ │ │ │ │ value was still used as the enclave return │ │ │ │ │ code. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS consideration-CEE3SRC applies to the enclave. Examples CEE3SRC is used with Cee3GRC-see the examples for CEE3GRC, Examples. ═══ 3.3.15. CEE3USR-Set or Query User Area Fields ═══ CEE3USR sets or queries one of two 4-byte fields known as the user area fields. The user area fields are associated with an enclave and are maintained on an enclave basis. A user area can be used by vendor or application programs to store a pointer to a global data area or keep a recursion counter. Be careful not to confuse the LE/370 user area fields with the PL/I user area. The PL/I user area is a 4-byte field in the PL/I TCA and can be accessed only through assembler language. The PL/I user area continues to be supported for compatibility. LE/370 initializes both user area fields to X'00000000' during enclave initialization. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEE3USR──(──function_code──,──field_number──,──field_value──,──fc──)──────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ function_code(input) A fullword binary integer representing the function performed: 1-SET User area field according to the value specified in field_value. 2-QUERY User area field; return current value in field_value. field_number(input) A fullword binary integer indicating the field to set or query. field_number must be specified as either 1 or 2. field_value(input/output) A fullword binary integer. If function_code is specified as 1 (meaning SET user area field), field_value contains the value to be copied to the user area. If function_code is specified as 2 (meaning QUERY user field area), the value in the user area is copied to field_value. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3PS │ 3 │ 3900 │ The function code passed to CEE3USR was not 1 │ │ │ │ │ or 2. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3PT │ 3 │ 3901 │ The field number passed to CEE3USR was not 1 │ │ │ │ │ or 2. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS consideration-CEE3USR applies to the enclave. Examples  C/370 Example /*COMPILATION UNIT: EDC3USR */ #include #include #include #include typedef struct { int value1,value2,value3; char slot1[80]; } info_struct; int main (void) { _INT4 function_code, field_number, field_value; _FEEDBACK fc; info_struct *info; info = (info_struct *)malloc(sizeof(info_struct)); /* . . . */ /* Set User field 1 to point to info_struct */ function_code = 1; field_number = 1; field_value = (int)info; CEE3USR(&function_code,&field_number,&field_value,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3USR failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ /* get the value of field 2 */ function_code = 2; field_number = 1; CEE3USR(&function_code,&field_number,&field_value,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEE3USR failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZT3USR **************************************************** ** ** ** Function: CEE3USR - set or query user area ** ** fields ** ** ** ** In this example, CEE3USR is called twice: once ** ** to set the value of a user area, and once to ** ** query it. ** ** ** **************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBL3USR. DATA DIVISION. WORKING-STORAGE SECTION. 01 FUNCODE PIC S9(9) COMP. 01 FIELDNO PIC S9(9) COMP. 01 INVALUE PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. ** Specify 1 for SET function. ** Specify field number 1 to set the value field ** number 1. ** Specify 23 to make the value of field number 1 ** equal to 23. PARA-3USRSET. MOVE 1 TO FUNCODE. MOVE 1 TO FIELDNO. MOVE 23 TO INVALUE. CALL 'CEE3USR' USING FUNCODE , FIELDNO , INVALUE , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEE3USR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ** Specify 2 for QUERY function. ** Specify field number 1 to query the value ** of field number 1. PARA-3USRQRY. MOVE 2 TO FUNCODE. MOVE 1 TO FIELDNO. CALL 'CEE3USR' USING FUNCODE , FIELDNO , INVALUE , FC. IF CEE000 of FC THEN DISPLAY 'User Area field ' FIELDNO ' is: ' INVALUE; ELSE DISPLAY 'CEE3USR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBM3USR /****************************************************/ /** */ /** Function: CEE3USR - set/query user area fields */ /** */ /** In this example, CEE3USR is called twice: once */ /** to set the value of a user area, and once to */ /** query it. */ /****************************************************/ PLI3USR: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL FUNCODE INT4; DCL FIELDNO INT4; DCL OUTVALUE INT4; DCL INVALUE INT4; DCL 01 FC FEEDBACK; FUNCODE = 1; /* Specify 1 for the set function */ FIELDNO = 1; /* Specify field 1 of two */ INVALUE = 5; /* Value to put in field 1 */ /* Call CEE3USR to set user field 1 to 5 */ CALL CEE3USR ( FUNCODE, FIELDNO, INVALUE, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'LE/370 User field ' || FIELDNO || ' has been set to ' || INVALUE ); END; ELSE DO; DISPLAY( 'CEE3USR failed with msg ' || FC.MsgNo ); STOP; END; /* Call CEE3USR to query the value of field 1 */ FUNCODE = 2; /* Specify 2 for query function */ FIELDNO = 1; /* Specify field 1 of two */ CALL CEE3USR ( FUNCODE, FIELDNO, OUTVALUE, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'LE/370 User field ' || FIELDNO || ' is currently set to ' || OUTVALUE ); END; ELSE DO; DISPLAY( 'CEE3USR failed with msg ' || FC.MsgNo ); STOP; END; END PLI3USR; ═══ 3.3.16. CEECBLDY-Convert Date to COBOL Lilian Format ═══ CEECBLDY converts a string representing a date into a COBOL Lilian format, which is the number of days since 31 December 1600. This service is similar to CEEDAYS, except that it provides an answer in COBOL Lilian format, so that it is compatible with ANSI intrinsic functions. Use CEECBLDY to access the century window of LE/370 and to perform date calculations with intrinsic functions. Call CEECBLDY only from COBOL programs that use the returned value as input for COBOL intrinsic functions. You should not use the returned value with other LE/370 callable services, nor should you call CEECBLDY from any non-COBOL programs. Unlike CEEDAYS, there is no inverse function for CEECBLDY, because it is only for COBOL users who want to use the LE/370 century window service together with COBOL intrinsic functions for date calculations. The inverse function for CEECBLDY is provided by the DATE-OF-INTEGER and DAY-OF-INTEGER intrinsic functions. To handle dates earlier than 1582, add 4000 to each year, convert to Lilian, calculate, subtract 4000 from the result, and then convert back to character format. By default, 2-digit years lie within the 100-year range starting 80 years prior to the system date. Thus, in 1993, all 2-digit years represent dates between 1913 and 2012, inclusive. You change this default range by using the CEESCEN callable service (see CEESCEN-Set the Century Window). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEECBLDY──(──input_char_date──,──picture_string──,──output_Lilian_date──,──fc──)──────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ input_char_date (input) A character string representing a date or timestamp, in a format conforming to that specified by picture_string. The character string must contain between 5 and 255 characters, inclusive. input_char_date can contain leading or trailing blanks. Parsing for a date begins with the first nonblank character (unless the picture string itself contains leading blanks, in which case CEECBLDY skips exactly that many positions before parsing begins). After parsing a valid date, as determined by the format of the date specified in picture_string, CEECBLDY ignores all remaining characters. Valid dates range between and include 01 January 1600 to 31 December 9999. See Picture Terms Used in Picture Strings for a list of valid picture character terms that can be specified in input_char_date. picture_string (input) A VSTRING, that is, a length-prefixed character string, indicating the format of the date specified in input_char_date. Each character in the picture_string corresponds to a character in input_char_date. For example, if you specify MMDDYY as the picture_string, CEECBLDY reads an input_char_date of 060288 as 02 June 1988. If delimiters such as the slash (/) appear in the picture string, leading zeros can be omitted. For example, the following calls to CEECBLDY: MOVE '6/2/88' TO DATEVAL. MOVE 'MM/DD/YY' TO PICTSTR. CALL CEECBLDY USING DATEVAL, PICSTR, lildate, fc); MOVE '06/02/88' TO DATEVAL. MOVE 'MM/DD/YY' TO PICTSTR. CALL CEECBLDY USING DATEVAL, PICSTR, lildate, fc); MOVE '060288' TO DATEVAL. MOVE 'MM/DD/YY' TO PICTSTR. CALL CEECBLDY USING DATEVAL, PICSTR, lildate, fc); MOVE '88154' TO DATEVAL. MOVE 'MM/DD/YY' TO PICTSTR. CALL CEECBLDY USING DATEVAL, PICSTR, lildate, fc); would each assign the same value, 148155 (02 June 1988), to lildate. Whenever characters such as colons or slashes are included in the picture_string (such as HH:MI:SS YY/MM/DD), they count as place-holders but are otherwise ignored. See Picture Terms Used in Picture Strings for a list of valid picture characters, and Examples of Picture Terms Recognized by Date/Time Services for examples of valid picture strings. If picture_string includes a Japanese Era symbol , the YY position in input_char_date is replaced by the year number within the Japanese Era. For example, the year 1988 equals the Japanese year 63 in the Showa era. See Examples of Picture Terms Recognized by Date/Time Services for an additional example. See also Japanese Eras Used by Date/Time Services when Specified for a list of Japanese Eras supported by CEEDATE. If picture_string includes an ROC Era symbol or , the YY position in input_char_date is replaced by the year number within the ROC (Republic of China) Era. For example, the year 1988 equals the ROC year 77 in the MinKow Era. See Examples of Picture Terms Recognized by Date/Time Services for an additional example. See Republic of China Eras Used by Date/Time Services when or Specified for a list of ROC Eras supported by CEEDATE. output_Lilian_date (output) A 32-bit binary integer representing the COBOL Lilian date, the number of days since 31 December 1600. For example, 16 May 1988 is day number 141485. If input_char_date does not contain a valid date, output_Lilian_date is set to 0 and CEECBLDY terminates with a non-CEE000 symbolic feedback code. Date calculations are performed easily on the output_Lilian_date, because it is an integer. Leap year and end-of-year anomalies are avoided. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EB │ 3 │ 2507 │ Insufficient data was passed to CEEDAYS or │ │ │ │ │ CEESECS. The Lilian value was not calculated. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EC │ 3 │ 2508 │ The date value passed to CEEDAYS or CEESECS │ │ │ │ │ was invalid. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2ED │ 3 │ 2509 │ The Japanese or Republic of China Era passed │ │ │ │ │ to CEEDAYS or CEESECS was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EH │ 3 │ 2513 │ The input date was not within the supported │ │ │ │ │ range. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EL │ 3 │ 2517 │ The month value was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EM │ 3 │ 2518 │ An invalid picture string was specified. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EO │ 3 │ 2520 │ CEEDAYS detected non-numeric data in a numeric │ │ │ │ │ field, or the date string did not match the │ │ │ │ │ picture string. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EP │ 3 │ 2521 │ The Japanese or Chinese year-within-Era value │ │ │ │ │ passed to CEEDAYS or CEESECS was zero. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  The probable cause for receiving message number 2518 is a picture string that contains an invalid DBCS string. You should verify that the data in the picture string is correct.  OpenEdition MVS consideration-In multithread applications, CEECBLDY affects only the calling thread. Examples  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTCBLD ******************************************* ** ** ** Function: CEECBLDY - convert date to ** ** COBOL Lilian format. This service is ** ** used when using the LE/370 Century ** ** Window mixed with COBOL Intrinsic ** ** Functions. ** ** ** ******************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLDY. DATA DIVISION. WORKING-STORAGE SECTION. 01 CHRDATE. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of CHRDATE. 01 PICSTR. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of PICSTR. 01 LILIAN PIC S9(9) COMP. 01 NEWDATE PIC 9(8). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLDAYS. ** Specify input date and length MOVE 25 TO Vstring-length of CHRDATE. MOVE '1 January 00' to Vstring-text of CHRDATE. ** Specify a picture string that describes ** input date, and the picture string's length. MOVE 23 TO Vstring-length of PICSTR. MOVE 'ZD Mmmmmmmmmmmmmmz YY' TO Vstring-text of PICSTR. ** Call CEECBLDY to convert input date to a ** COBOL Lilian date CALL 'CEECBLDY' USING CHRDATE , PICSTR , LILIAN , FC. ** If CEECBLDY runs successfully, then compute ** the date of the the 90th day after the ** input date using Intrinsic Functions IF CEE000 of FC THEN COMPUTE LILIAN = LILIAN + 90 COMPUTE NEWDATE = FUNCTION DATE-OF-INTEGER (LILIAN) DISPLAY NEWDATE ' is Lilian day: ' LILIAN ELSE DISPLAY 'CEEBLDY failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK. ═══ 3.3.17. CEECMI-Store and Load Message Insert Data ═══ CEECMI copies message insert data and loads the address of that data into the Instance Specific Information (ISI) associated with the condition being processed, after allocating storage for the ISI, if necessary. The number of ISIs per thread is determined by the MSGQ run-time option. See MSGQ. ISIs are released when the value specified in the MSGQ run-time option is exceeded. The least recently used ISI is overwritten. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEECMI──(──cond_rep──,── insert_seq_num──,──insert_data──,──fc──)─────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ cond_rep (input/output) A condition token that defines the condition for which the q_data_token is retrieved. insert_seq_num (input) A 4-byte integer that contains the insert sequence number (such as insert 1 insert 2). It corresponds to an insert number specified with an ins tag in the message source file created by the CEEBLDTX utility. insert_data (input) A halfword prefixed length string that represents the insert data. The entire length described in the halfword prefix is used without truncation. DBCS strings must be enclosed within shift-out (X'0E') and shift-in (X'0F') characters. The maximum size for an individual insert_data item is 254 bytes. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0EB │ 3 │ 0459 │ Not enough storage was available to create a │ │ │ │ │ new instance specific information block. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0EC │ 1 │ 0460 │ Multiple instances of the condition token with │ │ │ │ │ message number message-number and facility ID │ │ │ │ │ facility-id were detected. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0ED │ 3 │ 0461 │ The maximum number of unique message insert │ │ │ │ │ blocks was reached. This condition token had │ │ │ │ │ its IS-data field set to 1. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0EE │ 3 │ 0462 │ Instance specific information for the condi- │ │ │ │ │ tion token with message number message-number │ │ │ │ │ and facility ID facility-id could not be │ │ │ │ │ found. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0EF │ 3 │ 0463 │ The maximum size for an insert data item was │ │ │ │ │ exceeded. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0H9 │ 3 │ 0553 │ An internal error was detected in populating │ │ │ │ │ the inserts for a condition. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS consideration-In multithread applications, CEECMI affects message insert data for only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCCMI */ /************************************************** ** * ** FUNCTION: CEENCOD - set up a condition token * ** : CEECMI - store and load message * ** insert data * ** : CEEMSG - retrieve, format, and * ** dispatch a message to * ** message file * ** * ** This example illustrates the invocation of * ** the LE/370 message services to store and * ** load message insert data. * ** The resulting message and insert is written * ** to the LE/370 MSGFILE ddname. * ** * **************************************************/ #include #include #include #include void main () { _INT2 c_1,c_2,cond_case,sev,control; _CHAR3 facid; _INT4 isi; _VSTRING insert; _FEEDBACK ctok; _FEEDBACK fbcode; _INT4 MSGFILE; _INT4 insert_no ; /* Condition Token Declarations */ /**************************************************** * EXMPLMSG is a token that represents message * * number 10 in a user message file constructed * * using the CEEBLDTXT facility. * * Message 10 is designed to allow one insert. * ****************************************************/ insert.length = 18; memcpy(insert.string ,"", insert.length); /*give ctok value of hex 0000000A40E7D4D700000000 */ /*sev = 0 msgno = 10 facid = XMP */ c_1 = 0; c_2 = 10; cond_case = 1; sev = 0; control = 0; memcpy(facid,"XMP",3); isi = 0; /********************************************/ /* Call CEENCOD to set-up a condition token */ /********************************************/ CEENCOD(&c_1,&c_2,&cond_case,&sev,&control, facid,&isi,&ctok,&fbcode); if ( _FBCHECK ( fbcode , CEE000 ) != 0 ) printf("CEENCOD failed with message number %d\n", fbcode.tok_msgno); /******************************************/ /* Call CEECMI to create a message insert */ /******************************************/ CEECMI(&ctok, &insert_no, &insert, &fbcode); /* ADDED BY ROB */ if ( _FBCHECK ( fbcode , CEE000 ) != 0 ) printf("CEECMI failed with message number %d\n", fbcode.tok_msgno); /******************************************/ /* Call CEEMSG to issue the message */ /******************************************/ CEEMSG(&ctok, &MSGFILE , &fbcode); /* ADDED BY ROB */ if ( _FBCHECK ( fbcode , CEE000 ) != 0 ) printf("CEEMSG failed with message number %d\n", fbcode.tok_msgno); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTCMI *********************************************** ** * ** Function: CEECMI - Store and load message * ** insert data * ** : CEENCOD - Construct a condition * ** token * ** : CEEMSG - Dispatch a Message. * ** * ** This example illustrates the invocation * ** of the LE/370 message services to * ** store and load message insert data. * ** CEENCOD is called to construct a token * ** for a user defined message (message 10) * ** in a user message file. * ** CEECMI is called to insert text into * ** message 10. The resulting message and * ** insert is written to the MSGFILE. * ** * *********************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLCMI. DATA DIVISION. WORKING-STORAGE SECTION. 01 INSERTNO PIC S9(9) COMP. 01 CTOK PIC X(12). 01 FBCODE. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 MSGDEST PIC S9(9) COMP. 01 SEV PIC S9(4) COMP. 01 MSGNO PIC S9(4) COMP. 01 CASE PIC S9(4) COMP. 01 SEV2 PIC S9(4) COMP. 01 CNTRL PIC S9(4) COMP. 01 FACID PIC X(3). 01 ISINFO PIC S9(9) COMP. 01 VSTRING. 05 INSERT-TXTL PIC S9(4) COMP. 05 INSERT-TXT PIC X(80). PROCEDURE DIVISION. PARA-CEPGCMI. * ******************************************** * Set up token fields for creation of a * condition token for the user defined * message file and message number. * ******************************************** MOVE 0 TO SEV. MOVE 10 TO MSGNO. MOVE 1 TO CASE. MOVE 0 TO SEV2. MOVE 0 TO CNTRL. MOVE 'XMP' TO FACID. MOVE 0 TO ISINFO. * ******************************************** * Call CEENCOD to construct a condition token * ******************************************** CALL 'CEENCOD' USING SEV , MSGNO , CASE , SEV2 , CNTRL , FACID , ISINFO , CTOK , FBCODE. IF NOT CEE000 of FBCODE THEN DISPLAY 'CEENCOD failed with msg' Msg-No of FBCODE UPON CONSOLE; STOP RUN; END-IF. * ******************************************** * Call CEECMI to store and load message * insert 1. * ******************************************** MOVE '' TO INSERT-TXT. MOVE 19 TO INSERT-TXTL. MOVE 1 TO INSERTNO. CALL 'CEECMI' USING CTOK, INSERTNO, VSTRING. * ******************************************** * Call CEEMSG to write message to MSGFILE * ******************************************** MOVE 2 TO MSGDEST. CALL 'CEEMSG' USING CTOK , MSGDEST , FBCODE. IF NOT CEE000 of FBCODE THEN DISPLAY 'CEEMSG failed with msg ' Msg-No of FBCODE UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; IBMCMI: Proc Options(Main); /*************************************************** ** * ** FUNCTION : CEECMI - store and load message * ** insert data * ** : CEEMSG - retrieve, format, and * ** dispatch a message to * ** message file * ** * ** This example illustrates the invocation of * ** LE/370 message services to store and load * ** message insert data. The resulting message * ** and insert are written to the MSGFILE. * ** * **************************************************/ %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DECLARE INSERT VSTRING; DECLARE 01 CTOK FEEDBACK; DECLARE 01 FBCODE FEEDBACK; DECLARE MSGFILE INT4; DECLARE INSERT_NO INT4; /*************************************************/ /* Ctok is initialized in the DECLARE statement */ /* to message 10 in a user message file */ /* constructed using the CEEBLDTX tool. */ /* Message 10 is designed to allow one insert. */ /* The message facility ID is XMP. */ /*************************************************/ insert = ''; insert_no = 1; /******************************************/ /* Call CEECMI to create a message insert */ /******************************************/ Call CEECMI(ctok, insert_no, insert, *); /******************************************/ /* Call CEEMSG to issue the message */ /******************************************/ MSGFILE = 2; Call CEEMSG(ctok, MSGFILE, *); End IBMCMI; ═══ 3.3.18. CEECRHP-Create New Additional Heap ═══ CEECRHP lets you define additional heaps. It returns a unique heap_id. The heaps defined by CEECRHP can be used just like the initial heap (heap_id=0), below heap, and anywhere heap. Unlike the heaps created by these heap services, all heap elements within an additional heap can be quickly freed by a single call to CEEDSHP (discard heap). See CEEDSHP-Discard Heap. The opposite of CEECRHP is CEEDSHP, which discards an entire heap. The number of heaps supported by LE/370 is limited only by the amount of virtual storage available. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEECRHP──(──heap_id──,──initial_size──,──increment──,──options──,──fc──)──────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ heap_id (output) A fullword binary signed integer. heap_id is the heap identifier of the created heap. If a new heap cannot be created, the value of heap_id remains undefined. Storage obtained from heap_ids 79 and 80 is set to binary 0 independent of any initialization value specified by the STORAGE option. initial_size (input) A fullword binary signed integer. initial_size is the initial amount of storage, in bytes, allocated for the new heap. initial_size is rounded up to the nearest increment of 4096 bytes. If initial_size is specified as 0, then the init_size specified in the HEAP run-time option is used. If no HEAP run-time option was provided and initial_size is specified as 0, CEECRHP uses the installation default. See HEAP for more information about the HEAP run-time option and IBM-supplied defaults. increment (input) A fullword binary signed integer. When it is necessary to enlarge the heap to satisfy an allocation request, increment represents the number of bytes by which the heap is extended. increment is rounded up to the nearest 4096 bytes. If increment is specified as 0, then the incr_size specified in the HEAP run time option is used. If no HEAP run-time option was provided and increment equals 0, CEECRHP uses the installation default. See HEAP for more information about the HEAP run-time option and IBM-supplied defaults. options (input) A fullword binary signed integer. options are specified with the decimal codes as shown in HEAP Attributes Based on the Setting of the options Parameter. ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 17. HEAP Attributes Based on the Setting of the options Parameter │ ├───────────────────┬──────────────────────────────────────────────────────────────────────────────┤ │ OPTION SETTING │ HEAP ATTRIBUTES │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 00 │ Use same attributes as the initial heap (copy them from the HEAP run-time │ │ │ option) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 01 │ HEAP(,,,FREE) (location inherited from HEAP run-time option) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 70 │ HEAP(,,,KEEP) (location inherited from HEAP run-time option) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 71 │ HEAP(,,ANYWHERE,KEEP) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 72 │ HEAP(,,ANYWHERE,FREE) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 73 │ HEAP(,,BELOW,KEEP) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 74 │ HEAP(,,BELOW,FREE) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 75 │ HEAP(,,ANYWHERE,)(disposition inherited from the HEAP run-time option) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 76 │ HEAP(,,BELOW,)(disposition inherited from the HEAP run-time option) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 77 │ HEAP(,,ANYWHERE,KEEP) (all heap storage obtained using this heap_id is allo- │ │ │ cated on a 4K boundary) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 78 │ HEAP(,,ANYWHERE,FREE) (all heap storage obtained using this heap_id is allo- │ │ │ cated on a 4K boundary) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 79 │ HEAP(,,ANYWHERE,KEEP) (all heap storage obtained using this heap_id is set │ │ │ to binary 0 when allocated using CEEGTST) │ ├───────────────────┼──────────────────────────────────────────────────────────────────────────────┤ │ 80 │ HEAP(,,ANYWHERE,FREE) (all heap storage obtained using this heap_id is set │ │ │ to binary 0 when allocated using CEEGTST) │ └───────────────────┴──────────────────────────────────────────────────────────────────────────────┘ fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P2 │ 4 │ 0802 │ Heap storage control information was damaged. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P4 │ 3 │ 0804 │ The initial size value supplied in a create │ │ │ │ │ heap request was unsupported. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P5 │ 3 │ 0805 │ The increment size value supplied in a create │ │ │ │ │ heap request was unsupported. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P6 │ 3 │ 0806 │ The options value supplied in a create heap │ │ │ │ │ request was unrecognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0PD │ 3 │ 0813 │ Insufficient storage was available to satisfy │ │ │ │ │ a get storage request. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS consideration-CEECRHP applies to the enclave. Examples  C/370 Example /*COMPILATION UNIT: EDCCRHP */ #include #include #include #include int main(void) { _INT4 heapid, size, increment, options; _FEEDBACK fc; /* . . . */ heapid = 0; /* heap identifier is set */ /* by CEECRHP */ size = 4096; /* initial size of heap (in */ /* bytes) */ increment = 4096; /* increment to extend heap by */ options = 72; /* set up heap as */ /* (,,ANYWHERE,FREE) */ /* create heap using CEECRHP */ CEECRHP(&heapid,&size,&increment,&options,&fc); /* check the first 4 bytes of the feedback token */ /* (0 if successful) */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEECRHP failed with message number %d\n", fc.tok_msgno); exit(99); } /* . . . */ /* discard the heap that was previously created */ /* using CEECRHP */ CEEDSHP(&heapid,&fc); /* check the first 4 bytes of the feedback token */ /* (0 if successful) */ if ( _FBCHECK ( fc , CEE000) != 0 ) { printf("CEEDSHP failed with message number %d\n", fc.tok_msgno); exit(99); } /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTCRHP *********************************************** ** ** ** Function: CEECRHP - create new additional ** ** heap ** ** ** *********************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLCRHP. DATA DIVISION. WORKING-STORAGE SECTION. 01 HEAPID PIC S9(9) COMP. 01 HPSIZE PIC S9(9) COMP. 01 INCR PIC S9(9) COMP. 01 OPTS PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. ** Specify 0 for HEAPID, and heap id will be ** set by CEECRHP. ** Heap size and increment will each be ** 4096 bytes. ** Specify 00 for OPTS, and HEAP attributes ** will be inherited from the initial heap ** (copied from the HEAP run-time option). MOVE 0 TO HEAPID. MOVE 4096 TO HPSIZE. MOVE 4096 TO INCR. MOVE 00 TO OPTS. CALL 'CEECRHP' USING HEAPID , HPSIZE , INCR , OPTS , FC. IF CEE000 of FC THEN DISPLAY 'Created heap number ' HEAPID ' which is ' HPSIZE ' bytes long' ELSE DISPLAY 'CEECRHP failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMCRHP */ /**************************************************/ /** */ /** Function: CEECRHP - create new additional */ /** heap */ /** */ /** In this example, CEECRHP is called to set up */ /** a new additional heap of 4096 bytes. Each */ /** time the heap needs to be extended, an */ /** increment of 4096 bytes will be added. */ /** */ /**************************************************/ PLICRHP: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL HEAPID INT4 ; DCL HPSIZE INT4 ; DCL INCR INT4 ; DCL OPTS INT4 ; DCL 01 FC FEEDBACK ; HEAPID = 0; /* HEAPID will be set and */ /* returned by CEECRHP */ HPSIZE = 4096; /* Initial size of heap, */ /* in bytes */ INCR = 4096; /* Number of bytes to extend */ /* heap by */ OPTS = 00; /* Set up heap with the same */ /* attributes as the */ /* initial heap (HEAPID = 0) */ /* Call CEECRHP to set up new heap */ CALL CEECRHP ( HEAPID, HPSIZE, INCR, OPTS, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Created heap number ' || HEAPID || ' consisting of ' || HPSIZE || ' bytes' ); END; ELSE DO; DISPLAY( 'CEECRHP failed with msg ' || FC.MsgNo ); STOP; END; END PLICRHP; ═══ 3.3.19. CEECZST-Reallocate (Change Size of) Storage ═══ CEECZST changes the size of a previously allocated heap element. The address parameter points to the beginning of the heap element. The new_size parameter gives the new size of the heap element, in bytes. The contents of the heap element are unchanged up to the shorter of the new and old sizes. The CEECZST service returns a pointer to the reallocated heap element. It can move the storage location of the heap element. As a result, the address parameter passed to CEECZST is not necessarily the same as the value returned. Because the new storage might be allocated at a different location from the existing allocation, any pointers (specifically any machine addresses) that referred to the old storage become invalid. Continued use of such dangling pointers gives unpredictable, and almost certainly incorrect, results. The heap identifier is inferred from the address. The new storage block is allocated from the same heap that contained the old block. The contents of the old storage are preserved in the following manner:  If new_size is equal to or greater than the old size, the entire contents of the old storage block are copied to the new block. The remaining bytes in the new element are left uninitialized (unless the STORAGE run-time option is in effect-see STORAGE for more information).  If new_size is less than the old size, the contents of the old block are truncated to the size of the new block.  If new_size is equal to the old size, no operations are performed; a successful feedback code is returned. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEECZST──(──address──,──new_size──,──fc──)────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ address (input/output) A fullword address pointer. On input, this parameter contains an address returned by a previous CEEGTST call. For information about CEEGTST, see CEEGTST-Get Heap Storage. On output, the address of the first byte of the newly allocated storage is returned in this parameter. new_size (input) A fullword binary signed integer. new_size is the number of bytes of storage to be allocated for the new heap element. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P2 │ 4 │ 0802 │ Heap storage control information was damaged. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P8 │ 3 │ 0808 │ Storage size in a get storage request or a │ │ │ │ │ re-allocate request was not a positive number. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0PA │ 3 │ 0810 │ The storage address in a free storage request │ │ │ │ │ was not recognized, or heap storage control │ │ │ │ │ information was damaged. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0PD │ 3 │ 0813 │ Insufficient storage was available to satisfy │ │ │ │ │ a get storage request. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  Storage that is reallocated maintains the same mark/release status as the old storage block. If the old storage block was marked, the new storage block carries the same mark and is released by a release operation that specifies that mark.  OpenEdition MVS consideration-CEECZST applies to the enclave. Examples  C/370 Example /*COMPILATION UNIT: EDCCZST */ #include #include #include #include int main(void) { _INT4 heapid, size; _POINTER address; _FEEDBACK fc; /* . . . */ heapid = 0; /* get storage from initial heap */ size = 4000; /* number of bytes of heap storage */ /* obtain the storage using CEEGTST */ CEEGTST(&heapid,&size,&address,&fc); /* check the first 4 bytes of the feedback token */ /* (0 if successful) */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEGTST failed with message number %d\n", fc.tok_msgno); exit(99); } /* . . . */ size = 2000; /* new size of storage element */ /* change the size of the storage element */ CEECZST(&address,&size,&fc); /* check the first 4 bytes of the feedback token */ /* (0 if successful) */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEECZST failed with message number %d\n", fc.tok_msgno); exit(99); } /* . . . */ /* free the storage that was previously obtained */ /* using CEEGTST */ CEEFRST(&address,&fc); /* check the first 4 bytes of the feedback token */ /* (0 if successful) */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEFRST failed with message number %d\n", fc.tok_msgno); exit(99); } /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTCZST ************************************************ ** ** ** Function: CEECZST - reallocate storage ** ** ** ** In this example, CEEGTST is called to ** ** request storage from HEAPID = 0, and ** ** CEECZST is called to change the size of ** ** that storage request. ** ** ** ** ** ************************************************ IDENTIFICATION DIVISION. PROGRAM-ID. CBLCZST. DATA DIVISION. WORKING-STORAGE SECTION. 01 HEAPID PIC S9(9) COMP. 01 HPSIZE PIC S9(9) COMP. 01 ADDRSS PIC S9(9) COMP. 01 NEWSIZE PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLGTST. ** Specify 0 to get storage from the initial ** heap. Specify 4000 to get 4000 bytes of ** storage. MOVE 0 TO HEAPID. MOVE 4000 TO HPSIZE. ** Call CEEGTST to obtain storage. CALL 'CEEGTST' USING HEAPID , HPSIZE , ADDRSS , FC. ** If CEEGTST runs successfully, display result. IF CEE000 OF FC THEN DISPLAY ' ' HPSIZE ' bytes have been allocated.' ELSE DISPLAY 'CEEGTST failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ** Specify a new size of 2000 bytes. MOVE 2000 TO NEWSIZE. ** Call CEECZST to change the size of the ** storage allocated in the call to CEEGTST. CALL 'CEECZST' USING ADDRSS , NEWSIZE , FC. ** If CEECZST runs successfully, display result. IF CEE000 OF FC THEN DISPLAY 'The storage element now contains ' NEWSIZE ' bytes.' ELSE DISPLAY 'CEEGTST failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMCZST */ /***************************************************/ /** **/ /** Function: CEECZST - reallocate storage **/ /** **/ /** In this example, CEEGTST is called to request **/ /** storage from HEAPID = 0, and CEECZST is called**/ /** to change the size of that storage request. **/ /** **/ /** **/ /***************************************************/ PLICZST: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL HEAPID INT4 ; DCL STGSIZE INT4 ; DCL ADDRSS1 POINTER; DCL 01 FC1 FEEDBACK ; DCL ADDRSS2 POINTER; DCL NEWSIZE INT4 ; DCL 01 FC2 FEEDBACK ; HEAPID = 0; /* get storage from initial heap */ STGSIZE = 4000; /* get 4000 bytes of storage */ /* Call CEEGTST to obtain the storage */ CALL CEEGTST ( HEAPID, STGSIZE, ADDRSS1, FC1 ); IF FBCHECK( FC1, CEE000) THEN DO; PUT SKIP LIST( 'Obtained ' || STGSIZE || ' bytes of storage at location ' || DECIMAL( UNSPEC( ADDRSS1 ) ) || ' from heap ' || HEAPID ); END; ELSE DO; DISPLAY( 'CEEGTST failed with msg ' || FC1.MsgNo ); STOP; END; NEWSIZE = 2000; /* change size of HEAPID 0 to 2000 bytes */ /* Call CEECZST to change the size of storage */ ADDRSS2 = ADDRSS1; CALL CEECZST ( ADDRSS2, NEWSIZE , FC2 ); IF FBCHECK( FC2, CEE000) THEN DO; PUT SKIP LIST( 'Obtained ' || NEWSIZE || ' bytes of storage at location ' || DECIMAL( UNSPEC( ADDRSS1 ) ) ); PUT SKIP LIST( 'Original ' || STGSIZE || ' bytes of storage at location ' || DECIMAL( UNSPEC( ADDRSS1 ) ) || ' no longer valid' ); END; ELSE DO; DISPLAY( 'CEECZST failed with msg ' || FC2.MsgNo ); STOP; END; END PLICZST; ═══ 3.3.20. CEEDATE-Convert Lilian Date to Character Format ═══ CEEDATE converts a number representing a Lilian date to a date written in character format. The output is a character string, such as 1993/09/09. The inverse of CEEDATE is CEEDAYS, which converts character dates to the Lilian format. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEDATE──(──input_Lilian_date──,──picture_string──,──output_char_date──,──fc──)───────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ input_Lilian_date (input) A 32-bit integer representing the Lilian date. The Lilian date is the number of days since 14 October 1582. For example, 16 May 1988 is Lilian day number 148138. The valid range of Lilian dates is 1 to 3,074,324 (15 October 1582 to 31 December 9999). picture_string (input) VSTRING, a length-prefixed character string, representing the desired format of output_char_date, for example MM/DD/YY. Each character in picture_string represents a character in output_char_date. If delimiters such as the slash (/) appear in the picture string, they are copied as is to output_char_date. See Picture Terms Used in Picture Strings for a list of valid picture characters, and Examples of Picture Terms Recognized by Date/Time Services for examples of valid picture strings. If picture_string is null or blank, CEEDATE obtains picture_string based on the current value of the COUNTRY run-time option. For example, if the current value of the COUNTRY run-time option is US (United States), the date format would be MM/DD/YY. If the current COUNTRY value is FR (France), the date format would be MM/DD/YY HH:MM:SS AM (or PM)., for instance, 09/09/93 4:29 PM. This default mechanism makes it easy for translation centers to specify the preferred date, and for applications and library routines to use this format automatically. See COUNTRY for more information about the COUNTRY run-time option and CEEFMDA-Get Default Date Format for information about how to obtain the default format for a given country code. If picture_string includes a Japanese Era symbol , the YY position in output_char_date is replaced by the year number within the Japanese Era. For example, the year 1988 equals the Japanese year 63 in the Showa era. See Examples of Picture Terms Recognized by Date/Time Services for an additional example. Also see Japanese Eras Used by Date/Time Services when Specified for a list of Japanese Eras supported by CEEDATE. If picture_string includes an ROC Era symbol or , the YY position in output_char_date is replaced by the year number within the ROC (Republic of China) Era. For example, the year 1988 equals the ROC year 77 in the MinKow Era. See Examples of Picture Terms Recognized by Date/Time Services for an additional example. Also see Republic of China Eras Used by Date/Time Services when or Specified for the list of ROC Eras supported by CEEDATE. output_char_date (output) VSTRING, a fixed-length 80-character string, is the result of converting input_Lilian_date to the format specified by picture_string. See Sample Output of CEEDATE for sample output dates. If input_Lilian_date is invalid, output_char_ date is set to all blanks. CEEDATE terminates with a non-CEE000 symbolic feedback code. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EG │ 3 │ 2512 │ The Lilian date value was not within the sup- │ │ │ │ │ ported range. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EM │ 3 │ 2518 │ An invalid picture string was specified. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EQ │ 3 │ 2522 │ , or was used in a │ │ │ │ │ picture string passed to CEEDATE, but the │ │ │ │ │ Lilian date value was not within the supported │ │ │ │ │ range. The Era could not be determined. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EU │ 2 │ 2526 │ The date string returned by CEEDATE was trun- │ │ │ │ │ cated. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  The probable cause for receiving message number 2518 is a picture string that contains an invalid DBCS string. You should verify that the data in the picture string is correct.  OpenEdition MVS consideration-In multithread applications, CEEDATE applies to the enclave. Examples  C/370 Example /*COMPILATION UNIT: EDCDATE */ #include #include #include #include int main(void) { _FEEDBACK fc; _INT4 lil_date = 139370; /* May 14, 1964 */ _VSTRING date_pic,date; _CHAR80 date_out; strcpy(date_pic.string, "The date is Wwwwwwwwwz, Mmmmmmmmmz ZD, YYYY"); date_pic.length = strlen(date_pic.string); CEEDATE(&lil_date,17 May 1994_pic,date_out,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEDATE failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("%.80s\n",date_out); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTDATE ************************************************ ** ** ** Function: CEEDATE - convert Lilian date to ** ** character format ** ** ** ** In this example, a call is made to CEEDATE ** ** to convert a Lilian date (the number of ** ** days since 14 October 1582) to a character ** ** format (such as 6/22/88). The result is ** ** displayed. ** ** ** ************************************************ IDENTIFICATION DIVISION. PROGRAM-ID. CBLDATE. DATA DIVISION. WORKING-STORAGE SECTION. 01 LILIAN PIC S9(9) COMP. 01 CHRDATE PIC X(80). 01 IN-DATE. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of IN-DATE. 01 PICSTR. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of PICSTR. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLDAYS. ** Call CEEDAYS to convert date of 6/2/88 to ** Lilian representation MOVE 6 TO Vstring-length of IN-DATE. MOVE '6/2/88' TO Vstring-text of IN-DATE(1:6). MOVE 8 TO Vstring-length of PICSTR. MOVE 'MM/DD/YY' TO Vstring-text of PICSTR(1:8). CALL 'CEEDAYS' USING IN-DATE, PICSTR, LILIAN, FC. ** If CEEDAYS runs successfully, display result. IF CEE000 of FC THEN DISPLAY Vstring-text of IN-DATE ' is Lilian day: ' LILIAN ELSE DISPLAY 'CEEDAYS failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ** Specify picture string that describes the ** desired format of the output from CEEDATE, ** and the picture string's length. MOVE 23 TO Vstring-length OF PICSTR. MOVE 'ZD Mmmmmmmmmmmmmmz YYYY' TO Vstring-text OF PICSTR(1:23). ** Call CEEDATE to convert the Lilian date ** to a picture string. CALL 'CEEDATE' USING LILIAN, PICSTR, CHRDATE, FC. ** If CEEDATE runs successfully, display result. IF CEE000 of FC THEN DISPLAY 'Input Lilian date of ' LILIAN ' corresponds to: ' CHRDATE ; ELSE DISPLAY 'CEEDATE failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMDATE */ /***********************************************/ /** */ /** Function: CEEDATE - convert Lilian date to */ /** character format */ /** */ /** In this example, a call is made to CEEDATE */ /** to convert a date in the Lilian format */ /** (the number of days since 14 October 1582) */ /** to a date in character format. This date */ /** is then printed out. */ /** */ /********************************************* */ PLIDATE: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL LILIAN INT4 ; DCL PICSTR VSTRING; DCL CHRDATE CHAR80 ; DCL 01 FC FEEDBACK ; LILIAN = 152385; /* input date in Lilian format */ /* picture string that describes how converted */ /* date is to be formatted */ PICSTR = 'ZD Mmmmmmmmmmmmmmz YYYY'; /* Call CEE3DATE to convert input Lilian date to */ /* a date in the character format specified in */ /* PICSTR */ CALL CEEDATE ( LILIAN , PICSTR , CHRDATE , FC ); /* Print results if call to CEEDATE succeeds */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Lilian day ' || LILIAN || ' is equivalent to ' || CHRDATE ); END; ELSE DO; DISPLAY( 'CEEDATE failed with msg ' || FC.MsgNo ); STOP; END; END PLIDATE; Sample Output of CEEDATE shows the sample output from CEEDATE. ┌──────────────────────────────────────────────────────────────────────────┐ │ Table 18. Sample Output of CEEDATE │ ├──────────────────┬────────────────────────────────┬──────────────────────┤ │ │ │ │ │ INPUT_LILIAN_DATE│ PICTURE_STRING │ OUTPUT_CHAR_DATE │ ├──────────────────┼────────────────────────────────┼──────────────────────┤ │ 148138 │ "YY" │ 88 │ │ │ "YYMM" │ 8805 │ │ │ "YY-MM" │ 88-05 │ │ │ "YYMMDD" │ 880516 │ │ │ "YYYYMMDD" │ 19880516 │ │ │ "YYYY-MM-DD" │ 1988-05-16 │ │ │ "YYYY-ZM-ZD" │ 1988-5-16 │ │ │ " YY.MM.DD" │ Showa 63.05.16 (in a │ │ │ " YY.MM.DD" │ DBCS string) │ │ │ │ MinKow 77.05.16 (in │ │ │ │ a DBCS string) │ ├──────────────────┼────────────────────────────────┼──────────────────────┤ │ 148139 │ "MM" │ 05 │ │ │ "MMDD" │ 0517 │ │ │ "MM/DD" │ 05/17 │ │ │ "MMDDYY" │ 051788 │ │ │ "MM/DD/YYYY" │ 05/17/1988 │ │ │ "ZM/DD/YYYY" │ 5/17/1988 │ ├──────────────────┼────────────────────────────────┼──────────────────────┤ │ 148140 │ "DD" │ 18 │ │ │ "DDMM" │ 1805 │ │ │ "DDMMYY" │ 180588 │ │ │ "DD.MM.YY" │ 18.05.88 │ │ │ "DD.MM.YYYY" │ 18.05.1988 │ │ │ "DD Mmm YYYY" │ 18 May 1988 │ ├──────────────────┼────────────────────────────────┼──────────────────────┤ │ 148141 │ "DDD" │ 140 │ │ │ "YYDDD" │ 88140 │ │ │ "YY.DDD" │ 88.140 │ │ │ "YYYY.DDD" │ 1988.140 │ ├──────────────────┼────────────────────────────────┼──────────────────────┤ │ 148142 │ "YY/MM/DD HH:MI:SS.99" │ 88/05/20 00:00:00.00 │ │ │ "YYYY/ZM/ZD ZH:MI AP" │ 1988/5/20 0:00 AM │ ├──────────────────┼────────────────────────────────┼──────────────────────┤ │ 148143 │ "WWW., MMM DD, YYYY" │ SAT., MAY 21, 1988 │ │ │ "Www., Mmm DD, YYYY" │ Sat., May 21, 1988 │ │ │ "Wwwwwwwwww"" Mmmmmmmmmm DD, │ Saturdaybb, │ │ │ YYYY" │ Maybbbbbbb 21, 1988 │ │ │ "Wwwwwwwwwz, Mmmmmmmmmz DD, │ Saturday, May 21, │ │ │ YYYY" │ 1988 │ └──────────────────┴────────────────────────────────┴──────────────────────┘ ═══ 3.3.21. CEEDATM-Convert Seconds to Character Timestamp ═══ CEEDATM converts a number representing the number of seconds since 00:00 14 October 1582 to a character format. The format of the output is a character string, for example, 1988/07/26 20. The inverse of CEEDATM is CEESECS, which converts timestamps to number of seconds. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEDATM──(──input_seconds──,──picture_string──,──output_timestamp──,──fc──)───────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ input_seconds (input) A 64-bit double floating-point number representing the number of seconds since 00:00 on 14 October 1582, not counting leap seconds. For example, 00:01 on 15 October 1582 is second number 86,401 (24*60*60 + 01). The valid range of input_seconds is 86,400 to 265,621,679,999.999 (23:59.999 31 December 9999). picture_string (input) VSTRING, a length-prefixed character string, representing the desired format of output_timestamp, for example, MM/DD/YY HH:MI AP. Each character in the picture_string represents a character in output_timestamp. If delimiters such as the slash (/) appear in the picture string, they are copied as is to output_timestamp. See Picture Terms Used in Picture Strings for a list of valid picture characters, and Examples of Picture Terms Recognized by Date/Time Services for examples of valid picture strings. If picture_string is null or blank, CEEDATM obtains picture_string based on the current value of the COUNTRY run-time option. For example, if the current value of the COUNTRY run-time option is US (United States), the date-time format would be "MM/DD/YY HH:MI:SS AP"; if the current COUNTRY value is FR (France), however, the date-time format would be "DD.MM.YYYY HH:MI:SS". See COUNTRY for more information about the COUNTRY run-time option and CEEFMDT-Get Default Date and Time Format for information about how to obtain a default timestamp for a given country code. If picture_string includes the Japanese Era symbol , the YY position in output_timestamp represents the year within Japanese Era. See Examples of Picture Terms Recognized by Date/Time Services for an example. See Japanese Eras Used by Date/Time Services when Specified for a list of Japanese Eras supported by CEEDATM. If picture_string includes the ROC Era symbol or , the YY position in output_timestamp represents the year within ROC Era. See Examples of Picture Terms Recognized by Date/Time Services for an example. See Republic of China Eras Used by Date/Time Services when or Specified for a list of ROC Eras supported by CEEDATM. output_timestamp (output) VSTRING, a fixed-length 80-character string, that is the result of converting input_seconds to the format specified by picture_string. If necessary, the output is truncated to the length of output_timestamp. See Sample Output of CEEDATM for sample output. If input_seconds is invalid, output_timestamp is set to all blanks and CEEDATM terminates with a non-CEE000 symbolic feedback code. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2E9 │ 3 │ 2505 │ The number-of-seconds value was not within the │ │ │ │ │ supported range. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EA │ 3 │ 2506 │ , or was used in a │ │ │ │ │ picture string passed to CEEDATM, but the │ │ │ │ │ input number-of-seconds value was not within │ │ │ │ │ the supported range. The Era could not be │ │ │ │ │ determined. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EM │ 3 │ 2518 │ An invalid picture string was specified. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EV │ 2 │ 2527 │ The timestamp string returned by CEEDATM was │ │ │ │ │ truncated. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3CF │ 2 │ 3471 │ The country code country-code was invalid for │ │ │ │ │ CEEFMDT. The default date and time picture │ │ │ │ │ string datetime-string was returned. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  The probable cause for receiving message number 2518 is a picture string that contains an invalid DBCS string. You should verify that the data in the picture string is correct.  OpenEdition MVS consideration-In multithread applications, CEEDATM applies to the enclave. Examples  C/370 Example /*COMPILATION UNIT: EDCDATM */ #include #include #include #include int main(void) { /* September 13, 1991 at 11:23 PM */ _FLOAT8 seconds = 12904183403.0; _VSTRING date,date_pic; _CHAR80 out_date; _FEEDBACK fc; strcpy(date_pic.string, "Mmmmmmmmmmmz DD, YYYY at ZH:MI:SS AP"); date_pic.length = strlen(date_pic.string); CEEDATM(&seconds,17 May 1994_pic,out_date,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEDATM failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("%.80s\n",out_date); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTDATM ************************************************* ** ** ** Function: CEEDATM - convert seconds to ** ** character timestamp ** ** ** ** In this example, a call is made to CEEDATM ** ** to convert a date represented in Lilian ** ** seconds (the number of seconds since ** ** 00:00 14 October 1582) to a character ** ** format (such as 06/02/88 10:45). The ** ** result is displayed. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLDATM. DATA DIVISION. WORKING-STORAGE SECTION. 01 DEST PIC S9(9) COMP VALUE 2. 01 SECONDS COMP-2. 01 IN-DATE. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of IN-DATE. 01 PICSTR. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of PICSTR. 01 TIMESTP PIC X(80). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLDATM. ** Call CEESECS to convert timestamp of 6/2/88 ** at 10:45 AM to Lilian representation MOVE 20 TO Vstring-length of IN-DATE. MOVE '06/02/88 10:45 AM' TO Vstring-text of IN-DATE. MOVE 20 TO Vstring-length of PICSTR. MOVE 'MM/DD/YY HH:MI:SS AP' TO Vstring-text of PICSTR. CALL 'CEESECS' USING IN-DATE, PICSTR, SECONDS, FC. ** If CEESECS runs successfully, display result. IF CEE000 of FC THEN DISPLAY Vstring-text of IN-DATE ' is Lilian second: ' SECONDS ; ELSE DISPLAY 'CEESECS failed with msg ' Msg-No of FC UPON CONSOLE ; STOP RUN; END-IF. ** Specify desired format of the output. MOVE 35 TO Vstring-length OF PICSTR. MOVE 'ZD Mmmmmmmmmmmmmmz YYYY at HH:MI:SS' TO Vstring-text OF PICSTR. ** Call CEEDATM to convert Lilian seconds to ** a character timestamp CALL 'CEEDATM' USING SECONDS, PICSTR, TIMESTP, FC. ** If CEEDATM runs successfully, display result. IF CEE000 of FC THEN DISPLAY 'Input seconds of ' SECONDS ' corresponds to: ' TIMESTP ; ELSE DISPLAY 'CEEDATM failed with msg ' Msg-No of FC UPON CONSOLE ; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMDATM /****************************************************/ /** **/ /** Function: CEEDATM - Convert seconds to **/ /** character timestamp **/ /** **/ /** In this example, CEEDATM is called to convert **/ /** the number of seconds since 00:00 14 **/ /** October 1582 to the character format specified **/ /** in PICSTR. **/ /** **/ /****************************************************/ PLIDATM: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL SECONDS FLOAT8; DCL PICSTR VSTRING; DCL TIMESTP CHAR80; DCL 01 FC FEEDBACK; SECONDS = 13166064060; /* Input is Lilian seconds*/ PICSTR = 'ZD Mmmmmmmmmmmmmmz YYYY'; /* Picture */ /* string describing desired output format */ /* Call CEEDATM to convert Lilian seconds to */ /* format specified in PICSTR */ CALL CEEDATM ( SECONDS , PICSTR , TIMESTP , FC ); /* If CEEDATM ran successfully, print result */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Input Lilian seconds correspond to ' || TIMESTP); END; ELSE DO; DISPLAY( 'CEEDATM failed with msg ' || FC.MsgNo ); STOP; END; END PLIDATM; Sample Output of CEEDATMshows the sample output of CEEDATM. ┌──────────────────────────────────────────────────────────────────────────┐ │ Table 19. Sample Output of CEEDATM │ ├─────────────────────┬──────────────────────────────┬─────────────────────┤ │ │ │ │ │ INPUT_SECONDS │ PICTURE_STRING │ OUTPUT_TIMESTAMP │ ├─────────────────────┼──────────────────────────────┼─────────────────────┤ │ 12,799,191,601.000 │ "YYMMDD" │ 880516 │ │ │ "HH:MI:SS" │ 19:00:01 │ │ │ "YY-MM-DD" │ 88-05-16 │ │ │ "YYMMDDHHMISS" │ 880516190001 │ │ │ "YY-MM-DD HH:MI:SS" │ 88-05-16 19:00:01 │ │ │ "YYYY-MM-DD HH:MI:SS AP" │ 1988-05-16 07:00:01 │ │ │ │ PM │ ├─────────────────────┼──────────────────────────────┼─────────────────────┤ │ 12,799,191,661.986 │ "DD Mmm YY" │ 16 May 88 │ │ │ "DD MMM YY HH:MM" │ 16 MAY 88 19:01 │ │ │ "WWW, MMM DD, YYYY ZH:MI AP" │ MON, MAY 16, 1988 │ │ │ "Wwwwwwwwwz, ZM/ZD/YY │ 7:01 PM │ │ │ HH:MI:SS.99" │ Monday, 5/16/88 │ │ │ │ 19:01:01.98 │ ├─────────────────────┼──────────────────────────────┼─────────────────────┤ │ 12,799,191,662.009 │ "YYYY" │ "1988" │ │ │ "YY" │ "88" │ │ │ "Y" │ "8" │ │ │ "MM" │ "05" │ │ │ "ZM" │ "5" │ │ │ "RRRR" │ "Vbbb" │ │ │ "MMM" │ "MAY" │ │ │ "Mmm" │ "May" │ │ │ "Mmmmmmmmmm" │ "Maybbbbbb" │ │ │ "Mmmmmmmmmz" │ "May" │ │ │ "DD" │ "16" │ │ │ "ZD" │ "16" │ │ │ "DDD" │ "137" │ │ │ "HH" │ "19" │ │ │ "ZH" │ "19" │ │ │ "MI" │ "01" │ │ │ "SS" │ "02" │ │ │ "99" │ "00" │ │ │ "999" │ "009" │ │ │ "AP" │ "PM" │ │ │ "WWW" │ "MON" │ │ │ "Www" │ "Mon" │ │ │ "Wwwwwwwwww" │ "Mondaybbbb" │ │ │ "Wwwwwwwwwz" │ "Monday" │ └─────────────────────┴──────────────────────────────┴─────────────────────┘ ═══ 3.3.22. CEEDAYS-Convert Date to Lilian Format ═══ CEEDAYS converts a string representing a date into a Lilian format. The Lilian format represents a date as the number of days from the beginning of the Gregorian calendar. Friday, 14 October, 1582 is day one in the Lilian format. CEEDAYS converts the specified input_char_date to a number representing the number of days since 14 October, 1582. This service can perform arithmetic on dates, such as calculating the number of days between two dates. The inverse of CEEDAYS is CEEDATE, which converts output_Lilian_date from Lilian format to character format. To handle dates earlier than 1582, it is possible to add 4000 to each year, convert to Lilian, calculate, subtract 4000 from the result, and then convert back to character format. By default, 2-digit years lie within the 100-year range starting 80 years prior to the system date. Thus, in 1993, all 2-digit years represent dates between 1913 and 2012, inclusive. This default range is changed by using the callable service CEESCEN-Set the Century Window. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEDAYS──(──input_char_date──,──picture_string──,──output_Lilian_date──,──fc──)───────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ input_char_date (input) VSTRING, a length-prefixed character string, representing a date or timestamp, in a format conforming to that specified by picture_string. The character string must contain between 5 and 255 characters, inclusive. input_char_date can contain leading or trailing blanks. Parsing for a date begins with the first nonblank character (unless the picture string itself contains leading blanks, in which case CEEDAYS skips exactly that many positions before parsing begins). After parsing a valid date, as determined by the format of the date specified in picture_string, CEEDAYS ignores all remaining characters. Valid dates range between and include 15 October 1582 to 31 December 9999. See Picture Terms Used in Picture Strings for a list of valid picture character terms that can be specified in input_char_date. picture_string (input) VSTRING, a length-prefixed character string, indicating the format of the date specified in input_char_date. Each character in the picture_string corresponds to a character in input_char_date. For example, if you specify MMDDYY as the picture_string, CEEDAYS reads an input_char_date of 060288 as 02 June 1988. If delimiters such as the slash (/) appear in the picture string, leading zeros can be omitted. For example, the following calls to CEEDAYS: CALL CEEDAYS('6/2/88' , 'MM/DD/YY', lildate, fc); CALL CEEDAYS('06/02/88', 'MM/DD/YY', lildate, fc); CALL CEEDAYS('060288' , 'MMDDYY' , lildate, fc); CALL CEEDAYS('88154' , 'YYDDD' , lildate, fc); would each assign the same value, 148155 (02 June 1988), to lildate. Whenever characters such as colons or slashes are included in the picture_string (such as HH:MI:SS YY/MM/DD), they count as place-holders but are otherwise ignored. See Picture Terms Used in Picture Strings for a list of valid picture characters, and Examples of Picture Terms Recognized by Date/Time Services for examples of valid picture strings. If picture_string includes a Japanese Era symbol , the YY position in input_char_date is replaced by the year number within the Japanese Era. For example, the year 1988 equals the Japanese year 63 in the Showa era. See Examples of Picture Terms Recognized by Date/Time Services for an additional example. See also Japanese Eras Used by Date/Time Services when Specified for a list of Japanese Eras supported by CEEDATE. If picture_string includes an ROC Era symbol or , the YY position in input_char_date is replaced by the year number within the ROC (Republic of China) Era. For example, the year 1988 equals the ROC year 77 in the MinKow Era. See Examples of Picture Terms Recognized by Date/Time Services for an additional example. See Republic of China Eras Used by Date/Time Services when or Specified for a list of ROC Eras supported by CEEDATE. output_Lilian_date (output) A 32-bit binary integer representing the Lilian date, the number of days since 14 October 1582. For example, 16 May 1988 is day number 148138. If input_char_date does not contain a valid date, output_Lilian_date is set to 0 and CEEDAYS terminates with a non-CEE000 symbolic feedback code. Date calculations are performed easily on the output_Lilian_date, because it is an integer. Leap year and end-of-year anomalies are avoided. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EB │ 3 │ 2507 │ Insufficient data was passed to CEEDAYS or │ │ │ │ │ CEESECS. The Lilian value was not calculated. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EC │ 3 │ 2508 │ The date value passed to CEEDAYS or CEESECS │ │ │ │ │ was invalid. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2ED │ 3 │ 2509 │ The Japanese or Republic of China Era passed │ │ │ │ │ to CEEDAYS or CEESECS was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EH │ 3 │ 2513 │ The input date was not within the supported │ │ │ │ │ range. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EL │ 3 │ 2517 │ The month value was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EM │ 3 │ 2518 │ An invalid picture string was specified. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EO │ 3 │ 2520 │ CEEDAYS detected non-numeric data in a numeric │ │ │ │ │ field, or the date string did not match the │ │ │ │ │ picture string. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EP │ 3 │ 2521 │ The Japanese or Chinese year-within-Era value │ │ │ │ │ passed to CEEDAYS or CEESECS was zero. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  The probable cause for receiving message number 2518 is a picture string that contains an invalid DBCS string. You should verify that the data in the picture string is correct.  OpenEdition MVS consideration-In multithread applications, CEEDAYS applies to the enclave. Examples  C/370 Example /*COMPILATION UNIT: EDCDAYS */ #include #include #include #include int main(void) { _FEEDBACK fc; _INT4 lil_date1,lil_date2; _VSTRING date,date_pic; /* use CEEDAYS to get the Lilian format */ strcpy(date.string,"05/14/64"); date.length = strlen(date.string); strcpy(date_pic.string,"MM/DD/YY"); date_pic.length = strlen(date_pic.string); CEEDAYS(17 May 1994,17 May 1994_pic,&lil_date1,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEDAYS failed with message number %d\n", fc.tok_msgno); exit(2999); } /* use CEEDAYS to get the Lilian format */ strcpy(date.string,"August 14, 1966"); date.length = strlen(date.string); strcpy(date_pic.string,"Mmmmmmmmmmmz DD, YYYY"); date_pic.length = strlen(date_pic.string); CEEDAYS(17 May 1994,17 May 1994_pic,&lil_date2,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEDAYS failed with message number %d\n", fc.tok_msgno); exit(2999); } /* subtract the two Lilian dates to find out */ /* difference in days */ printf("The number of days between" " May 14, 1964 and August 14, 1966" " is: %d\n",lil_date2 - lil_date1); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTDAYS ******************************************* ** ** ** Function: CEEDAYS - convert date to ** ** Lilian format ** ** ** ******************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLDAYS. DATA DIVISION. WORKING-STORAGE SECTION. 01 CHRDATE. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of CHRDATE. 01 PICSTR. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of PICSTR. 01 LILIAN PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLDAYS. ** Specify input date and length MOVE 16 TO Vstring-length of CHRDATE. MOVE '1 January 2000' TO Vstring-text of CHRDATE. ** Specify a picture string that describes ** input date, and the picture string's length. MOVE 25 TO Vstring-length of PICSTR. MOVE 'ZD Mmmmmmmmmmmmmmz YYYY' TO Vstring-text of PICSTR. ** Call CEEDAYS to convert input date to a ** Lilian date CALL 'CEEDAYS' USING CHRDATE , PICSTR , LILIAN , FC. ** If CEEDAYS runs successfully, display result. IF CEE000 of FC THEN DISPLAY Vstring-text of CHRDATE ' is Lilian day: ' LILIAN ELSE DISPLAY 'CEEDAYS failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMDAYS /***************************************************/ /** **/ /** Function : CEEDAYS - Convert date to **/ /** Lilian format **/ /** **/ /** This example converts two dates to the Lilian **/ /** format in order to calculate the number of **/ /** days between them. **/ /** **/ /***************************************************/ PLIDAYS: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL CHRDATE VSTRING; DCL CHRD2 VSTRING; DCL PICSTR VSTRING; DCL PICST2 VSTRING; DCL LILIAN INT4; DCL LIL2 INT4; DCL 01 FC FEEDBACK; /* First date to be converted to Lilian format */ CHRDATE = '5/7/69'; /* Picture string of first input date */ PICSTR = 'ZM/ZD/YY'; /* Call CEEDAYS to convert input date to the */ /* Lilian format */ CALL CEEDAYS ( CHRDATE , PICSTR , LILIAN , FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The Lilian date for ' || CHRDATE || ' is ' || LILIAN ); END; ELSE DO; DISPLAY( 'CEEDAYS failed with msg ' || FC.MsgNo ); STOP; END; /* Second date to be converted to Lilian format */ CHRD2 = '1 January 2000'; /* Picture string of second input date */ PICST2 = 'ZD Mmmmmmmmmmmmmmz YYYY'; /* Call CEEDAYS to convert input date to the */ /* Lilian format */ CALL CEEDAYS ( CHRD2 , PICST2 , LIL2 , FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The Lilian date for ' || CHRD2 || ' is ' || LIL2 ); END; ELSE DO; DISPLAY( 'CEEDAYS failed with msg ' || FC.MsgNo ); STOP; END; /* Subtract the two Lilian dates to find out */ /* the difference in days between the two */ /* input dates */ PUT SKIP LIST( 'The number of days between ' || CHRDATE || ' and ' || CHRD2 || ' is' || LIL2 - LILIAN || '.'); END PLIDAYS; ═══ 3.3.23. CEEDCOD-Decompose a Condition Token ═══ CEEDCOD decomposes or alters an existing condition token. LE/370-conforming HLLs can decompose or alter the condition token fields without using the CEEDCOD service. See the CEESGL C/370 example on page Examples for an example of how to alter the condition token field. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEDCOD──(──cond_token──,──c_1──,──c_2──,──case──,──severity──,──control──,──facility_ID───> │ │ │ │ >──,──i_s_info──,──fc──)──────────────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ cond_token (input) A 12-byte condition token representing the current condition or feedback information. c_1 (output) A 2-byte binary integer representing the value of the first 2 bytes of the condition_ID. See CEENCOD-Construct a Condition Token for a detailed explanation of the condition_ID. c_2 (output) A 2-byte binary integer representing the value of the second 2 bytes of the condition_ID. See CEENCOD-Construct a Condition Token for a detailed explanation of the condition_ID. case (output) A 2-byte binary integer field defining the format of the condition_ID portion of the token. A value of 1 identifies a case 1 condition. A value of 2 identifies a case 2 condition. The values 0 and 3 are reserved. See CEENCOD-Construct a Condition Token for an explanation of the condition_ID. See CEENCOD Usage Notes for a discussion of case 1 and case 2 types. severity (output) A 2-byte binary integer representing the severity of the condition. severity specifies the following values: 0 Information only (or, if the entire token is zero, no information). 1 Warning-service completed, probably correctly. 2 Error detected-correction attempted; service completed, perhaps incorrectly. 3 Severe error-service not completed. 4 Critical error-service not completed; condition signaled. A critical error is a condition that jeopardizes the environment. If a critical error occurs during an LE/370 callable service, instead of returning synchronously to the caller, the condition manager is always signaled. control (output) A 2-byte binary integer containing flags describing aspects of the state of the condition. Valid values for the control field are 1 and 0. 1 indicates that the facility_ID is assigned by IBM. 0 indicates the facility_ID is assigned by the user. facility_ID (output) A 3-character field containing three alphanumeric characters identifying the product generating the condition or feedback information. See the facility_ID parameter of CEENCOD-Construct a Condition Token for more information. i_s_info A fullword binary integer identifying the Instance Specific Information (ISI) associated with the given instance of the condition represented by the condition token where it is contained. If an ISI is not associated with a given condition token, the i_s_info field contains a value of binary zero. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0CH │ 3 │ 0401 │ An unsupported case code case-code was passed │ │ │ │ │ to routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0CI │ 3 │ 0402 │ An unsupported control code control-code was │ │ │ │ │ passed to routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0CJ │ 3 │ 0403 │ An unsupported severity code severity-code was │ │ │ │ │ passed to routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0CK │ 1 │ 0404 │ A facility ID facility-id with non- │ │ │ │ │ alphanumeric characters was passed to routine │ │ │ │ │ routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0E4 │ 3 │ 0452 │ An unsupported facility ID facility-id was │ │ │ │ │ passed to routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  C/370 considerations-The structure of the condition token (type_FEEDBACK) is described in the leawi.h header file shipped with LE/370. C/370 users can assign values directly to the fields of the token in the header file without using the CEENCOD service. (See the example for CEESGL-Signal a Condition for details.) The layout of the type_FEEDBACK condition token in the header file is shown in type_FEEDBACK Data Type as Defined in the leawi.h Header File.  OpenEdition MVS consideration-In multithread applications, CEEDCOD affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCDCOD */ #include #include #include #include /****************************************************/ /* In C/370 it is not necessary to use this service.*/ /* The fields can be manipulated directly. See the */ /* example for CEESGL to see how to manipulate */ /* condition token fields directly. */ /****************************************************/ int main(void) { _FEEDBACK fc,newfc; _INT2 c_1,c_2,cond_case,sev,control; _CHAR3 facid; _INT4 isi, heapid, size; _POINTER address; heapid = 0; size = 4000; CEEGTST(&heapid,&size,&address,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEGTST failed with msgno %d\n", fc.tok_msgno); exit(2999); } /* decompose the feedback token to check for errors */ CEEDCOD(&fc,&c_1,&c_2,&cond_case,&sev,&control,facid, &isi,&newfc); if ( _FBCHECK ( newfc , CEE000 ) != 0 ) { printf("CEEDCOD failed with msgno %d\n", newfc.tok_msgno); exit(2889); } if (c_1 != 0 || c_2 != 0) printf( "c_1 and c_2 returned from CEEDCOD should be 0\n"); /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTDCOD *********************************************** ** ** ** Function: CEEDCOD - Decompose a condition ** ** token ** ** ** ** In this example, a call is made to ** ** CEEGTST in order to obtain a condition ** ** token to use in the call to CEEDCOD. ** ** A call could also have been made to any ** ** other LE service, or a condition token ** ** could have been constructed using ** ** CEEDCOD. ** ** ** *********************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLDCOD. DATA DIVISION. WORKING-STORAGE SECTION. 01 HEAPID PIC S9(9) COMP. 01 HPSIZE PIC S9(9) COMP. 01 ADDRSS USAGE POINTER. 01 SEV PIC S9(4) COMP. 01 MSGNO PIC S9(4) COMP. 01 CASE PIC S9(4) COMP. 01 SEV2 PIC S9(4) COMP. 01 CNTRL PIC S9(4) COMP. 01 FACID PIC X(3). 01 ISINFO PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 FC2. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. ** Call any LE service to receive a condition ** token to use as input to CEEDCOD. PARA-CBLGTST. ** Specify 0 to get storage from the initial ** heap. ** Specify 4000 to get 4000 bytes of storage. ** Call CEEGTST to obtain storage. MOVE 0 TO HEAPID. MOVE 4000 TO HPSIZE. CALL 'CEEGTST' USING HEAPID , HPSIZE , ADDRSS , FC. PARA-CBLDCOD. ** Use the FC returned from CEEGTST as an ** input condition token to CEEDCOD. CALL 'CEEDCOD' USING FC , SEV , MSGNO , CASE , SEV2 , CNTRL , FACID , ISINFO , FC2. IF CEE000 of FC2 THEN DISPLAY 'CEEGTST completed with msg ' MSGNO ', Severity ' SEV ', Case ' CASE ', Control ' CNTRL ', and ' 'Instance-Specific Information of ' ISINFO '.' ELSE DISPLAY 'CEEDCOD failed with msg ' Msg-No of FC2 UPON CONSOLE; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMDCOD /***************************************************/ /** **/ /** Function: CEEDCOD - decompose a condition **/ /** token **/ /** **/ /** In this example, a call is made to CEEGTST to **/ /** receive a condition token to decompose. **/ /** A call could have been made to any LE/370 **/ /** service. The condition token returned by **/ /** CEEGTST is used as input to CEEDCOD. **/ /** **/ /***************************************************/ PLIDCOD: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL HEAPID INT4; DCL STGSIZE INT4; DCL ADDRSS POINTER; DCL 01 FC FEEDBACK; DCL SEV INT2; DCL MSGNO INT2; DCL CASE INT2; DCL SEV2 INT2; DCL CNTRL INT2; DCL FACID CHARACTER ( 3 ); DCL ISINFO INT4; DCL 01 FC2 FEEDBACK; HEAPID = -1; /* invalid heap ID */ STGSIZE = 4000; /* request 4000 bytes of storage */ /* Call any service (in this case, CEEGTST) to */ /* create a condition token to decompose */ CALL CEEGTST ( HEAPID , STGSIZE , ADDRSS , FC ); /* Call CEEDCOD with the condition token */ /* returned in FC from CEEGTST */ CALL CEEDCOD ( FC , SEV , MSGNO , CASE , SEV2 , CNTRL , FACID , ISINFO , FC2 ); IF FBCHECK( FC2, CEE000) THEN DO; PUT SKIP LIST( 'Feedback token from CEEGTST has' || ' Severity of ' || SEV || ', Message Number of ' || MSGNO || ', Case of ' || CASE || ',' ); PUT SKIP LIST( ' Severity 2 of ' || SEV2 || ', Control of ' || CNTRL || ', Facility ID of ' || FACID || ', and I-S-Info of ' || ISINFO || '.' ); END; ELSE DO; DISPLAY( 'CEEDCOD failed with msg ' || FC2.MsgNo ); STOP; END; END PLIDCOD; ═══ 3.3.24. CEEDSHP-Discard Heap ═══ CEEDSHP discards an entire heap created by CEECRHP. CEECRHP returns a unique heap_id to the caller; use this ID in the CEEDSHP call. A heap_id of 0 is not permitted with CEEDSHP. Discarding a heap with CEEDSHP immediately returns all storage allocated to the heap to the operating system, even if the KEEP suboption has been specified with the HEAP run-time option. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEDSHP──(──heap_id──,──fc──)─────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ heap_id (input) A fullword binary signed integer. heap_id is a token specifying the discarded heap. A heap_id of 0 is invalid; the initial heap is logically created during enclave initialization and cannot be discarded. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P2 │ 4 │ 0802 │ Heap storage control information was damaged. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P3 │ 3 │ 0803 │ The heap identifier in a get storage request │ │ │ │ │ or a discard heap request was unrecognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0PC │ 3 │ 0812 │ An invalid attempt to discard the Initial Heap │ │ │ │ │ was made. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  After the call to CEEDSHP, any existing pointers to storage allocated from this heap are dangling pointers, that is, pointers to storage that is freed. Using these pointers can cause unpredictable results.  OpenEdition MVS considerations-CEEDSHP applies to the enclave. LE/370 frees all storage in the heap regardless of which thread allocated it. Examples  C/370 Example /*COMPILATION UNIT: EDCDSHP */ #include #include #include #include int main(void) { _INT4 heapid, size, increment, options; _FEEDBACK fc; /* . . . */ heapid = 0; /* heap identifier is set */ /* by CEECRHP */ size = 4096; /* initial size of heap */ /* (in bytes) */ increment = 4096; /* increment to extend */ /* the heap by */ options = 72; /* set up heap as */ /* (,,ANYWHERE,FREE)*/ /* create heap using CEECRHP */ CEECRHP(&heapid,&size,&increment,&options,&fc); /* check the first 4 bytes of the feedback token */ /* (0 if successful) */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEECRHP failed with message number %d\n", fc.tok_msgno); exit(99); } /* . . . */ /* discard the heap that was previously created */ /* using CEECRHP */ CEEDSHP(&heapid,&fc); /* check the first 4 bytes of the feedback token */ /* (0 if successful) */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEDSHP failed with message number %d\n", fc.tok_msgno); exit(99); } /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTDSHP ************************************************** ** ** ** Function: CEEDSHP - discard heap ** ** ** ** In this example, a new additional heap is ** ** created a call to CEECRHP, and then ** ** discarded through a call to CEEDSHP. ** ** ** ************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLDSHP. DATA DIVISION. WORKING-STORAGE SECTION. 01 HEAPID PIC S9(9) COMP. 01 HPSIZE PIC S9(9) COMP. 01 INCR PIC S9(9) COMP. 01 OPTS PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLCRHP. ** Specify 0 for HEAPID, and heap id will ** be set by CEECRHP. ** Heap size and increment will each be 4096 ** bytes. ** Specify 00 for OPTS, and HEAP attributes ** will be inherited from the initial heap ** (copied from the HEAP run-time option). MOVE 0 TO HEAPID. MOVE 4096 TO HPSIZE. MOVE 4096 TO INCR. MOVE 00 TO OPTS. CALL 'CEECRHP' USING HEAPID , HPSIZE , INCR , OPTS , FC. IF CEE000 of FC THEN DISPLAY 'Created heap number ' HEAPID ' which is ' HPSIZE ' bytes long' ELSE DISPLAY 'CEECRHP failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ** To discard the heap, call CEEDSHP with the ** heap id returned from CEECRHP. CALL 'CEEDSHP' USING HEAPID , FC. IF CEE000 of FC THEN DISPLAY 'Disposed of heap # ' HEAPID ELSE DISPLAY 'CEEDSHP failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMDSHP /***************************************************/ /** **/ /** Function: CEEDSHP - discard heap **/ /** **/ /** In this example, calls are made to CEECRHP **/ /** and CEEDSHP to create a heap of 4096 bytes **/ /** and then discard it. **/ /** **/ /***************************************************/ PLIDSHP: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL HEAPID INT4 ; DCL HPSIZE INT4 ; DCL INCR INT4 ; DCL OPTS INT4 ; DCL 01 FC FEEDBACK ; DCL 01 FC2 FEEDBACK ; HEAPID = 0; /* HEAPID will be set and */ /* returned by CEECRHP */ HPSIZE = 4096; /* Initial size of heap in bytes */ INCR = 4096; /* Number of bytes to extend */ /* heap by */ OPTS = 00; /* Set up heap with the same */ /* attributes as the initial */ /* heap (HEAPID = 0) */ /* Call CEECRHP to set up new heap */ CALL CEECRHP ( HEAPID, HPSIZE, INCR, OPTS, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Created heap number ' || HEAPID || ' consisting of ' || HPSIZE || ' bytes' ); END; ELSE DO; DISPLAY( 'CEECRHP failed with msg ' || FC.MsgNo ); STOP; END; /* Call CEEDSHP to discard heap with the id */ /* returned by CEECRHP */ CALL CEEDSHP ( HEAPID, FC2 ); IF FBCHECK( FC2, CEE000) THEN DO; PUT SKIP LIST( 'Disposed of heap number ' || HEAPID ); END; ELSE DO; DISPLAY( 'CEEDSHP failed with msg ' || FC2.MsgNo ); STOP; END; END PLIDSHP; ═══ 3.3.25. CEEDYWK-Calculate Day of Week from Lilian Date ═══ CEEDYWK calculates the day of the week on which a Lilian date falls. The day of the week is returned to the calling routine as a number between 1 and 7. The number returned by CEEDYWK is useful for end-of-week calculations. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEDYWK──(──input_Lilian_date──,──output_day_no──,──fc──)─────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ input_Lilian_date (input) A 32-bit binary integer representing the Lilian date, the number of days since 14 October 1582. For example, 16 May 1988 is day number 148138. The valid range of input_Lilian_date is between 1 and 3,074,324 (15 October 1582 and 31 December 9999). output_day_no (output) A 32-bit binary integer representing input_Lilian_date's day-of-week: 1 equals Sunday, 2 equals Monday, ..., 7 equals Saturday. If input_Lilian_date is invalid, output_day_no is set to 0 and CEEDYWK terminates with a non-CEE000 symbolic feedback code. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EG │ 3 │ 2512 │ The Lilian date value was not within the sup- │ │ │ │ │ ported range. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS consideration-In multithread applications, CEEDYWK affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCDYWK */ #include #include #include #include int main (void) { _INT4 in_date, day; _FEEDBACK fc; in_date = 139370; /* Thursday */ CEEDYWK(&in_date,&day,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEDYWK failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("Lilian date %d, occurs on a ",in_date); switch(day) { case 1: printf("Sunday.\n"); break; case 2: printf("Monday.\n"); break; case 3: printf("Tuesday.\n"); break; case 4: printf("Wednesday.\n"); break; case 5: printf("Thursday.\n"); break; case 6: printf("Friday.\n"); break; case 7: printf("Saturday.\n"); break; default: printf( " ERROR! DAY RETURN BY CEEDYWK UNKNOWN\n"); break; } }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTDYWK ************************************************ ** ** ** Function: CEEDYWK - calculate day of week ** ** from Lilian date ** ** ** ** In this example, a call is made to CEEDYWK ** ** to return the day of the week on which a ** ** Lilian date falls. (A Lilian date is the ** ** number of days since 14 October 1582) ** ** ** ************************************************ IDENTIFICATION DIVISION. PROGRAM-ID. CBLDYWK. DATA DIVISION. WORKING-STORAGE SECTION. 01 LILIAN PIC S9(9) COMP. 01 DAYNUM PIC S9(9) COMP. 01 IN-DATE. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of IN-DATE. 01 PICSTR. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of PICSTR. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLDAYS. ** Call CEEDAYS to convert date of 6/2/88 to ** Lilian representation MOVE 6 TO Vstring-length of IN-DATE. MOVE '6/2/88' TO Vstring-text of IN-DATE(1:6). MOVE 8 TO Vstring-length of PICSTR. MOVE 'MM/DD/YY' TO Vstring-text of PICSTR(1:8). CALL 'CEEDAYS' USING IN-DATE, PICSTR, LILIAN, FC. ** If CEEDAYS runs successfully, display result. IF CEE000 of FC THEN DISPLAY Vstring-text of IN-DATE ' is Lilian day: ' LILIAN ELSE DISPLAY 'CEEDAYS failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. PARA-CBLDYWK. ** Call CEEDYWK to return the day of the week on ** which the Lilian date falls CALL 'CEEDYWK' USING LILIAN , DAYNUM , FC. ** If CEEDYWK runs successfully, print results IF CEE000 of FC THEN DISPLAY 'Lilian day ' LILIAN ' falls on day ' DAYNUM ' of the week, which is a:' ** Select DAYNUM to display the name of the day ** of the week. EVALUATE DAYNUM WHEN 1 DISPLAY 'Sunday.' WHEN 2 DISPLAY 'Monday.' WHEN 3 DISPLAY 'Tuesday' WHEN 4 DISPLAY 'Wednesday.' WHEN 5 DISPLAY 'Thursday.' WHEN 6 DISPLAY 'Friday.' WHEN 7 DISPLAY 'Saturday.' END-EVALUATE; ELSE DISPLAY 'CEEDYWK failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMDYWK /**************************************************/ /** **/ /** Function: CEEDYWK - calculate day of week **/ /** from Lilian date **/ /** **/ /** In this example, CEEDYWK is called to **/ /** calculate the day of week on which a **/ /** Lilian date falls. **/ /** **/ /**************************************************/ PLIDYWK: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL LILIAN INT4 ; DCL DAYNUM INT4 ; DCL 01 FC FEEDBACK ; LILIAN = 152385; /* specify input as Lilian date */ /* Call CEEDYWK to calculate the day of the */ /* week on which Lilian date 152385 falls */ CALL CEEDYWK ( LILIAN , DAYNUM , FC ); /* If CEEDYWK ran successfully, print result */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST ( 'Lilian date ' || LILIAN || ' falls on a ' ); SELECT (DAYNUM); WHEN (1) PUT LIST ( 'Sunday.' ); WHEN (2) PUT LIST ( 'Monday.' ); WHEN (3) PUT LIST ( 'Tuesday.' ); WHEN (4) PUT LIST ( 'Wednesday.' ); WHEN (5) PUT LIST ( 'Thursday.' ); WHEN (6) PUT LIST ( 'Friday.' ); WHEN (7) PUT LIST ( 'Saturday.' ); END /* Case of DAYNUM */; END; ELSE DO; DISPLAY( 'CEEDYWK failed with msg ' || FC.MsgNo ); STOP; END; END PLIDYWK; ═══ 3.3.26. CEEFMDA-Get Default Date Format ═══ CEEFMDA returns to the calling routine the default date picture string for a specified country. For a list of the default settings for a specified country, see Defaults Currency and Picture Strings Based on COUNTRY Setting. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEFMDA──(──country_code──,──date_pic_str──,──fc──)───────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ country_code (input) A 2-character fixed-length string representing one of the country codes found in Defaults Currency and Picture Strings Based on COUNTRY Setting. country_code is not case-sensitive. Also, if no value is specified, the default country code (as set by either the COUNTRY run-time option or the CEE3CTY callable service) is used. See COUNTRY for an explanation of the COUNTRY run-time option, and CEE3CTY-Set Default Country for an explanation of CEE3CTY. If you specify an invalid country_code, the default date format is 'YYYY-MM-DD HH:MI:SS'. date_pic_str (output) VSTRING, a fixed-length 80-character string, returned to the calling routine. It contains the default date picture string for the country specified. The picture string is left-justified and padded on the right with blanks if necessary. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3CB │ 2 │ 3467 │ The country code country-code was invalid for │ │ │ │ │ CEEFMDA. The default date picture string │ │ │ │ │ date-pic-string was returned. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-CEEFMDA applies to the enclave. Every enclave has a single current country setting that has a single date format. Every thread in every enclave has the same default. Examples  C/370 Example /*COMPILATION UNIT: EDCFMDA */ #include #include #include #include int main(void) { _FEEDBACK fc; _CHAR2 country; _CHAR80 date_pic; /* get the default date format for Canada */ memcpy(country,"CA",2); CEEFMDA(country,date_pic,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEFMDA failed with message number %d\n", fc.tok_msgno); exit(2999); } /* print out the default date format for Canada */ printf("%.80s\n",date_pic); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTFMDA ******************************************* ** ** ** Function: CEEFMDA - obtain default ** ** date format ** ******************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLFMDA. DATA DIVISION. WORKING-STORAGE SECTION. 01 COUNTRY PIC X(2). 01 PICSTR PIC X(80). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLFMDA. ** Specify country code for the US and call ** CEEFMDA to return the default date format ** for the US. MOVE 'US' TO COUNTRY. CALL 'CEEFMDA' USING COUNTRY , PICSTR , FC. ** If CEEFMDA runs successfully, display result IF CEE000 of FC THEN DISPLAY 'The default date format for ' 'the US is: ' PICSTR ELSE DISPLAY 'CEEFMDA failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMFMDA /***************************************************/ /** **/ /** Function: CEEFMDA - obtain default date **/ /** format **/ /** **/ /***************************************************/ PLIFMDA: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL COUNTRY CHARACTER ( 2 ); DCL PICSTR CHAR80; DCL 01 FC FEEDBACK; COUNTRY = 'US'; /* Specify country code for */ /* the United States */ /* Get the default date format for the US */ CALL CEEFMDA ( COUNTRY , PICSTR , FC ); /* Print the default date format for the US */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The default date format for the US is ' || PICSTR ); END; ELSE DO; DISPLAY( 'CEEFMDA failed with msg ' || FC.MsgNo ); STOP; END; END PLIFMDA; ═══ 3.3.27. CEEFMDT-Get Default Date and Time Format ═══ CEEFMDT returns the default date and time picture strings for the country specified by country_code. For a list of the default settings for a specified country, see Defaults Currency and Picture Strings Based on COUNTRY Setting. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEFMDT──(──country_code──,──datetime_str──,──fc──)───────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ country_code (input) A 2-character fixed-length string representing one of the country codes found in Defaults Currency and Picture Strings Based on COUNTRY Setting. country_code is not case-sensitive. Also, if no value is specified, the default country code, as set by either the COUNTRY run-time option or by CEE3CTY, is used. See COUNTRY for an explanation of the COUNTRY run-time option, and CEE3CTY-Set Default Country for an explanation of CEE3CTY. If you specify an invalid country_code, the default date/time picture string is 'YYYY-MM-DD HH:MI:SS'. datetime_str (output) VSTRING, a fixed-length 80-character string, returned to the calling routine. It contains the default date and time picture string for the country specified. The picture string is left-justified and padded on the right with blanks, if necessary. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3CF │ 2 │ 3471 │ The country code country-code was invalid for │ │ │ │ │ CEEFMDT. The default date and time picture │ │ │ │ │ string datetime-string was returned. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-CEEFMDT applies to the enclave. Every enclave has a single current country setting that has a single date and time format. Every thread in every enclave has the same default. Examples  C/370 Example /*COMPILATION UNIT: EDCFMDT */ #include #include #include #include int main(void) { _FEEDBACK fc; _CHAR2 country; _CHAR80 date_pic; /* get the default date and time format for Canada */ memcpy(country,"CA",2); CEEFMDT(country,date_pic,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEFMDT failed with message number %d\n", fc.tok_msgno); exit(2999); } /* print out the default date and time format */ printf("%.80s\n",date_pic); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTFMDT ************************************************* ** ** ** Function: CEEFMDT - Obtain default ** ** date & time format ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLFMDT. DATA DIVISION. WORKING-STORAGE SECTION. 01 COUNTRY PIC X(2). 01 PICSTR PIC X(80). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLFMDT. ** Specify country code for the US MOVE 'US' TO COUNTRY. ** Call CEEFMDT to return the default date and ** time format for the US CALL 'CEEFMDT' USING COUNTRY , PICSTR , FC. ** If CEEFMDT runs successfully, display result. IF CEE000 of FC THEN DISPLAY 'The default date and time ' 'format for the US is: ' PICSTR ELSE DISPLAY 'CEEFMDT failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMFMDT /********************************************/ /** **/ /** Function: CEEFMDT - obtain default **/ /** date & time format **/ /** **/ /********************************************/ PLIFMDT: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL COUNTRY CHARACTER ( 2 ); DCL PICSTR CHAR80; DCL 01 FC FEEDBACK; COUNTRY = 'US'; /* Specify country code for */ /* the United States */ /* Call CEEFMDT to get default date format */ /* for the US */ CALL CEEFMDT ( COUNTRY , PICSTR , FC ); /* Print default date format for the US */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The default date and time ' || 'format for the US is ' || PICSTR ); END; ELSE DO; DISPLAY( 'CEEFMDT failed with msg ' || FC.MsgNo ); STOP; END; END PLIFMDT; ═══ 3.3.28. CEEFMTM-Get Default Time Format ═══ CEEFMTM returns to the calling routine the default time picture string for the country specified by country_code. For a list of the default settings for a specified country, see Defaults Currency and Picture Strings Based on COUNTRY Setting. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEFMTM──(──country_code──,──time_pic_str──,──fc──)───────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ country_code (input) A 2-character fixed-length string representing one of the country codes found in Defaults Currency and Picture Strings Based on COUNTRY Setting. country_code is not case-sensitive. Also, if no value is specified, the default country code, as set by either the COUNTRY run-time option or the CEE3CTY callable service, is used. See COUNTRY for an explanation of the COUNTRY run-time option, and CEE3CTY-Set Default Country for an explanation of CEE3CTY. If you specify an invalid country_code, the default time picture string is 'HH:MI:SS'. time_pic_str (output) VSTRING, a fixed-length 80-character string, representing the default time picture string for the country specified. The picture string is left-justified and padded on the right with blanks if necessary. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3CD │ 2 │ 3469 │ The country code country-code was invalid for │ │ │ │ │ CEEFMTM. The default time picture string │ │ │ │ │ time-pic-string was returned. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3CE │ 2 │ 3470 │ The date and time string datetime-string was │ │ │ │ │ truncated and was not defined in CEEFMTM. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-CEEFMTM applies to the enclave. Every enclave has a single current country setting that has a single time format. Every thread in every enclave has the same default. Examples  C/370 Example /*COMPILATION UNIT: EDCFMTM */ #include #include #include #include int main(void) { _FEEDBACK fc; _CHAR2 country; _CHAR80 time_pic; /* get the default time format for Canada */ memcpy(country,"CA",2); CEEFMTM(country,time_pic,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEFMTM failed with message number %d\n", fc.tok_msgno); exit(2999); } /* print out the default time format */ printf("%.80s\n",time_pic); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTFMTM **************************************************** ** ** ** Function: CEEFMTM - obtain default time format ** ** ** **************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. IGZTFMTM. DATA DIVISION. WORKING-STORAGE SECTION. 01 COUNTRY PIC X(2). 01 PICSTR PIC X(80). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLFMTM. ** Specify country code for the US. MOVE 'US' TO COUNTRY. ** Call CEEFMTM to return the default time format ** for the US. CALL 'CEEFMTM' USING COUNTRY , PICSTR , FC. ** If CEEFMTM runs successfully, display result. IF CEE000 of FC THEN DISPLAY 'The default time format for ' 'the US is: ' PICSTR ELSE DISPLAY 'CEEFMTM failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMFMTM /***************************************************/ /** **/ /** Function: CEEFMTM - obtain default time **/ /** format **/ /** **/ /** This example calls CEEFMTM to request the **/ /** default time format for the US and print **/ /** it out. **/ /** **/ /***************************************************/ PLIFMTM: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL COUNTRY CHARACTER ( 2 ); DCL PICSTR CHAR80; DCL 01 FC FEEDBACK; COUNTRY = 'US'; /* Specify country code for */ /* the United States */ /* Call CEEFMTM to get default time format for */ /* the US */ CALL CEEFMTM ( COUNTRY , PICSTR , FC ); /* Print the default time format for the US */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The default time format for the US is ' || PICSTR); END; ELSE DO; DISPLAY( 'CEEFMTM failed with msg ' || FC.MsgNo ); STOP; END; END PLIFMTM; ═══ 3.3.29. CEEFRST-Free Heap Storage ═══ CEEFRST frees storage previously allocated by CEEGTST or by a language-intrinsic function. Normally, you do not need to call CEEFRST because LE/370 automatically returns all heap storage to the operating system when the enclave terminates. However, if you are allocating a large amount of heap storage, you should free the storage when it is no longer needed. This freed storage then becomes available for later requests for heap storage, thus reducing the total amount of storage needed to run the application. All requests to free storage are conditional. If storage cannot be freed, the appropriate feedback code is set, but (if even possible) the application does not abend. An attempt to free storage that was already marked as free produces no action and returns a non-CEE000 symbolic feedback code. An attempt to free storage at anything other than a valid starting address produces no action and returns a non-CEE000 symbolic feedback code. However, if you call CEEFRST for an invalid address, and you had specified TRAP(OFF), your application can abend. LE/370's reaction to this is undefined. Also, partial freeing of an allocated area is not supported. When storage is allocated by CEEGTST, its allocated size is remembered and this size is used during free operations. Storage allocated by CEEGTST, but not explicitly freed, is automatically freed at enclave termination. CEEFRST generates a system-level free storage call to return a storage increment to the operating system only when:  The last heap element within an increment is being freed, and  The HEAP run-time option or a call to CEECRHP specifies FREE (note that KEEP is the IBM-supplied default setting for the initial heap). See HEAP for further information about the HEAP run-time option and CEECRHP-Create New Additional Heap for information about CEECRHP. Otherwise, the freed storage is simply added to the free list; it is not returned to the operating system until termination. The out-of-storage condition can cause freeing of empty increments even when KEEP is specified. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEFRST──(──address──,──fc──)─────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ address (input) A fullword address pointer. address is the address returned by a previous CEEGTST call or a language intrinsic function such as ALLOCATE or malloc(). The storage at this address is deallocated. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P2 │ 4 │ 0802 │ Heap storage control information was damaged. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0PA │ 3 │ 0810 │ The storage address in a free storage request │ │ │ │ │ was not recognized, or heap storage control │ │ │ │ │ information was damaged. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  If you specify heap_free_value in the STORAGE run-time option, all freed storage is overwritten with heap_free_value. Otherwise, it is simply marked as available. Portions of the freed storage area can be used to hold internal storage manager control information. These areas are overwritten, but not with heap_free_value. See STORAGE for further information about the STORAGE run-time option.  The heap identifier is inferred from the address of the storage to be freed. The storage is freed from the heap in which it was allocated.  The address passed as the argument is a dangling pointer after a call to CEEFRST. The storage freed by this operation can be reallocated on a subsequent CEEGTST call. If the pointer is not reassigned, any further use of it causes unpredictable results.  OpenEdition MVS considerations-CEEFRST applies to the enclave. One thread can allocate storage, and another can free it. Examples  C/370 Example /*COMPILATION UNIT: EDCFRST */ #include #include #include #include int main(void) { _INT4 heapid, size; _POINTER address; _FEEDBACK fc; /* . . . */ heapid = 0; /* get storage from initial heap */ size = 4000; /* number of bytes of heap storage */ /* obtain the storage using CEEGTST */ CEEGTST(&heapid,&size,&address,&fc); /* check the first 4 bytes of the feedback token */ /* (0 if successful) */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEGTST failed with message number %d\n", fc.tok_msgno); exit(99); } /* . . . */ /* free the storage that was previously obtained /* using CEEGTST */ CEEFRST(&address,&fc); /* check the first 4 bytes of the feedback token */ /* (0 if successful) */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEFRST failed with message number %d\n", fc.tok_msgno); exit(99); } /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTFRST *********************************************** ** ** ** Function: CEEFRST - free heap storage ** ** ** ** In this example, a call is made to ** ** CEEGTST to obtain 4000 bytes of storage ** ** from the initial heap (HEAPID = 0). ** ** A call is then made to CEEFRST to free ** ** the storage. ** ** ** *********************************************** IDENTIFICATION DIVISION. PROGRAM-ID. IGZTFRST. DATA DIVISION. WORKING-STORAGE SECTION. 01 HEAPID PIC S9(9) COMP. 01 STGSIZE PIC S9(9) COMP. 01 ADDRSS USAGE IS POINTER. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLFRST. ** Specify 0 to get storage from the initial ** heap. ** Specify 4000 to get 4000 bytes of storage. ** Call CEEGTST to obtain storage. MOVE 0 TO HEAPID. MOVE 4000 TO STGSIZE. CALL 'CEEGTST' USING HEAPID , STGSIZE , ADDRSS , FC. IF CEE000 of FC THEN DISPLAY 'Obtained ' STGSIZE ' bytes of' ' storage at location ' ADDRSS ' from heap number ' HEAPID ELSE DISPLAY 'CEEGTST failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ** To free storage, use the address returned ** by CEECRHP in the call to CEEFRST. CALL 'CEEFRST' USING ADDRSS , FC. IF CEE000 of FC THEN DISPLAY 'Returned ' STGSIZE ' bytes of' ' storage at location ' ADDRSS ' to heap number ' HEAPID ELSE DISPLAY 'CEEFRST failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMFRST /**************************************************/ /** **/ /** Function: CEEFRST - free heap storage **/ /** **/ /** This example calls CEEGTST to obtain storage **/ /** from the initial heap, and then calls **/ /** CEEFRST to discard it. **/ /** **/ /**************************************************/ PLIFRST: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL ADDRSS POINTER; DCL HEAPID INT4; DCL STGSIZE INT4; DCL 01 FC FEEDBACK; DCL 01 FC2 FEEDBACK; HEAPID = 0; /* get storage from the initial heap */ STGSIZE = 4000; /* get 4000 bytes of storage */ /* Call CEEGTST to obtain the storage */ CALL CEEGTST ( HEAPID, STGSIZE, ADDRSS, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Obtained ' || STGSIZE || ' bytes of storage at location ' || DECIMAL( UNSPEC( ADDRSS ) ) || ' from heap ' || HEAPID ); END; ELSE DO; DISPLAY( 'CEEGTST failed with msg ' || FC.MsgNo ); STOP; END; /* Call CEEFRST with the address returned from */ /* CEEGTST to free the storage allocated by */ /* the call to CEEGTST */ CALL CEEFRST ( ADDRSS, FC2 ); IF FBCHECK( FC2, CEE000) THEN DO; PUT SKIP LIST( 'Storage block at location ' || DECIMAL( UNSPEC( ADDRSS ) ) || ' freed'); END; ELSE DO; DISPLAY( 'CEEFRST failed with msg ' || FC2.MsgNo ); STOP; END; END PLIFRST; ═══ 3.3.30. CEEGMT-Get Current Greenwich Mean Time ═══ CEEGMT returns the current Greenwich Mean Time (GMT) as both a Lilian date and as the number of seconds since 00:00 14 October 1582. GMT is also known as Coordinated Universal Time. The returned values are compatible with those generated and used by the other LE/370 date and time services. In order for the results of this service to be meaningful, your system's TOD (time-of-day) clock must be set to Greenwich Mean Time and be based on the standard epoch. Use CEEGMTO (CEEGMTO-Get Offset from Greenwich Mean Time to Local Time) to obtain the offset from GMT to local time. The values returned by CEEGMT are handy for elapsed time calculations. For example, you can calculate the time elapsed between two calls to CEEGMT by calculating the differences between the returned values. CEEUTC is an alias of this service. See CEEUTC-Get Coordinated Universal Time. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEGMT──(──output_GMT_Lilian──,──output_GMT_seconds──,──fc──)─────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ output_GMT_Lilian (output) A 32-bit binary integer representing the current time in Greenwich, England, in the Lilian format (the number of days since 14 October 1582). For example, 16 May 1988 is day number 148138. If GMT is not available from the system, output_GMT_Lilian is set to 0 and CEEGMT terminates with a non-CEE000 symbolic feedback code. output_GMT_seconds (output) A 64-bit double floating-point number representing the current date and time in Greenwich, England, as the number of seconds since 00:00 on 14 October 1582, not counting leap seconds. For example, 00:01 on 15 October 1582 is second number 86,401 (24*60*60 + 01). 19:01.078 on 16 May 1988 is second number 12,799,191,601.078. If GMT is not available from the system, output_GMT_seconds is set to 0 and CEEGMT terminates with a non-CEE000 symbolic feedback code. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2E6 │ 3 │ 2502 │ The UTC/GMT was not available from the system. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  CEEDATE converts output_GMT_Lilian to a character date, and CEEDATM converts output_GMT_seconds to a character timestamp.  CICS consideration-CEEGMT can be used under CICS, because CEEGMT does not use the OS TIME macro.  OpenEdition MVS consideration-In multithread applications, CEEGMT affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCGMT */ #include #include #include #include int main(void) { _FEEDBACK fc; _INT4 lilGMT_date; _FLOAT8 secGMT_date; CEEGMT(&lilGMT_date,&secGMT_date,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEGMT failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("The current Lilian date in Greenwich,"); printf(" England is %d\n", lilGMT_date); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTGMT ************************************************* ** ** ** Function: CEEGMT - get current Greenwich ** ** Mean Time ** ** ** ** In this example, a call is made to CEEGMT ** ** to return the current GMT as a Lilian date ** ** and as Lilian seconds. The results are ** ** displayed. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. IGZTGMT. DATA DIVISION. WORKING-STORAGE SECTION. 01 LILIAN PIC S9(9) COMP. 01 SECS COMP-2. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLGMT. CALL 'CEEGMT' USING LILIAN , SECS , FC. IF CEE000 of FC THEN DISPLAY 'The current GMT is also ' 'known as Lilian day: ' LILIAN DISPLAY 'The current GMT in Lilian ' 'seconds is: ' SECS ELSE DISPLAY 'CEEGMT failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMGMT /***************************************************/ /** **/ /** Function: CEEGMT - get current Greenwich Mean **/ /** Time **/ /** In this example, CEEGMT is called to return **/ /** the current Greenwich Mean Time as the number **/ /** of days and number of seconds since **/ /** 14 October 1582. The Lilian date is then **/ /** printed. **/ /** **/ /***************************************************/ PLICGMT: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL LILIAN INT4; DCL SECONDS FLOAT8; DCL 01 FC FEEDBACK; /* Call CEEGMT to return current GMT as a */ /* Lilian date and Lilian seconds */ CALL CEEGMT ( LILIAN, SECONDS, FC ); /* If CEEGMT ran successfully, print results */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( LILIAN || ' days have passed since 14 October 1582.' ); END; ELSE DO; DISPLAY( 'CEEGMT failed with msg ' || FC.MsgNo ); STOP; END; END PLICGMT; ═══ 3.3.31. CEEGMTO-Get Offset from Greenwich Mean Time to Local Time ═══ CEEGMTO returns values to the calling routine representing the difference between the local system time and Greenwich Mean Time (GMT). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEGMTO──(──offset_hours──,──offset_minutes──,──offset_seconds──,──fc──)──────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ offset_hours (output) A 32-bit binary integer representing the offset from GMT to local time, in hours. For example, for Pacific Standard Time, offset_hours equals -8. The range of offset_hours is -12 to +13 (+13 = Daylight Savings Time in the +12 time zone). If local time offset is not available, offset_hours equals 0 and CEEGMTO terminates with a non-CEE000 symbolic feedback code. offset_minutes (output) A 32-bit binary integer representing the number of additional minutes that local time is ahead of or behind GMT. The range of offset_minutes is 0 to 59. If the local time offset is not available, offset_minutes equals 0 and CEEGMTO terminates with a non-CEE000 symbolic feedback code. CEEUTC is an alias of this service. See CEEUTC-Get Coordinated Universal Time. offset_seconds (output) A 64-bit double floating-point number representing the offset from GMT to local time, in seconds. For example, Pacific Standard Time is eight hours behind GMT. If local time is in the Pacific time zone during standard time, CEEGMTO would return -28,800 (-8 * 60 * 60). The range of offset_seconds is -43,200 to +46,800. offset_seconds can be used with CEEGMT to calculate local date and time. See CEEGMT-Get Current Greenwich Mean Time for more information. If the local time offset is not available from the system, offset_seconds is set to 0 and CEEGMTO terminates with a non-CEE000 symbolic feedback code. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2E7 │ 3 │ 2503 │ The offset from UTC/GMT to local time was not │ │ │ │ │ available from the system. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  CEEDATM is used to convert number of seconds to a character timestamp. See CEEDATM-Convert Seconds to Character Timestamp for more information.  CICS consideration-CEEGMTO does not use the OS TIME macro. Therefore, CEEGMTO works under CICS.  OpenEdition MVS consideration-In multithread applications, CEEGMTO affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCGMTO */ #include #include #include #include int main(void) { _FEEDBACK fc; _INT4 GMT_hours,GMT_mins; _FLOAT8 GMT_secs; CEEGMTO(&GMT_hours,&GMT_mins,&GMT_secs,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEGMTO failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("The difference between GMT and the local "); printf("time is:\n"); printf("%d hours, %d minutes\n",GMT_hours,GMT_mins); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTGMTO ************************************************* ** ** ** Function: CEEGMTO - get offset from ** ** Greenwich Mean Time ** ** to local time ** ** ** ** In this example, a call is made to CEEGMTO ** ** to return the offset from GMT to local time ** ** as separate binary integers representing ** ** offset hours, minutes, and seconds. The ** ** results are displayed. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. IGZTGMTO. DATA DIVISION. WORKING-STORAGE SECTION. 01 HOURS PIC S9(9) COMP. 01 MINUTES PIC S9(9) COMP. 01 SECONDS COMP-2. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLGMTO. CALL 'CEEGMTO' USING HOURS , MINUTES , SECONDS , FC. IF CEE000 of FC THEN DISPLAY 'Local time differs from GMT ' 'by: ' HOURS ' hours, ' MINUTES ' minutes, and ' SECONDS ' seconds. ' ELSE DISPLAY 'CEEGMTO failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMGMTO */ /***********************************************/ /** **/ /** Function: CEEGMTO - get the offset from **/ /** Greenwich Mean Time **/ /** to local time **/ /** **/ /***********************************************/ PLIGMTO: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL HOURS INT4; DCL MINUTES INT4; DCL SECONDS FLOAT8; DCL 01 FC FEEDBACK; /* Call CEEGMTO to return hours, minutes, and */ /* seconds that local time is offset from GMT */ CALL CEEGMTO ( HOURS, MINUTES, SECONDS, FC ); /* If CEEGMTO ran successfully, print results */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP EDIT('The difference between GMT and ' || 'local time is ', HOURS, ':', MINUTES ) (A, P'S99', A, P'99' ); END; ELSE DO; DISPLAY( 'CEEGMTO failed with msg ' || FC.MsgNo ); STOP; END; END PLIGMTO; ═══ 3.3.32. CEEGPID-Retrieve the LE/370 Version and Platform ID ═══ CEEGPID retrieves the LE/370 version ID and the platform ID of the version and platform of LE/370 that is processing the currently active condition. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEGPID──(──CEE_Version_ID──,──Plat_ID──,──fc──)──────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ CEE_Version_ID (output) A fullword integer representing the version of LE/370 that created this data block. The current value of this parameter is: 130 Version 1 Release 3 Modification level 0 Plat_ID (output) A fullword integer representing the platform used for processing the current condition. The current values of this parameter are: 2 OS/2 3 MVS or VM or 370 4 AS/400* fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS consideration-In multithread applications, CEEGPID affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCGPID */ #include #include #include #include int main(void) { _INT4 cee_ver_id, plat_id; _FEEDBACK fc; /* get the LE version and the platform id */ CEEGPID(common run-time environment_ver_id,&plat_id,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEGPID failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("the LE/370 version is %d",cee_ver_id); printf(" the current platform is "); switch (plat_id) { case 2: printf("OS/2\n"); break; case 3: printf("MVS/VM/370\n"); break; case 4: printf("AS/400\n"); break; default: printf("unrecognized platform id\n"); } }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTGPID ************************************************* ** ** ** Function: CEEGPID - retrieve the LE/370 ** ** version and platform ID ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. IGZTGPID. DATA DIVISION. WORKING-STORAGE SECTION. 01 VERSION PIC S9(9) COMP. 01 PLATID PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLGPID. ** Call CEEGPID to return the version and ** platform ID CALL 'CEEGPID' USING VERSION , PLATID , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEGPID failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. DISPLAY 'Currently running version ' VERSION ' of IBM AD/Cycle Language Environment' ** Evaluate PLATID to display this platform EVALUATE PLATID WHEN 2 DISPLAY 'under OS/2' WHEN 3 DISPLAY 'under MVS/VM/370' WHEN 4 DISPLAY 'on an AS/400' END-EVALUATE GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMGPID */ /********************************************/ /** **/ /** Function: CEEGPID - Get LE/370 Version **/ /** and Platform ID **/ /** **/ /** This example calls CEEGPID to get the **/ /** version and platform of Language **/ /** Environment that is currently running. **/ /**This information is then printed out. **/ /** **/ /********************************************/ PLIGPID: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL VERSION INT4; DCL PLATID INT4; DCL 01 FC FEEDBACK; /* Call CEEGPID to get the version and platform */ /* of Language Environment that is currently */ /* running */ CALL CEEGPID ( VERSION, PLATID, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST ('Language Environment Version ' || VERSION); PUT LIST (' is running on system '); SELECT (PLATID); WHEN (2) PUT LIST( 'OS/2'); WHEN (3) PUT LIST( 'MVS/VM/370'); WHEN (4) PUT LIST( 'AS/400'); END /* Case of PLATID */; END; ELSE DO; DISPLAY( 'CEEGPID failed with msg ' || FC.MsgNo ); STOP; END; END PLIGPID; ═══ 3.3.33. CEEGQDT-Retrieve q_data_token ═══ CEEGQDT retrieves the q_data_token from the Instance Specific Information (ISI). CEEGQDT is particularly useful when you have user-written condition handlers registered by CEEHDLR. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEGQDT──(──cond_rep──,──q_data_token──,──fc──)───────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ cond_rep (input) A condition token defining the condition for which the q_data_token is retrieved. q_data_token (output) A 32-bit data object defined in the CEESQDT service and placed in the ISI by the CEESGL service. fc (output) An optional 12-byte condition token returned by CEEGQDT indicating the result of the service. The following feedback codes can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0EE │ 3 │ 0462 │ Instance specific information for the condi- │ │ │ │ │ tion token with message number message-number │ │ │ │ │ and facility ID facility-id could not be │ │ │ │ │ found. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0EG │ 3 │ 0464 │ Instance specific information for the condi- │ │ │ │ │ tion token with message number message-number │ │ │ │ │ and facility ID facility-id did not exist. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS consideration-In multithread applications, CEEGQDT affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCGQDT */ #include #include #include #include #include void handler(_FEEDBACK *,_INT4 *,_INT4 *,_FEEDBACK *); typedef struct { /* condition info structure */ int error_value; char err_msg[80]; int retcode; } info_struct; int main(void) { _FEEDBACK fc,condtok; _ENTRY routine; _INT4 token,qdata; _INT2 c_1,c_2,cond_case,sev,control; _CHAR3 facid; _INT4 isi; info_struct *info; /* . . . */ /* register the condition handler */ token = 99; routine.address = (_POINTER)&handler; routine.nesting = NULL; CEEHDLR(&routine,&token,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEHDLR failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ /* set up the condition info structure */ info = (info_struct *)malloc(sizeof(info_struct)); if (info == NULL) { printf("error allocating info_struct\n"); exit(2399); } info->error_value = 86; strcpy(info->err_msg,"Test message"); info->retcode = 99; /* set qdata to be the condition info structure */ qdata = (int)info; /* build the condition token */ c_1 = 3; c_2 = 99; cond_case = 1; sev = 3; control = 0; memcpy(facid,"ZZZ",3); isi = 0; CEENCOD(&c_1,&c_2,&cond_case,&sev,&control, facid,&isi,&condtok,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEENCOD failed with message number %d\n", fc.tok_msgno); exit(2999); } /* signal the condition */ CEESGL(&condtok,&qdata,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEESGL failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ } void handler(_FEEDBACK *fc, _INT4 *token, _INT4 *result, _FEEDBACK *newfc) { _FEEDBACK qdatafc; _INT4 idata; info_struct *qdata; /* . . . */ /* get the q_data_token from the ISI */ CEEGQDT(fc, &idata, &qdatafc); if ( _FBCHECK ( qdatafc , CEE000 ) != 0 ) { printf("CEEGQDT failed with message number %d\n", qdatafc.tok_msgno); *result = 20; /* percolate */ return; } /************************************************/ /* set info_struct pointer to address return by */ /* CEEGQDT */ /************************************************/ qdata = (info_struct *) idata; /* use the condition info structure (qdata) */ if (qdata->error_value == 86) { printf("%.12s\n",qdata->err_msg); printf("retcode = %d\n",qdata->retcode); *result = 10; /* resume this is what we want */ return; } /* . . . */ *result = 20; /* percolate */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTGQDT ************************************************* ** ** ** DRVGQDT - Drive sample program for CEEGQDT ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. DRVGQDT. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 TOKEN PIC S9(9) COMP. 01 SEV PIC S9(4) COMP. 01 MSGNO PIC S9(4) COMP. 01 CASE PIC S9(4) COMP. 01 SEV2 PIC S9(4) COMP. 01 CNTRL PIC S9(4) COMP. 01 FACID PIC X(3). 01 ISINFO PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 QDATA PIC S9(9) COMP. 01 CONDTOK. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. ** Register handler SET ROUTINE TO ENTRY 'CBLGQDT'. CALL 'CEEHDLR' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ** Signal a condition MOVE 1 TO QDATA. SET CEE001 of CONDTOK to TRUE. MOVE ZERO to I-S-Info of CONDTOK. CALL 'CEESGL' USING CONDTOK , QDATA , FC. IF CEE000 of FC THEN DISPLAY '**** Resumed execution in the ' 'routine which registered the handler' ELSE DISPLAY 'CEESGL failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. ** UNregister handler CALL 'CEEHDLU' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLU failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. STOP RUN. END PROGRAM DRVGQDT. *COMPILATION UNIT: CBLGQDT ****************************************** ** ** ** Function: CEEGQDT - get q_data_token ** ** ** ****************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLGQDT. DATA DIVISION. WORKING-STORAGE SECTION. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 QDATA PIC S9(9) COMP. LINKAGE SECTION. 01 CURCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 TOKEN PIC S9(9) COMP. 01 RESULT PIC S9(9) COMP. 88 RESUME VALUE 10. 01 NEWCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION USING CURCOND, TOKEN, RESULT, NEWCOND. PARA-CBLGQDT. ** Obtain the Qdata for the current condition CALL 'CEEGQDT' USING CURCOND , QDATA , FC. IF CEE000 of FC THEN DISPLAY 'QDATA for ' Facility-ID of CURCOND Msg-No of CURCOND ' is ' QDATA ELSE DISPLAY 'CEEGQDT failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. SET RESUME TO TRUE. GOBACK. END PROGRAM CBLGQDT.  PL/I Example The following example uses a COBOL program and handler to establish the condition handling environment prior to calling a PL/I subroutine to illustrate the use of the callable service from PL/I. CBL LIB,APOST *COMPILATION UNIT: IGZTGQDP ************************************************* ** ** ** IGZTGQDP - Drive sample program for CEEGQDT ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. IGZTGQDP. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 TOKEN PIC S9(9) COMP. 01 SEV PIC S9(4) COMP. 01 MSGNO PIC S9(4) COMP. 01 CASE PIC S9(4) COMP. 01 SEV2 PIC S9(4) COMP. 01 CNTRL PIC S9(4) COMP. 01 FACID PIC X(3). 01 ISINFO PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 QDATA PIC S9(9) COMP. 01 CONDTOK. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. ** Register handler SET ROUTINE TO ENTRY 'HDLGQDT'. CALL 'CEEHDLR' USING ROUTINE, TOKEN, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ** Signal a condition MOVE 1 TO QDATA. SET CEE001 of CONDTOK to TRUE. MOVE ZERO to I-S-Info of CONDTOK. CALL 'CEESGL' USING CONDTOK, QDATA, FC. IF CEE000 of FC THEN DISPLAY '**** Resumed execution in the ' 'routine which registered the handler' ELSE DISPLAY 'CEESGL failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. ** UNregister handler CALL 'CEEHDLU' USING ROUTINE, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLU failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. STOP RUN. END PROGRAM IGZTGQDP. *COMPILATION UNIT: HDLGQDT ************************************************* ** ** ** HDLGQDT -- COBOL condition handler to call ** ** PL/I routine for actual work. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. HDLGQDT. DATA DIVISION. LINKAGE SECTION. 01 CURCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 TOKEN PIC S9(9) COMP. 01 RESULT PIC S9(9) COMP. 01 NEWCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION USING CURCOND, TOKEN, RESULT, NEWCOND. PARA-CBLGQDT. ** Invoke the PL/I routine to handle condition CALL 'IBMGQDT' USING ADDRESS OF CURCOND, ADDRESS OF TOKEN, ADDRESS OF RESULT, ADDRESS OF NEWCOND. GOBACK. END PROGRAM HDLGQDT. *PROCESS OPT(0), MACRO; /*COMPILATION UNIT: IBMGQDT **/ /****************************************************/ /** ***/ /** Function: CEEGQDT -- get qualifying data ***/ /** ***/ /****************************************************/ IBMGQDT: PROCEDURE( @CONDTOK, @TOKEN, @RESULT, @NEWCOND ) OPTIONS( COBOL ); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; /* Parameters */ DCL @CONDTOK POINTER; DCL @TOKEN POINTER; DCL @RESULT POINTER; DCL @NEWCOND POINTER; DCL 01 CONDTOK BASED(@CONDTOK) FEEDBACK; DCL TOKEN BASED(@TOKEN) INT4; DCL RESULT BASED(@RESULT) INT4; DCL 01 NEWCOND BASED(@NEWCOND) FEEDBACK; /* Local identifiers */ DCL QDATA INT4; DCL 01 FC FEEDBACK; IF FBCHECK(CONDTOK, CEE001) THEN /* expected */ DO; /* Call CEEGQDT with condition token defined */ /* above to retrieve associated q_data */ CALL CEEGQDT ( CONDTOK, QDATA, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Qualifying data for current ' || ' condition is ' || QDATA ); RESULT = 10 /* Resume */; END; ELSE DO; DISPLAY( 'CEEGQDT failed with msg ' || FC.MsgNo ); NEWCOND = FC; RESULT = 30 /* Promote */; END; END; ELSE /* Unexpected condition -- percolate */ DO; DISPLAY( 'User condition handler entered for ' || CONDTOK.FacID || ' condition with message ' || 'number ' || CONDTOK.MsgNo ); RESULT = 20 /* Percolate */; END; RETURN; END IBMGQDT; ═══ 3.3.34. CEEGTST-Get Heap Storage ═══ CEEGTST gets storage from a heap whose ID you specify. It is used to acquire both large and small blocks of storage. CEEGTST always allocates storage that is addressable by the caller. Therefore, if the caller is in AMODE(24), or if HEAP(,,BELOW) is in effect, the storage returned is always below the 16M line. Above-the-line storage is returned only if the caller is in AMODE(31) and HEAP(,,ANY) is in effect. See HEAP for further information about the LE/370 HEAP run-time option. All requests for storage are conditional. If storage is not available, the feedback code (fc) is set and returned to you, but the thread does not abend. When storage is not available, the appropriate action in the member environment should be taken. One option is to use the CEESGL callable service to signal the LE/370 condition handler with the returned feedback code. For more information, see CEESGL-Signal a Condition. Storage obtained by CEEGTST can be freed by a call to CEEFRST or CEEDSHP. You can also free storage by using a language intrinsic function. If storage is not explicitly freed, it is freed automatically at termination. For more information about CEEFRST and CEEDSHP, see CEEFRST-Free Heap Storage and CEEDSHP-Discard Heap. If you have specified a heap_alloc_value in the STORAGE run-time option, all storage allocated by CEEGTST is initialized to heap_alloc_value. Otherwise, it is left uninitialized. For more information about the STORAGE run-time option, see STORAGE. If the value specified in the size parameter of CEEGTST is greater than the size of an increment (as specified in the HEAP run-time option), all of the requested storage (rounded up to the nearest doubleword) is allocated in a single system-level call. Heap storage is acquired by a system-level get storage call in increments of init_size and incr_size bytes as specified by the HEAP run-time option, or in CEECRHP-Create New Additional Heap. If the increment size is chosen appropriately, only a few of the calls to CEEGTST result in a system call. The storage report generated when the RPTSTG run-time option is specified shows the number of system-level get storage calls required. This helps you tune the init_size and incr_size fields in order to minimize calls to the operating system. For more information about HEAP and RPTSTG see HEAP and RPTSTG. For more information about CEECRHP, see CEECRHP-Create New Additional Heap. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEGTST──(──heap_id──,──size──,──address──,──fc──)────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ heap_id (input) A fullword binary signed integer. heap_id is a token denoting the heap in which the storage is allocated. A heap_id of 0 allocates storage from the initial heap (or user heap). Any other heap_id must be a value obtained from the CEECRHP-Create Additional Heap callable service. If the heap_id you specify is invalid, no storage is allocated. CEEGTST terminates with a non-CEE000 symbolic feedback code and the value of the address parameter is undefined. For more information about the CEECRHP callable service, see CEECRHP-Create New Additional Heap. size (input) A fullword binary signed integer. size represents the amount of storage allocated, in bytes. If the specified amount of storage cannot be obtained, no storage is allocated, CEEGTST terminates with a non-CEE000 symbolic feedback code, and the value of the address parameter is undefined. address (output) A fullword address pointer. address is the machine address of the first byte of allocated storage. If storage cannot be obtained, address remains undefined. Storage is always allocated on a doubleword boundary. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P2 │ 4 │ 0802 │ Heap storage control information was damaged. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P3 │ 3 │ 0803 │ The heap identifier in a get storage request │ │ │ │ │ or a discard heap request was unrecognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0P8 │ 3 │ 0808 │ Storage size in a get storage request or a │ │ │ │ │ re-allocate request was not a positive number. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0PD │ 3 │ 0813 │ Insufficient storage was available to satisfy │ │ │ │ │ a get storage request. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  PL/I considerations-Storage allocated within PL/I AREAs is managed by PL/I. Therefore, only PL/I language functions can allocate and free storage within a PL/I area. Based upon the layout of a PL/I structure, PL/I might adjust the starting byte of the PL/I structure to a non-doubleword aligned byte. The difference between the doubleword boundary and the first byte of such a structure is known as the hang. Because LE/370 callable storage services do not adjust the starting byte, you must be careful using callable services to allocate storage for PL/I structures. You must use fully defined structures and aggregates.  CICS considerations-In a CICS environment, size should not exceed 1024M (1 gigabyte or X'40000000') when running in AMODE ANY, and 65,504 bytes when running in AMODE(24). These CICS restrictions are subject to change from one release of CICS to another. Portable applications should respect current CICS limitations.  OpenEdition MVS considerations-CEEGTST applies to the enclave. Any thread can free the allocated storage. Examples  C/370 Example /*COMPILATION UNIT: EDCGTST */ #include #include #include #include int main(void) { _INT4 heapid, size; _POINTER address; _FEEDBACK fc; /* . . . */ heapid = 0; /* get storage from initial heap */ size = 4000; /* number of bytes of heap storage */ /* obtain the storage using CEEGTST */ CEEGTST(&heapid,&size,&address,&fc); /* check the first 4 bytes of the feedback token */ /* (0 if successful) */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEGTST failed with message number %d\n", fc.tok_msgno); exit(99); } /* . . . */ /* free the storage that was previously obtained */ /* using CEEGTST */ CEEFRST(&address,&fc); /* check the first 4 bytes of the feedback token */ /* (0 if successful) */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEFRST failed with message number %d\n", fc.tok_msgno); exit(99); } /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTGTST *************************************************** ** ** ** Function: CEEGTST - get heap storage ** ** ** ** In this example, a call is made to CEEGTST to ** ** obtain 4000 bytes of storage from the initial ** ** heap (HEAPID=0). ** ** ** *************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. IGZTGTST. DATA DIVISION. WORKING-STORAGE SECTION. 01 HEAPID PIC S9(9) COMP. 01 STGSIZE PIC S9(9) COMP. 01 ADDRSS PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. ** Specify 0 to get storage from the initial heap. ** Specify 4000 to get 4000 bytes of storage. ** Call CEEGTST to obtain storage. PARA-CBLGTST. MOVE 0 TO HEAPID. MOVE 4000 TO STGSIZE. CALL 'CEEGTST' USING HEAPID , STGSIZE , ADDRSS , FC. IF CEE000 of FC THEN DISPLAY 'Obtained ' STGSIZE ' bytes of' ' storage at location ' ADDRSS ' from heap number ' HEAPID ELSE DISPLAY 'CEEGTST failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMGTST /****************************************************/ /** **/ /** Function: CEEGTST - Get Heap Storage **/ /** **/ /** In this example, a call is made to CEEGTST to **/ /** request 4000 bytes of storage from the **/ /** initial heap. **/ /** **/ /****************************************************/ PLIGTST: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL HEAPID INT4; DCL STGSIZE INT4; DCL ADDRSS POINTER; DCL 01 FC FEEDBACK; HEAPID = 0; /* get storage from the initial heap */ STGSIZE = 4000; /* get 4000 bytes of storage */ /* Call CEEGTST to obtain the storage */ CALL CEEGTST ( HEAPID, STGSIZE, ADDRSS, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Obtained ' || STGSIZE || ' bytes of storage at location ' || DECIMAL( UNSPEC( ADDRSS1 ) ) || ' from heap ' || HEAPID ); END; ELSE DO; DISPLAY( 'CEEGTST failed with msg ' || FC.MsgNo ); STOP; END; END PLIGTST; ═══ 3.3.35. CEEHDLR-Register User-Written Condition Handler ═══ CEEHDLR registers a user-written condition handler for the current stack frame (note that stack frames are called by various names in different HLLs). The user condition handler is invoked when:  It is registered for the current stack frame by CEEHDLR, and  The LE/370 condition manager requests the condition handler associated with the current stack frame handle the condition. LE/370 places the user-written condition handlers associated with each stack frame in a queue. The queue can be empty at any given time. The LE/370 condition manager invokes the registered condition handlers in LIFO (last in, first out) order to handle the condition. The opposite of CEEHDLR, which registers a user-written condition handler, is CEEHDLU, which unregisters the handler. However, you are not required to remove user-written condition handlers you registered through the CEEHDLR callable service. Any user-written condition handlers created through CEEHDLR and not unregistered by CEEHDLU are unregistered automatically by LE/370 when the associated stack frame is removed from the stack. LE/370 condition handlers are driven only for synchronous conditions. Note: PL/I cannot use CEEHDLR, because user-written condition handlers cannot be registered in PL/I. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEHDLR──(──routine──,──token──,──fc──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ routine (input) An entry variable or entry constant for the routine called to process the condition. The entry variable or constant must be passed by reference. The routine must be an external routine; that is, it must not be a nested routine. token (input) A fullword integer of information you want passed to your user handler each time it is called. This can be a pointer or any other fullword integer you want to pass. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE080 │ 1 │ 0256 │ The routine specified was already registered │ │ │ │ │ for this stack frame. It was registered again. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE081 │ 3 │ 0257 │ The routine specified contained an invalid │ │ │ │ │ entry variable. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  COBOL consideration-You should not call CEEHDLR from a nested COBOL program.  OpenEdition MVS consideration-In multithread applications, CEEHDLR affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCHDLR */ #include #include #include #include void handler(_FEEDBACK *,_INT4 *,_INT4 *,_FEEDBACK *); int main(void) { _FEEDBACK fc; _ENTRY routine; _INT4 token; /* set the routine structure to point to the handler */ /* and use CEEHDLR to register the user handler */ token = 99; routine.address = (_POINTER)&handler; routine.nesting = NULL; CEEHDLR(&routine,&token,&fc); /* verify that CEEHDLR was successful */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEHDLR failed with message number %d\n", fc.tok_msgno); exit (2999); } /* . . . */ } /*******************************************************/ /* handler is a user condition handler */ /*******************************************************/ void handler(_FEEDBACK *fc, _INT4 *token, _INT4 *result, _FEEDBACK *newfc) { /* . . . */ }  COBOL/370 Example COBOL/370 Routine that Registers HANDLER Routine CBL LIB,APOST *COMPILATION UNIT: IGZTHDLR *********************************************** ** ** ** Function: CEEHDLR - Register user ** ** condition handler ** ** ** *********************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLHDLR. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 TOKEN PIC S9(9) COMP. 01 SEV PIC S9(4) COMP. 01 MSGNO PIC S9(4) COMP. 01 CASE PIC S9(4) COMP. 01 SEV2 PIC S9(4) COMP. 01 CNTRL PIC S9(4) COMP. 01 FACID PIC X(3). 01 ISINFO PIC S9(9) COMP. 01 QDATA PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 CONDTOK. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLHDLR. SET ROUTINE TO ENTRY 'HANDLER'. CALL 'CEEHDLR' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. * RAISE A SIGNAL PARA-CBLSGL. ** Call CEENCOD with the values assigned above to ** build a condition token "CONDTOK" ** Set CONDTOK to sev = 3, msgno = 1 facid = CEE ** We raise a sev 3 to ensure our handler is driven MOVE 3 TO SEV. MOVE 1 TO MSGNO. MOVE 1 TO CASE. MOVE 3 TO SEV2. MOVE 1 TO CNTRL. MOVE 'CEE' TO FACID. MOVE 0 TO ISINFO. CALL 'CEENCOD' USING SEV, MSGNO, CASE, SEV2, CNTRL, FACID, ISINFO, CONDTOK, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEENCOD failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ** Call CEESGL to signal the condition with ** the condition token and qdata described ** in CONDTOK and QDATA MOVE 0 TO QDATA. CALL 'CEESGL' USING CONDTOK , QDATA , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEESGL failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK. COBOL/370 User-Written Condition Handler Registered by CBLHDLR CBL LIB,APOST,NOOPT,NODYNAM *COMPILATION UNIT: IGZTHAND ************************************************* ** ** ** DRVHAND - Drive sample program for COBOL ** ** user-written condition handler. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. DRVHAND. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 DENOMINATOR PIC S9(9) COMP. 01 NUMERATOR PIC S9(9) COMP. 01 RATIO PIC S9(9) COMP. 01 TOKEN PIC S9(9) COMP VALUE 0. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. REGISTER-HANDLER. ** Register handler SET ROUTINE TO ENTRY 'HANDLER'. CALL 'CEEHDLR' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. RAISE-CONDITION. ** Cause a zero-divide condition. MOVE 0 TO DENOMINATOR. MOVE 1 TO NUMERATOR. DIVIDE NUMERATOR BY DENOMINATOR, GIVING RATIO. DISPLAY 'Execution continues following ' 'divide-by-zero exception'. UNREGISTER-HANDLER. ** UNregister handler CALL 'CEEHDLU' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLU failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. STOP RUN. END PROGRAM DRVHAND. *COMPILATION UNIT: HANDLER IDENTIFICATION DIVISION. PROGRAM-ID. HANDLER. DATA DIVISION. WORKING-STORAGE SECTION. LINKAGE SECTION. 01 TOKEN PIC S9(9) COMP. 01 RESULT PIC S9(9) COMP. 88 RESUME VALUE 10. 01 CURCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 NEWCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION USING CURCOND, TOKEN, RESULT, NEWCOND. PARA-HANDLER. DISPLAY 'Entered user handler for condition' ' with message number ' Msg-No Of CURCOND ' -- will resume execution'. SET RESUME TO TRUE. GOBACK.  Assembler Example AHDL TITLE 'main program that registers a handler' * * symbolic register definitions and usage * R0 EQU 0 parm list addr (CMS only) R1 EQU 1 parm list addr, 0=none R10 EQU 10 base reg of exectbl code R12 EQU 12 LE CAA addr R13 EQU 13 DSA addr R14 EQU 14 return point addr R15 EQU 15 entry point address * * Prologue * ASMHDLR CEEENTRY AUTO=DSASIZ, main memory to obtain * MAIN=YES, this program is a mn prog * PPA=PPA1, our program prolog area * BASE=R10 base reg for exectbl code USING CEECAA,R12 address for LE CAA USING CEEDSA,R13 address for dynamic data * * announce ourselves * WTO 'ASMHDLR Says "HELLO"',ROUTCDE=11 * * register user handler * LA R1,USRHDLPP get proc-ptr addr to hdlr ST R1,PARM1 make it 1st parameter LA R1,TOKEN get addr of 32-bit token ST R1,PARM2 make it 2nd parameter LA R1,FEEDBACK get addr of feedback code ST R1,PARM3 make it 3rd parameter LA R1,HDLRPLST pt to CEEHDLR's parm list CALL CEEHDLR invoke CEEHDLR service CLC FEEDBACK,=XL12'00' check for success... BE HDLRGOOD skip diagnostics if success * failure...issue diagnostics WTO '**** call to CEEHDLR failed ****', * ROUTCDE=11 ABEND 1,DUMP terminate prgm w/ dump HDLRGOOD EQU * handler registered OK * * ... code covered by user-written hndlr goes here... * * un-register user handler * LA R1,USRHDLPP get proc-ptr addr to HDLR ST R1,HDLUPRM1 make it 1st parameter LA R1,HDLUFBC addr for feedback code ST R1,HDLUPRM2 make it 2nd parameter LA R1,HDLUPLST pt to CEEHDLU parm list CALL CEEHDLU invoke CEEHDLU service * * bid a fond farewell * WTO 'ASMHDLR Says "GOOD-BYE"',ROUTCDE=11 * * epilogue * CEETERM RC=4,MODIFIER=1 terminate program * * program constants and local static variables * USRHDLPP DC V(USRHDLR),A(0) proc-ptr to handlr * LTORG , put literal pool here EJECT PPA1 CEEPPA , our program prolog area EJECT CEEDSA , map CEE DSA * * local automatic (dynamic) storage. * HDLRPLST DS 0F PARM1 DS A addr of user-writ handler PARM2 DS A addr of 32-bit token PARM3 DS A addr of feedback code * HDLUPLST DS 0F HDLUPRM1 DS A addr of user-writ handler HDLUPRM2 DS A addr of feedback code * TOKEN DS F 32-bit token: fullword * *value* is passed * to user handler each * time it is called * FEEDBACK DS CL12 CEEHDLR feedback code * HDLUFBC DS CL12 CEEHDLU feedback code * DSASIZ EQU *-CEEDSA length of DSA EJECT CEECAA , map LE370 CAA END ASMHDLR ═══ 3.3.36. CEEHDLU-Unregister User-Written Condition Handler ═══ CEEHDLU unregisters a user condition handler for the current stack frame. You are not required to remove user-written condition handlers you registered through the CEEHDLR callable service. Any user-written condition handlers created through CEEHDLR and not unregistered by CEEHDLU are unregistered automatically by LE/370 when the associated stack frame is removed from the stack. Note: PL/I cannot use CEEHDLU, because user-written condition handlers cannot be registered in PL/I. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEHDLU──(──routine──,──fc──)─────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ routine (input) An entry variable or constant for the routine to be unregistered as a user condition handler. This routine must be previously registered (with CEEHDLR) by the same stack frame that invokes CEEHDLU. See CEEHDLR-Register User-Written Condition Handler for further information about specifying the routine parameter. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE07S │ 1 │ 0252 │ CEEHDLU was unable to find the requested user │ │ │ │ │ condition handler routine. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS consideration-In multithread applications, CEEHDLU affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCHDLU */ #include #include #include #include void handler(_FEEDBACK *,_INT4 *,_INT4 *,_FEEDBACK *); int main(void) { _FEEDBACK fc; _ENTRY routine; _INT4 token; /* set the routine structure to point to the handler */ /* and use CEEHDLR to register the user handler */ token = 99; routine.address = (_POINTER)&handler; routine.nesting = NULL; CEEHDLR(&routine,&token,&fc); /* verify that CEEHDLR was successful */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEHDLR failed with message number %d\n", fc.tok_msgno); exit (2999); } /* . . . */ /* Unregister the condition handler */ CEEHDLU(&routine,&fc); /* verify that CEEHDLU was successful */ if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEHDLU failed with message number %d\n", fc.tok_msgno); exit (2999); } /* . . . */ } void handler(_FEEDBACK *fc, _INT4 *token, _INT4 *result, _FEEDBACK *newfc) { /* . . . */ }  COBOL/370 Example COBOL/370 Routine that Unregisters User-Written Condition Handler CBL LIB,APOST *COMPILATION UNIT: IGZTHDLU *************************************************** ** ** ** Function: CEEHDLU - unregister user condition ** ** handler ** ** ** ** In this example, a call is made to CEEHDLU to ** ** unregister a user condition handler ** ** previously registered using CEEHDLR. ** ** ** *************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLHDLU. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 TOKEN PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLHDLR. SET ROUTINE TO ENTRY 'HANDLER'. CALL 'CEEHDLR' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; ELSE DISPLAY 'HANDLER REGISTERED'; END-IF. * . * . * . PARA-CBLHDLU. CALL 'CEEHDLU' USING ROUTINE , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLU failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; ELSE DISPLAY 'HANDLER UNREGISTERED'; END-IF. GOBACK. END PROGRAM CBLHDLU. COBOL / 370User - WrittenConditionHandlerRegisteredbyCBLHDLRandUnregisteredbyCBLHDLU CBL LIB,APOST,NOOPT,NODYNAM *COMPILATION UNIT: IGZTHAND ************************************************* ** ** ** DRVHAND - Drive sample program for COBOL ** ** user-written condition handler. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. DRVHAND. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 DENOMINATOR PIC S9(9) COMP. 01 NUMERATOR PIC S9(9) COMP. 01 RATIO PIC S9(9) COMP. 01 TOKEN PIC S9(9) COMP VALUE 0. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. REGISTER-HANDLER. ** Register handler SET ROUTINE TO ENTRY 'HANDLER'. CALL 'CEEHDLR' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. RAISE-CONDITION. ** Cause a zero-divide condition. MOVE 0 TO DENOMINATOR. MOVE 1 TO NUMERATOR. DIVIDE NUMERATOR BY DENOMINATOR, GIVING RATIO. DISPLAY 'Execution continues following ' 'divide-by-zero exception'. UNREGISTER-HANDLER. ** UNregister handler CALL 'CEEHDLU' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLU failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. STOP RUN. END PROGRAM DRVHAND. *COMPILATION UNIT: HANDLER IDENTIFICATION DIVISION. PROGRAM-ID. HANDLER. DATA DIVISION. WORKING-STORAGE SECTION. LINKAGE SECTION. 01 TOKEN PIC S9(9) COMP. 01 RESULT PIC S9(9) COMP. 88 RESUME VALUE 10. 01 CURCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 NEWCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION USING CURCOND, TOKEN, RESULT, NEWCOND. PARA-HANDLER. DISPLAY 'Entered user handler for condition' ' with message number ' Msg-No Of CURCOND ' -- will resume execution'. SET RESUME TO TRUE. GOBACK. ═══ 3.3.37. CEEISEC-Convert Integers to Seconds ═══ CEEISEC converts separate binary integers representing year, month, day, hour, minute, second, and millisecond to a number representing the number of seconds since 00:00 14 October 1582. Use CEEISEC instead of CEESECS when the input is in numeric format rather than character format. The inverse of CEEISEC is CEESECI, which converts number of seconds to integer year, month, day, hour, minute, second, and millisecond. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEISEC──(──input_year──,──input_months──,──input_day──,──input_hours──,──input_minutes────> │ │ │ │ >──,──input_seconds──,──input_milliseconds──,──output_seconds──,──fc──)───────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ input_year (input) A 32-bit binary integer representing the year. The range of valid input_years is 1582 to 9999, inclusive. input_month (input) A 32-bit binary integer representing the month. The range of valid input_month is 1 to 12. input_day (input) A 32-bit binary integer representing the day. The range of valid input_days is 1 to 31. input_hours (input) A 32-bit binary integer representing the hours. The range of valid input_hours is 0 to 23. input_minutes (input) A 32-bit binary integer representing the minutes. The range of valid input_minutes is 0 to 59. input_seconds (input) A 32-bit binary integer representing the seconds. The range of valid input_seconds is 0 to 59. input_milliseconds (input) A 32-bit binary integer representing milliseconds. The range of valid input_milliseconds is 0 to 999. output_seconds (output) A 64-bit double floating-point number representing the number of seconds since 00:00 on 14 October 1582, not counting leap seconds. For example, 00:01 on 15 October 1582 is second number 86,401 (24*60*60 + 01). The valid range of output_seconds is 86,400 to 265,621,679,999.999 (23:59.999 31 December 9999). If any input values are invalid, output_seconds is set to zero. To convert output_seconds to a Lilian day number, divide output_seconds by 86,400 (the number of seconds in a day). fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EE │ 3 │ 2510 │ The hours value was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EF │ 3 │ 2511 │ The day value was invalid for year and month │ │ │ │ │ specified. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EH │ 3 │ 2513 │ The input date was not within the supported │ │ │ │ │ range. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EI │ 3 │ 2514 │ The year value was not within the supported │ │ │ │ │ range. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EJ │ 3 │ 2515 │ The milliseconds value was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EK │ 3 │ 2516 │ The minutes value was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EL │ 3 │ 2517 │ The month value was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EN │ 3 │ 2519 │ The seconds value was not recognized. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  OpenEdition MVS consideration-In multithread applications, CEEISEC affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCISEC */ #include #include #include #include int main(void) { _INT4 year, month, day, hours, minutes, seconds, millisecs; _FLOAT8 output; _FEEDBACK fc; year = 1991; month = 9; day = 13; hours = 4; minutes = 34; seconds = 25; millisecs = 746; CEEISEC(&year,&month,&day,&hours,&minutes,&seconds, &millisecs,&output,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEISEC failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("The number of seconds between 00:00.00" " 10/14/1582 and 04:25.746 09/13/1991" " is %.3f\n",output); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTISEC ************************************************* ** ** ** Function: CEEISEC - convert integers to ** ** seconds ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLISEC. DATA DIVISION. WORKING-STORAGE SECTION. 01 YEAR PIC S9(9) COMP. 01 MONTH PIC S9(9) COMP. 01 DAYS PIC S9(9) COMP. 01 HOURS PIC S9(9) COMP. 01 MINUTES PIC S9(9) COMP. 01 SECONDS PIC S9(9) COMP. 01 MILLSEC PIC S9(9) COMP. 01 OUTSECS COMP-2. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLISEC. ** Specify seven binary integers representing ** the date and time as input to be converted ** to Lilian seconds MOVE 2000 TO YEAR. MOVE 1 TO MONTH. MOVE 1 TO DAYS. MOVE 0 TO HOURS. MOVE 0 TO MINUTES. MOVE 0 TO SECONDS. MOVE 0 TO MILLSEC. ** Call CEEISEC to conervt the integers to seconds CALL 'CEEISEC' USING YEAR , MONTH , DAYS , HOURS , MINUTES , SECONDS , MILLSEC , OUTSECS , FC. ** If CEEISEC runs successfully, display result. IF CEE000 of FC THEN DISPLAY MONTH '/' DAYS '/' YEAR ' AT ' HOURS ':' MINUTES ':' SECONDS ' is equivalent to ' OUTSECS ' seconds' ELSE DISPLAY 'CEEISEC failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMISEC /****************************************************/ /** **/ /** Function: CEEISEC - Convert integers to **/ /** seconds **/ /** **/ /** In this example, CEEISEC is called to convert **/ /** integers representing the date and time to the **/ /** number of seconds since 00:00 14 October 1582. **/ /** **/ /****************************************************/ PLIISEC: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL YEAR INT4; DCL MONTH INT4; DCL DAYS INT4; DCL HOURS INT4; DCL MINUTES INT4; DCL SECONDS INT4; DCL MILLSEC INT4; DCL OUTSECS FLOAT8; DCL 01 FC FEEDBACK; /* Specify integers representing */ /* 00:00 1 January 2000 */ YEAR = 2000; MONTH = 1; DAYS = 1; HOURS = 0; MINUTES = 0; SECONDS = 0; MILLSEC = 0; /* Call CEEISEC to convert integers to Lilian */ /* seconds */ CALL CEEISEC ( YEAR, MONTH, DAYS, HOURS, MINUTES, SECONDS, MILLSEC, OUTSECS, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT EDIT( OUTSECS, ' seconds corresponds to ', MONTH, '/', DAYS, '/', YEAR, ' at ', HOURS, ':', MINUTES, ':', SECONDS, '.', MILLSEC ) (SKIP, F(9), A, 2 (P'99',A), P'9999', A, 3 (P'99', A), P'999' ); END; ELSE DO; DISPLAY( 'CEEISEC failed with msg ' || FC.MsgNo ); STOP; END; END PLIISEC; ═══ 3.3.38. CEEITOK-Return Initial Condition Token ═══ CEEITOK returns the initial condition for the current condition. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEITOK──(──i_ctok──,──fc──)──────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ i_ctok(output) A 12-byte condition token (see CEENCOD-Construct a Condition Token for information) identifying the initial condition in the current active data block being processed. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE35S │ 1 │ 3260 │ No condition was active when a call to a con- │ │ │ │ │ dition management routine was made. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-In multithread applications, CEEITOK affects only the calling thread. CEEITOK returns the initial token for the condition of the thread. Examples  C/370 Example /*COMPILATION UNIT: EDCITOK */ #include #include #include #include void handler(_FEEDBACK *,_INT4 *,_INT4 *,_FEEDBACK *); int main(void) { _FEEDBACK fc,condtok; _ENTRY routine; _INT4 token,qdata; _INT2 c_1,c_2,cond_case,sev,control; _CHAR3 facid; _INT4 isi; /* register condition handler */ token = 99; routine.address = (_POINTER)&handler; routine.nesting = NULL; CEEHDLR(&routine,&token,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEHDLR failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ /* build the condition token */ c_1 = 1; c_2 = 99; cond_case = 1; sev = 1; control = 0; memcpy(facid,"ZZZ",3); isi = 0; CEENCOD(&c_1,&c_2,&cond_case,&sev,&control, facid,&isi,&condtok,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEENCOD failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ /* signal the condition */ CEESGL(&condtok,&qdata,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEESGL failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ } void handler(_FEEDBACK *fc, _INT4 *token, _INT4 *result, _FEEDBACK *newfc) { _FEEDBACK orig_fc, itok_fc; /* . . . */ /* get the original condition token */ CEEITOK(&orig_fc, &itok_fc); if ( _FBCHECK ( itok_fc , CEE000 ) != 0 ) { printf("CEEITOK failed with message number %d\n", itok_fc.tok_msgno); exit(2999); } /* . . . */ *result = 10; }  COBOL/370 Example CBL LIB,APOST,NOOPT *COMPILATION UNIT: IGZTITOK ************************************************* ** ** ** Purpose: Drive sample program for CEEITOK. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. DRVITOK. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 DENOMINATOR PIC S9(9) COMP. 01 NUMERATOR PIC S9(9) COMP. 01 RATIO PIC S9(9) COMP. 01 TOKEN PIC S9(9) COMP VALUE 0. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. REGISTER-HANDLER. ** Register handler SET ROUTINE TO ENTRY 'CBLITOK'. CALL 'CEEHDLR' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. RAISE-CONDITION. ** Cause a zero-divide condition. MOVE 0 TO DENOMINATOR. MOVE 1 TO NUMERATOR. DIVIDE NUMERATOR BY DENOMINATOR, GIVING RATIO. UNREGISTER-HANDLER. ** UNregister handler CALL 'CEEHDLU' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLU failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. STOP RUN. END PROGRAM DRVITOK. ************************************************* ** ** ** Function: CEEITOK - Return initial ** ** condition token ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLITOK. DATA DIVISION. WORKING-STORAGE SECTION. 01 ITOKEN. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. LINKAGE SECTION. 01 TOKEN PIC S9(9) COMP. 01 RESULT PIC S9(9) COMP. 88 RESUME VALUE 10. 01 CURCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 NEWCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION USING CURCOND, TOKEN, RESULT, NEWCOND. PARA-CBLITOK. CALL 'CEEITOK' USING ITOKEN , FC. IF CEE000 of FC THEN DISPLAY 'Initial condition has msg ' Msg-No of ITOKEN; ELSE DISPLAY 'CEEITOK failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. PARA-HANDLER. ** In user handler - resume execution SET RESUME TO TRUE. GOBACK. END PROGRAM CBLITOK.  PL/I Example *PROCESS OPT(0), MACRO; /*COMPILATION UNIT: IBMITOK /********************************************/ /** **/ /** Function: CEEITOK - example of CEEITOK **/ /** invoked from PL/I **/ /** ON-unit **/ /** **/ /********************************************/ IBMITOK: PROCEDURE OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DECLARE 01 ITOKEN FEEDBACK, 01 FC FEEDBACK, divisor FIXED BINARY(31) INITIAL(0); ON ZERODIVIDE BEGIN; CALL CEEITOK ( ITOKEN, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The initial condition for the ' || 'current active block was message ' || ITOKEN.MsgNo || ' for facility '|| ITOKEN.FacID ); END; ELSE DO; DISPLAY( 'CEEITOK failed with msg ' || FC.MsgNo ); CALL CEEMSG( FC, 2, * ); END; END /* ON ZeroDivide */; divisor = 15 / divisor /* signals ZERODIVIDE */; END IBMITOK; ═══ 3.3.39. CEELOCT-Get Current Local Date or Time ═══ CEELOCT returns the current local date or time in three formats:  Lilian date (the number of days since 14 October 1582)  Lilian seconds (the number of seconds since 00:00 14 October 1582)  Gregorian character string (in the form YYYYMMDDHHMISS999). These values are compatible with other LE/370 date and time services, and with existing language intrinsic functions. CEELOCT performs the same function as calling the CEEGMT, CEEGMTO, and CEEDATM date and time services in succession. CEELOCT, however, performs the same service with much greater speed. The character value returned by CEELOCT is designed to match that produced by existing language intrinsic functions. The numeric values returned can be used to simplify date calculations. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEELOCT──(──output_Lilian──,──output_seconds──,──output_Gregorian──,──fc──)───────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ output_Lilian (output) A 32-bit binary integer representing the current local date in the Lilian format, that is, day 1 equals 15 October 1582, day 148,887 equals 4 June 1990. If the local time is not available from the system, output_Lilian is set to 0 and CEELOCT terminates with a non-CEE000 symbolic feedback code. output_seconds (output) A 64-bit double-floating point number representing the current local date and time as the number of seconds since 00:00 on 14 October 1582, not counting leap seconds. For example, 00:01 on 15 October 1582 is second number 86,401 (24*60*60 + 01). 19:01.078 on 4 June 1990 is second number 12,863,905,201.078. If the local time is not available from the system, output_seconds is set to 0 and CEELOCT terminates with a non-CEE000 symbolic feedback code. output_Gregorian (output) A 17-byte fixed-length character string in the form YYYYMMDDHHMISS999 representing local year, month, day, hour, minute, second, and millisecond. If the format of output_Gregorian does not meet your needs, you can use the CEEDATM callable service (CEEDATM-Convert Seconds to Character Timestamp) to convert output_seconds to another format. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2F3 │ 3 │ 2531 │ The local time was not available from the │ │ │ │ │ system. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  You can use the CEEGMT callable service (CEEGMT-Get Current Greenwich Mean Time) to determine Greenwich Mean Time (GMT).  You can use the CEEGMTO callable service (CEEGMTO-Get Offset from Greenwich Mean Time to Local Time) to obtain the offset from GMT to local time.  CICS consideration-CEELOCT does not use the OS TIME macro. Therefore, CEELOCT can be used under CICS.  OpenEdition MVS consideration-In multithread applications, CEELOCT affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCLOCT */ #include #include #include #include int main(void) { _FEEDBACK fc; _INT4 lil_date; _FLOAT8 local_date; _CHAR17 gregorian_date; CEELOCT(&lil_date,&local_date,gregorian_date,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEELOCT failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("The current date is YYYYMMDDHHMISS999\n"); printf(" %.17s\n",gregorian_date); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTLOCT *************************************************** ** ** ** Function: CEELOCT - get current local time ** ** ** ** In this example, a call is made to CEELOCT to ** ** return the current local time as a Lilian ** ** (the number of days since 14 October 1582), ** ** Lilian timestamp (the number of seconds since ** ** 00:00 14 October 1582), and a Gregorian ** ** string (in the form YYYYMMDDMISS999). The ** ** Gregorian character string is then displayed. ** ** ** *************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLLOCT. DATA DIVISION. WORKING-STORAGE SECTION. 01 LILIAN PIC S9(9) COMP. 01 SECONDS COMP-2. 01 GREGORN PIC X(17). 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLLOCT. CALL 'CEELOCT' USING LILIAN , SECONDS , GREGORN , FC. ** If CEELOCT runs successfully, display ** Gregorian character string IF CEE000 of FC THEN DISPLAY 'Local Time is ' GREGORN ELSE DISPLAY 'CEELOCT failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMLOCT */ /****************************************************/ /** **/ /** Function: CEELOCT - get current local time **/ /** **/ /** In this example, CEELOCT is called to return **/ /** the current local time as a Lilian date, **/ /** Lilian timestamp, and Gregorian character **/ /** string. **/ /** **/ /****************************************************/ PLILOCT: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL LILIAN INT4; DCL SECONDS FLOAT8; DCL GREGORN CHARACTER ( 17 ); DCL 01 FC FEEDBACK; /* Call CEELOCT to return local time in 3 formats */ CALL CEELOCT ( LILIAN, SECONDS, GREGORN, FC ); /* If CEELOCT ran successfully, print Gregorian */ /* result */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'The local date and time are ' || GREGORN || '.' ); END; ELSE DO; DISPLAY( 'CEELOCT failed with msg ' || FC.MsgNo ); STOP; END; END PLILOCT; ═══ 3.3.40. CEEMGET-Get a Message ═══ CEEMGET retrieves, formats, and stores in a passed message area a message corresponding to a condition token either returned from a callable service or passed to a user-written condition handler. The caller can later retrieve the message to change or to output. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEMGET──(──cond_token──,──message_area──,──msg_ptr──,──fc──)─────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ cond_token (input) A 12-byte condition token received as the result of an LE/370 callable service. See CEENCOD-Construct a Condition Token for a description of this condition token. message_area (input/output) A VSTRING, that is, a fixed-length 80-character string, where the message is placed. The message is left-justified and padded on the right with blanks. msg_ptr (input/output) A 4-byte binary integer returned to the calling routine. The msg_ptr should be passed a value of zero on the initial call to CEEMGET. If a message is too large to be contained in the message_area, msg_ptr (containing the index) is returned into the message. This index is used on subsequent calls to CEEMGET to retrieve the remaining portion of the message. A feedback code is also returned, indicating the message has been truncated. When the entire message is returned, msg_ptr is zero. If a message contains fewer than 80 characters, the entire message is returned on the first call. msg_ptr contains 0. If a message contains exactly 80 characters, the entire message is returned on the first call. msg_ptr contains 0. If a message contains more than 80 characters and at least one blank is contained in the first 80 characters, the string up to and including the last blank is returned on the first call. If the 80th character is nonblank (even if the 81st character is a blank), msg_ptr contains the index of the last blank, that is something less than 80 and the next call starts with the next character. If the 80th character is a blank, msg_ptr contains 80 and the next call starts with the 81st character, blank or nonblank. If a message contains more than 80 characters and at least the first 80 are all nonblank, the first 80 are returned and the next call does not add any blanks and starts with the 81st character. msg_ptr contains 80. If the message is too long, CEEMGET splits it into segments. The msg_ptr does not contain the cumulative index for the entire message returned so far, but contains only the index into the segment that was just returned. It is up to the user of CEEMGET to maintain the cumulative count if needed. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE036 │ 3 │ 0102 │ An unrecognized condition token was passed to │ │ │ │ │ routine and could not be used. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0E2 │ 3 │ 0450 │ The message inserts for the condition token │ │ │ │ │ with message number message-number and │ │ │ │ │ facility ID facility-id could not be located. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0E6 │ 3 │ 0454 │ The message number message-number could not be │ │ │ │ │ found for facility ID facility-id. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0E7 │ 1 │ 0455 │ The message with message number message-number │ │ │ │ │ and facility ID facility-id was truncated. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0EA │ 3 │ 0458 │ The message repository repository-name could │ │ │ │ │ not be located. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-In multithread applications, CEEMGET affects only the calling thread. However, CEEMGET uses the NATLANG value of the enclave. Any subsequent calls to CEEMGET, for a given condition, use the NATLANG value in effect at the time of the first call. Examples  C/370 Example /*COMPILATION UNIT: EDCMGET */ #include #include #include #include int main(void) { _VSTRING message; _INT4 dest,msgindx; _INT2 c_1,c_2,cond_case,sev,control; _CHAR3 facid; _INT4 isi; _CHAR80 msgarea; _FEEDBACK fc,token; /* construct a token for CEE message 2523 */ c_1 = 1; c_2 = 2523; cond_case = 1; sev = 1; control = 1; memcpy(facid,"CEE",3); isi = 0; CEENCOD(&c_1,&c_2,&cond_case,&sev,&control, facid,&isi,&token,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEENCOD failed with message number %d\n", fc.tok_msgno); exit(2999); } msgindx = 0; memset(msgarea,' ',79);/* initialize the message area */ msgarea[80] = '\0'; /* use CEEMGET until all the message has been */ /* retrieved */ /* msgindx will be zero when all the message has */ /* been retrieved */ do { CEEMGET(&token,msgarea,&msgindx,&fc); if (fc.tok_sev > 1 ) { printf("CEEMGET failed with message number %d\n", fc.tok_msgno); exit(2999); } /* put out the message using CEEMOUT */ memcpy(message.string,msgarea,80); message.length = 80; dest = 2; CEEMOUT(&message,&dest,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEMOUT failed with message number %d\n", fc.tok_msgno); exit(2999); } } while (msgindx != 0); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTMGET ****************************************** ** ** ** Function: CEEMGET - get a message ** ** ** ****************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLMGET. DATA DIVISION. WORKING-STORAGE SECTION. 01 MSGBUF PIC X(80). 01 MSGPTR PIC S9(9) COMP. 01 SEV PIC S9(4) COMP. 01 MSGNO PIC S9(4) COMP. 01 CASE PIC S9(4) COMP. 01 SEV2 PIC S9(4) COMP. 01 CNTRL PIC S9(4) COMP. 01 FACID PIC X(3). 01 ISINFO PIC S9(9) COMP. 01 NEWTOK. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLMGET. ** Give contok value of ** sev = 0, msgno = 1 facid = CEE MOVE 0 TO SEV. MOVE 1 TO MSGNO. MOVE 1 TO CASE. MOVE 0 TO SEV2. MOVE 1 TO CNTRL. MOVE 'CEE' TO FACID. MOVE 0 TO ISINFO. ** Call CEENCOD with the values assigned above to ** build a condition token "NEWTOK" CALL 'CEENCOD' USING SEV, MSGNO, CASE, SEV2, CNTRL, FACID, ISINFO, NEWTOK, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEENCOD failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ** Always pass 0 in MSGPTR on the initial call ** to CEEMGET. If message is too long to be ** returned in a single call, MSGPTR will be ** returned containing an index to the message ** that can be used on subsequent calls to CEEMGET. MOVE 0 TO MSGPTR. ** Call CEEMGET to get message associated with ** the condition token CALL 'CEEMGET' USING NEWTOK , MSGBUF , MSGPTR , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEMGET failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; ELSE DISPLAY 'The message is: ' MSGBUF; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMMGET **/ /****************************************************/ /** ***/ /**Function : CEEMGET - Get a Message **/ /** ***/ /****************************************************/ PLIMGET: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL 01 CONTOK FEEDBACK; DCL 01 FC FEEDBACK; DCL MSGBUF CHAR80; DCL MSGPOINTER INT4; DCL ADDR BUILTIN; /* Give CONTOK value of condition CEE001 */ ADDR( CONTOK ) -> CEEIBMCT = CEE001; MSGPTR = 0; /* Call CEEMGET to retrieve msg corresponding */ /* to condition token */ CALL CEEMGET ( CONTOK, MSGBUF, MSGPTR, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Message text for message number' || CONTOK.MsgNo || ' is "' || MSGBUF || '"'); END; ELSE DO; DISPLAY( 'CEEMGET failed with msg ' || FC.MsgNo ); STOP; END; END PLIMGET; ═══ 3.3.41. CEEMOUT-Dispatch a Message ═══ CEEMOUT dispatches a user-defined message string to the message file. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEMOUT──(──message_string──,──destination_code──,──fc──)─────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ message_string (input) A halfword prefixed string containing the message. DBCS characters must be enclosed within shift-out shift-in characters (that is, bytes X'0F' and X'0E', respectively). Insert data cannot be placed in the message with CEEMOUT. destination_code (input) A 4-byte binary integer. The only accepted value for destination_code is 2. Under systems other than CICS, LE/370 writes the message to the ddname of the file specified in the MSGFILE run-time option. Under CICS, the message is written to a transient data queue named CESE. See MSGFILE for more information. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0E3 │ 3 │ 0451 │ An unsupported destination code destination- │ │ │ │ │ code was passed to routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0E9 │ 3 │ 0457 │ The MSGFILE destination ddname could not be │ │ │ │ │ located. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-In multithread applications, CEEMOUT affects only the calling thread. When multiple threads write to the message file, the output is interwoven by line. To group lines of output, serialize MSGFILE access by using a mutex, for example. Examples  C/370 Example /*COMPILATION UNIT: EDCMOUT */ #include #include #include #include int main(void) { _VSTRING message; _INT4 dest; _FEEDBACK fc; strcpy(message.string,"This is a test message"); message.length = strlen(message.string); dest = 2; CEEMOUT(&message,&dest,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEMOUT failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTMOUT ************************************************ ** ** ** Function: CEEMOUT - dispatch a message ** ** ** ** In this example, a call is made to CEEMOUT ** ** to dispatch a user-defined message string ** ** to the ddname specified defaulted in the ** ** MSGFILE run-time option. ** ** ** ************************************************ IDENTIFICATION DIVISION. PROGRAM-ID. CBLMOUT. DATA DIVISION. WORKING-STORAGE SECTION. 01 MSGSTR. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of MSGSTR. 01 DESTIN PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLMOUT. ** Create message string and specify length MOVE 25 TO Vstring-length of MSGSTR. MOVE 'CEEMOUT ran successfully' TO Vstring-text of MSGSTR. ** Specify 2 to send the message to the ddname ** specified or defaulted in the MSGFILE ** run-time option. MOVE 2 TO DESTIN. CALL 'CEEMOUT' USING MSGSTR , DESTIN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEMOUT failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMMOUT */ /****************************************************/ /** **/ /** Function: CEEMOUT - Dispatch a message **/ /** **/ /** In this example, CEEMOUT is called to dispatch **/ /** a user-defined message string to the ddname **/ /** specified or defaulted in the MSGFILE run-time **/ /** option. **/ /** **/ /****************************************************/ PLIMOUT: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL MSGSTR VSTRING; DCL DESTIN INT4; DCL 01 FC FEEDBACK; MSGSTR = 'CEEMOUT ran successfully.'; /* Set message string */ DESTIN = 2; /* Send to MSGFILE ddname */ /* Dispatch message to destination by a */ /* call to CEEMOUT */ CALL CEEMOUT ( MSGSTR, DESTIN, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Message "' || MSGSTR || '" sent to destination ' || DESTIN ); END; ELSE DO; DISPLAY( 'CEEMOUT failed with msg ' || FC.MsgNo ); STOP; END; END PLIMOUT; ═══ 3.3.42. CEEMRCR-Move Resume Cursor ═══ CEEMRCR moves the resume cursor to a position relative to the current position of the handle cursor. The actions supported are:  Moving the resume cursor to the call return point of the routine registering the executing condition handler.  Moving the resume cursor to the caller of the routine registering the executing condition handler. Initially, the resume cursor is placed after the machine instruction that causes the condition. Whenever CEEMRCR moves the resume cursor and passes stack frames, associated exit routines are invoked. Note that "exit routine" refers to user condition handlers as well as language-specific condition handlers. This moving also unregisters any associated user condition handlers. The movement direction is always toward earlier stack frames, never toward more recent stack frames. The action occurs only after the condition handler returns to the LE/370 condition manager. Multiple calls to CEEMRCR yield the net results of the calls; that is, if two calls move the resume cursor to different places for the same stack frame, the most restrictive call (that closest to the earliest stack frame) is used for that stack frame. Moving the resume cursor to a particular stack frame:  Cancels all stack frames from the previous resume point up to but not including the new resume point  Unregisters any user condition handlers registered for the canceled stack frames ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEMRCR──(──type_of_move──,──fc──)────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ type_of_move (input) A fullword binary signed integer indicating the target of the resume cursor movement. The possible values for type_of_move are: 0 Move the resume cursor to the call return point of the stack frame associated with the handle cursor. 1 Move the resume cursor to the call return point of a stack frame prior to the stack frame associated with the handle cursor. The handle cursor is moved to the first condition handler of the stack frame the new resume cursor position now points to. Do not use a type_of_move value of 1 if the caller of the stack frame associated with the handle cursor is a nested COBOL program. Modifying the resume cursor to point to stack frame 0 is not allowed. You cannot move the resume cursor beyond the earliest stack frame. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE07U │ 1 │ 0254 │ The first argument passed to CEEMRCR was not 0 │ │ │ │ │ or 1. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE083 │ 3 │ 0259 │ A move to stack frame zero using CEEMRCR was │ │ │ │ │ attempted from a MAIN routine. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE084 │ 3 │ 0260 │ No condition was active when a call to a con- │ │ │ │ │ dition management routine was made. The │ │ │ │ │ requested function was not performed. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE08L │ 1 │ 0277 │ CEEMRCR was called to perform an unnecessary │ │ │ │ │ move. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-In multithread applications, CEEMRCR affects only the calling thread. You can use CEEMRCR only within the thread's call chain. Illustration of CEEMRCR Usage The following three figures illustrate how you can move the resume cursor by using the CEEMRCR service. In Moving Resume Cursor Using CEEMRCR, routine A calls routine B, which in turn calls C, which calls D. User condition handlers are registered in routines B and C. When a condition is signaled in routine D, the LE/370 condition manager passes control to the user condition handler established for routine C. The handle cursor now points to the stack frame for routine C. Routine C percolates the condition. The handle cursor now points to the stack frame for routine B. The next user condition handler to gain control is that one established for Routine B; it recognizes the condition and issues a resume by calling CEEMRCR. A 0 type_of_move, meaning move the resume cursor to the stack frame associated with the handle cursor, causes control to resume at the call return point in Routine B, the instruction immediately following the call to routine C. A 1 type_of_move, meaning move the resume cursor to the call return point of the stack frame immediately preceding the one to which the handle cursor points, moves the resume cursor to the instruction immediately following a call in routine A to routine B. Moving Resume Cursor Using CEEMRCR ┌────────────────────┐ │A │ │ . │ │ call b │ │ . ───────────────┼type=1───┐ │ . │ │ │ . │ │ └─────────┬──────────┘ │ │ │  │ ┌────────────────────┐ │ ┌───────────────┐ │B │ │ │HDLR1 │ │ . │ │ │ │ │ register hdlr1 │ ├─┼──call CEEMRCR │ │ . │ │ │ │ │ call c │ │ │ │ │ . ───────────────┼type=0───┘ └───────────────┘ └─────────┬──────────┘  │ │  │ ┌────────────────────┐ ┌───────────────┐ │C │ │HDLR2 │ │ . │ │ . │ │ register hdlr2 │ │ percolate │ │ . │ │ . │ │ call d │ └───────────────┘ │ . │  └─────────┬──────────┘ │ │ │  │ ┌────────────────────┐ │ │D │ │ │ . │ │ │ signal condition │───────────────────┘ │ . │ │ . │ │ . │ └────────────────────┘ The same scenario is illustrated in Moving Resume Cursor Using CEEMRCR, except that HDLR2 issues a resume for the signaled condition rather than percolating it. HDLR1 never gains control. Because the handle cursor now points to the stack frame for routine C, a 0 type_of_move causes control to resume at the call return point in Routine C, the instruction immediately following the call to routine D. A 1 type_of_move moves the resume cursor to the instruction immediately following a call in routine B to routine C. Moving Resume Cursor Using CEEMRCR ┌────────────────────┐ │A │ │ . │ │ call b │ │ . │ │ . │ │ . │ └─────────┬──────────┘ │ │ ┌─────────┴──────────┐ ┌───────────────┐ │B │ │HDLR1 │ │ . │ │ . │ │ register hdlr1 │ │ . │ │ . │ │ . │ │ call c │ │ . │ │ .────────────────┼─type=1──────┐ └───────────────┘ └─────────┬──────────┘ │ │ │ │ │ ┌─────────┴──────────┐ │ ┌───────────────┐ │C │ │ │HDLR2 │ │ . │ │ │ . │ │ register hdlr2 │ ├─┼─ call CEEMRCR │ │ . │ │ │ . │ │ call d │ │ └───────────────┘ │ .────────────────┼─type=0──────┘  └─────────┬──────────┘ │ │ │ │ │ ┌─────────┴──────────┐ │ │D │ │ │ . │ │ │ signal condition │───────────────────────┘ │ . │ │ . │ │ . │ └────────────────────┘ In Moving Resume Cursor Using CEEMRCR, the user condition handlers are established for routines C and D. When a condition is raised in routine D, only a 1 type_of_move is permitted. A 0 type_of_move results in CEE error message 0277. Moving Resume Cursor Using CEEMRCR ┌────────────────────┐ │A │ │ . │ │ call b │ │ . │ │ . │ │ . │ └─────────┬──────────┘ │  ┌────────────────────┐ │B │ │ . │ │ . │ │ . │ │ call c │ │ . │ └─────────┬──────────┘ │  ┌────────────────────┐ │C │ ┌───────────────┐ │ . │ │HDLR1 │ │ register hdlr1 │ │ . │ │ . │ │ . │ │ call d │ │ . │ │ .────────────────┼─type=1─────┐ │ . │ └─────────┬──────────┘ │ └───────────────┘ │ │  │ ┌────────────────────┐ │ │D │ │ ┌───────────────┐ │ . │ │ │HDLR2 │ │ register hdlr2 │ │ │ . │ │ . │ └──┼─ call CEEMRCR │ │ signal condition ├───┐ │ . │ │ . │ │ └───────────────┘ └────────────────────┘ │  └───────────────────┘ Examples  C/370 Example /*COMPILATION UNIT: EDCMRCR */ #include #include #include #include void handler(_FEEDBACK *,_INT4 *,_INT4 *,_FEEDBACK *); int main(void) { /* . . . */ b(); /* the CEEMRCR call in the handler will place the */ /* resume cursor at this point. */ /* . . . */ } b(void) { _FEEDBACK fc,condtok; _ENTRY routine; _INT4 token,qdata; _INT2 c_1,c_2,cond_case,sev,control; _CHAR3 facid; _INT4 isi; /* register the condition handler */ token = 99; routine.address = (_POINTER)&handler; routine.nesting = NULL; CEEHDLR(&routine,&token,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEHDLR failed with message number %d\n", fc.tok_msgno); exit (2999); } /* . . . */ /* set up the condition using CEENCOD */ c_1 = 3; c_2 = 2523; cond_case = 1; sev = 3; control = 0; memcpy(facid,"CEE",3); isi = 0; CEENCOD(&c_1,&c_2,&cond_case,&sev,&control, facid,&isi,&condtok,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEENCOD failed with message number %d\n", fc.tok_msgno); exit(2999); } /* signal the condition */ CEESGL(&condtok,&qdata,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEESGL failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ } void handler(_FEEDBACK *fc, _INT4 *token, _INT4 *result, _FEEDBACK *newfc) { _FEEDBACK cursorfc, orig_fc; _INT4 type; /* . . . */ /* move the resume cursor to the caller of the */ /* routine that registered the condition handler */ type = 1; CEEMRCR(&type,&cursorfc); if ( _FBCHECK ( cursorfc , CEE000 ) != 0 ) { printf("CEEMRCR failed with message number %d\n", cursorfc.tok_msgno); exit (2999); } printf("condition handled\n"); *result = 10; return; }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTMRCR **************************************************** ** ** ** CBLMAIN - Main for sample program for CEEMRCR. ** ** ** **************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLMAIN. PROCEDURE DIVISION. CALL 'DRVMRCR' DISPLAY 'Resumed execution in the CALLER ' 'of the routine which registered the ' 'handler' GOBACK. END PROGRAM CBLMAIN. *COMPILATION UNIT: DRVMRCR ************************************************ ** ** ** DRVMRCR - Drive sample program CEEMRCR. ** ** ** ************************************************ IDENTIFICATION DIVISION. PROGRAM-ID. DRVMRCR. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 TOKEN PIC S9(9) COMP. 01 SEV PIC S9(4) COMP. 01 MSGNO PIC S9(4) COMP. 01 CASE PIC S9(4) COMP. 01 SEV2 PIC S9(4) COMP. 01 CNTRL PIC S9(4) COMP. 01 FACID PIC X(3). 01 ISINFO PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 QDATA PIC S9(9) COMP. 01 CONDTOK. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. ** Register handler SET ROUTINE TO ENTRY 'CBLMRCR'. CALL 'CEEHDLR' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ** Signal a condition MOVE 1 TO QDATA. SET CEE001 of CONDTOK to TRUE. MOVE ZERO to I-S-Info of CONDTOK. CALL 'CEESGL' USING CONDTOK , QDATA , FC. IF CEE000 of FC THEN DISPLAY '**** Resumed execution in the ' 'routine which registered the handler' ELSE DISPLAY 'CEESGL failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. ** UNregister handler CALL 'CEEHDLU' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLU failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. STOP RUN. END PROGRAM DRVMRCR. *COMPILATION UNIT: CBLMRCR *************************************************** ** ** ** Function: CEEMRCR - Move resume cursor ** ** relative to handle cursor ** ** ** *************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLMRCR. DATA DIVISION. WORKING-STORAGE SECTION. 01 MOVETYP PIC S9(9) COMP. 01 DEST PIC S9(9) COMP VALUE 2. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 FC2. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. LINKAGE SECTION. 01 CURRENT-CONDITION. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 TOKEN PIC X(4). 01 RESULT-CODE PIC S9(9) BINARY. 88 RESUME VALUE +10. 88 PERCOLATE VALUE +20. 88 PROMOTE VALUE +30. 01 NEW-CONDITION. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION USING CURRENT-CONDITION, TOKEN, RESULT-CODE, NEW-CONDITION. ** Move the resume cursor to the caller of the ** routine that registerd the condition ** handler MOVE 1 TO MOVETYP. CALL 'CEEMRCR' USING MOVETYP , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEMRCR failed with msg ' Msg-No of FC UPON CONSOLE; CALL 'CEEMSG' USING FC, DEST, FC2; IF NOT CEE000 of FC2 THEN DISPLAY 'CEEMSG failed with msg ' Msg-No of FC2 UPON CONSOLE; MOVE FC TO NEW-CONDITION; SET PROMOTE TO TRUE; GOBACK; END-IF. SET RESUME TO TRUE. GOBACK. END PROGRAM CBLMRCR.  PL/I Example The following example uses a COBOL program and handler to establish the condition handling environment prior to calling a PL/I subroutine to illustrate the use of the callable service from PL/I. CBL LIB,APOST,NOOPT *COMPILATION UNIT: IGZTMRCP ************************************************* ** ** ** IGZTMRCP - Drive sample program for CEEMRCR.** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. IGZTMRCP. PROCEDURE DIVISION. INVOKE-DRIVER. CALL 'RUNMRCR'. DISPLAY '==> Execution resumed in routine ' 'which called the routine ' 'which registered handler'. STOP RUN. END PROGRAM IGZTMRCP. CBL LIB,APOST,NOOPT *COMPILATION UNIT: RUNMRCR ************************************************* ** ** ** RUNMRCR - Run sample program for CEEMRCR. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. RUNMRCR. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 DENOMINATOR PIC S9(9) COMP. 01 NUMERATOR PIC S9(9) COMP. 01 RATIO PIC S9(9) COMP. 01 TOKEN PIC S9(9) COMP VALUE 0. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. REGISTER-HANDLER. ** Register handler SET ROUTINE TO ENTRY 'HDLMRCR'. CALL 'CEEHDLR' USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLR failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. RAISE-CONDITION. ** Cause a zero-divide condition. MOVE 0 TO DENOMINATOR. MOVE 1 TO NUMERATOR. DIVIDE NUMERATOR BY DENOMINATOR, GIVING RATIO. * (exception occurs and is handled) DISPLAY '==> Execution resumed in routine ' 'which registered handler'. UNREGISTER-HANDLER. ** UNregister handler CALL 'CEEHDLU' USING ROUTINE, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEEHDLU failed with msg ' Msg-No of FC UPON CONSOLE; END-IF. STOP RUN. END PROGRAM RUNMRCR. *COMPILATION UNIT: HDLMRCR ************************************************** ** ** ** Purpose: Invoke PL/I program to handle ** ** current condition. ** ** ** ************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. HDLMRCR. DATA DIVISION. LINKAGE SECTION. 01 TOKEN PIC S9(9) COMP. 01 RESULT PIC S9(9) COMP. 01 CURCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 NEWCOND. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION USING CURCOND, TOKEN, RESULT, NEWCOND. INVOKE-PLI. CALL 'IBMMRCR' USING ADDRESS OF CURCOND, ADDRESS OF TOKEN, ADDRESS OF RESULT, ADDRESS OF NEWCOND. GOBACK. END PROGRAM HDLMRCR. *PROCESS OPT(0), MACRO,SOURCE,INSOURCE; /****************************************************/ /** */ /** Function: CEEMRCR - move resume cursor relative */ /** to handle cursor */ /** */ /****************************************************/ IBMMRCR: PROCEDURE( @CONDTOK, @TOKEN, @RESULT, @NEWCOND) OPTIONS( COBOL ); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; /* Parameters */ DCL @CONDTOK POINTER; DCL @TOKEN POINTER; DCL @RESULT POINTER; DCL @NEWCOND POINTER; DCL 01 CONDTOK BASED( @CONDTOK ) FEEDBACK; DCL TOKEN BASED( @TOKEN ) INT4; DCL RESULT BASED( @RESULT ) INT4; DCL 01 NEWCOND BASED( @NEWCOND ) FEEDBACK; /* Local identifiers */ DCL MOVETYP INT4; DCL 01 FC FEEDBACK; IF FBCHECK( CONDTOK, CEE349 ) THEN DO; /* Expeced fixed-point divide exception occurred */ MOVETYP = 1 /* Move resume cursor to stack frame */ /* of program which called routine */ /* which registered this handler */; CALL CEEMRCR ( MOVETYP, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Resume cursor moved one stack' || ' prior to position of Handler Cursor,' ); PUT SKIP LIST( ' and Handler Cursor moved to ' || 'first handler of that stack frame' ); RESULT = 10 /* Resume */; END; ELSE DO; DISPLAY( 'CEEMRCR failed with msg ' || FC.MsgNo ); RESULT = 30 /* Promote */; NEWCOND = FC; END; END; ELSE /* Unexpected condition -- percolate */ DO; DISPLAY( 'User condition handler entered for ' || CONDTOK.FacID || ' condition with message ' || 'number ' || CONDTOK.MsgNo ); RESULT = 20 /* Percolate */; DISPLAY('Percolating...'); END; RETURN; END IBMMRCR; ═══ 3.3.43. CEEMSG-Get, Format, and Dispatch a Message ═══ CEEMSG gets, formats, and dispatches a message corresponding to an input condition token received from a callable service or passed to a user-written condition handler. You can use this service to print a message after a call to any LE/370 service that returns a condition token. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEMSG──(──cond_token──,──destination_code──,──fc──)──────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ cond_token (input) A 12-byte condition token received as the result of an LE/370 callable service. destination_code (input) A 4-byte binary integer. destination_code can be specified only as 2, meaning write the message to the ddname of the file specified in the MSGFILE run-time option. See MSGFILE for more information. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0E2 │ 3 │ 0450 │ The message inserts for the condition token │ │ │ │ │ with message number message-number and │ │ │ │ │ facility ID facility-id could not be located. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0E3 │ 3 │ 0451 │ An unsupported destination code destination- │ │ │ │ │ code was passed to routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0E6 │ 3 │ 0454 │ The message number message-number could not be │ │ │ │ │ found for facility ID facility-id. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0E9 │ 3 │ 0457 │ The MSGFILE destination ddname could not be │ │ │ │ │ located. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0EA │ 3 │ 0458 │ The message repository repository-name could │ │ │ │ │ not be located. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3CT │ 3 │ 3485 │ An internal message services error occurred │ │ │ │ │ while locating the message number within the │ │ │ │ │ message file. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3CU │ 3 │ 3486 │ An internal message services error occurred │ │ │ │ │ while formatting the message. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE3CV │ 3 │ 3487 │ An internal message services error occurred │ │ │ │ │ while locating the message number within the │ │ │ │ │ ranges specified in the repository. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-In multithread applications, CEEMSG affects only the calling thread. When multiple threads write to the message file, the output is interwoven by line. To group lines of output, serialize MSGFILE access by using a mutex, for example. Examples  C/370 Example /*COMPILATION UNIT: EDCMSG */ #include #include #include #include int main(void) { _VSTRING message; _INT4 dest,msgindx; _CHAR80 msgarea; _FEEDBACK fc,token; strcpy(message.string,"This is a test message"); message.length = strlen(message.string); dest = 5; /* invalid dest so CEEMOUT will fail */ CEEMOUT(&message,&dest,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { /* put the message if CEEMOUT failed */ dest = 2; CEEMSG(&fc,&dest,NULL); exit(2999); } }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTMSG ************************************************* ** ** ** Function: CEEMSG - get, format and dispatch** ** a message ** ** ** ** In this example, CEE3MDS is called with an ** ** invalid country code so that a condition ** ** token would be returned to use as input to ** ** Any LE/370 service could have been called. ** ** CEEMSG uses the condition token to get, ** ** format and dispatch the message associated ** ** with the condition that occurred in CEE3MDS.** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLMSG. DATA DIVISION. WORKING-STORAGE SECTION. 01 COUNTRY PIC X(2). 01 DECSEP PIC X(2). 01 MSGDEST PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 FC2. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBL3MDS. ** Call any LE service, CEE3MDS in this case, to ** receive a condition token that CEEMSG can ** can format as a message. Specify an ** invalid value for country code so that a ** condition will be built MOVE 'LN' TO COUNTRY. CALL 'CEE3MDS' USING COUNTRY, DECSEP , FC. PARA-CBLMSG. ** Specify 2 for destination, so message will be ** written to the ddname specified or ** defaulted in the MSGFILE run-time option. MOVE 2 TO MSGDEST. ** Call CEEMSG using the FC returned from ** CEE3MDS as the input condition token. CALL 'CEEMSG' USING FC , MSGDEST , FC2. IF NOT CEE000 of FC2 THEN DISPLAY 'CEEMSG failed with msg ' Msg-No of FC2 UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS LANGLVL(SAA), MACRO; /*COMPILATION UNIT: IBMMSG */ /****************************************************/ /** **/ /** Function: CEEMSG - get, format and dispatch **/ /** a message **/ /** **/ /** In this example, CEE3MDS is called with an **/ /** invalid country code so that a condition token **/ /** would be returned to use as input to CEEMSG. **/ /** Any LE/370 could have been called. CEEMSG uses **/ /** the condition to get, format and dispatch the **/ /** message associated with the condition that **/ /** occurred in CEE3MDS **/ /** **/ /****************************************************/ PLIMSG: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL COUNTRY CHARACTER ( 2 ); DCL DECSEP CHARACTER ( 2 ); DCL 01 FC FEEDBACK; DCL MSGDEST INT4; DCL 01 FC2 FEEDBACK; COUNTRY = 'LN'; /* Specify an invalid country */ /* code to receive a non-zero */ /* feedback code */ /* Call any service (CEE3MDS in this case) to */ /* receive a condition token that CEEMSG will */ /* format and dispatch a message */ CALL CEE3MDS ( COUNTRY, DECSEP, FC ); MSGDEST = 2; /* Specify 2 as destination, so */ /* message will go to ddname speci- */ /* fied in MSGFILE run-time option */ CALL CEEMSG ( FC, MSGDEST, FC2 ); IF к FBCHECK( FC2, CEE000) THEN DO; DISPLAY( 'CEEMSG failed with msg ' || FC.MsgNo ); STOP; END; END PLIMSG; ═══ 3.3.44. CEENCOD-Construct a Condition Token ═══ CEENCOD dynamically constructs a 12-byte condition token that communicates a condition in LE/370. The condition token communicates with the LE/370 message and condition handling callable services, and user routines. Also, all LE/370 callable services use the condition-token data type to return information to the user as a feedback code. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEENCOD──(──c_1──,──c_2──,──case──,──severity──,──control──,──facility_ID──,──i_s_info─────> │ │ │ │ >──,──cond_token──,──fc──)────────────────────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ c_1 (input) c_1 and c_2 together make up the condition_ID portion of the condition token. c_1 is a 2-byte binary integer representing the value of the first 2 bytes of the 4-byte condition_ID. For case 1, c_1 represents the severity; for case 2, it is the class_code. For more information about case 1 and case 2, see CEENCOD Usage Notes. c_2 (input) A 2-byte binary integer representing the value of the second 2 bytes of the condition_ID. For case 1, this is the Msg_No; for case 2, it is the cause_code. For more information about case 1 and case 2, see CEENCOD Usage Notes. case (input) A 2-byte binary integer defining the format of the condition_ID portion of the token. The value 1 identifies a case 1 condition, a value of 2 identifies a case 2 condition. The values 0 and 3 are reserved. LE/370 supports only the case 1 condition token type. severity (input) A 2-byte binary integer indicating the condition's severity. For case 1 conditions, the value of this field is the same as the severity value specified in the condition_ID. For case 1 and 2 conditions, this field is also used to test the condition's severity. severity can be specified with the following values: 0 Information only (or, if the entire token is 0, no information). 1 Warning-service completed, probably correctly. 2 Error detected-correction attempted; service completed, perhaps incorrectly. 3 Severe error-service not completed. 4 Critical error-service not completed; condition signaled. A critical error is a condition jeopardizing the environment. If a critical error occurs during an LE/370 callable service, it is always signaled to the condition manager instead of returning synchronously to the caller. control (input) A 2-byte binary integer containing flags describing or controlling various aspects of condition handling. Valid values for the control field are 1 and 0. 1 indicates the facility_ID is assigned by IBM. 0 indicates the facility_ID is assigned by the user. facility_ID (input) A 3-character field containing three alphanumeric characters (A-Z, a-z and 0-9) identifying the product or component of a product generating this condition or feedback information, for example, CEE. The facility_ID is associated with the repository (for example, a file) of the run-time messages. If a unique ID is required (for IBM and non-IBM products), an ID can be obtained by contacting an IBM project office. If you create a new facility_ID to use with a message file you created by using the CEEBLDTX utility, be aware that the facility_ID must be part of the message file name. It is therefore important to follow the naming guidelines described below in order to have a module name that does not cause your application to abend. A facility_ID not assigned to an IBM product cannot begin with the letters A through I. (See the control (input) parameter, above, on how to indicate whether the facility_ID has been assigned by IBM.) Special characters, including blank spaces, cannot be used in a facility_ID. There are no other constraints (besides the alphanumeric requirement) on a facility_ID not assigned by IBM. i_s_info (input) A fullword binary integer identifying the ISI. Whenever a condition is detected by the LE/370 condition manager, insert data is generated describing the particular instance of its occurrence is generated. This insert data is used, for example, to write to a file a message associated with that particular instance or occurrence of the condition. This insert data is contained in the ISI. cond_token (output) The 12-byte representation of the constructed condition token. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0CH │ 3 │ 0401 │ An unsupported case code case-code was passed │ │ │ │ │ to routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0CI │ 3 │ 0402 │ An unsupported control code control-code was │ │ │ │ │ passed to routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0CJ │ 3 │ 0403 │ An unsupported severity code severity-code was │ │ │ │ │ passed to routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0CK │ 1 │ 0404 │ A facility ID facility-id with non- │ │ │ │ │ alphanumeric characters was passed to routine │ │ │ │ │ routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0E4 │ 3 │ 0452 │ An unsupported facility ID facility-id was │ │ │ │ │ passed to routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  C/370 considerations-The structure of the condition token (type_FEEDBACK) is described in the leawi.h header file shipped with LE/370. You can assign values directly to the fields of the token in the header file without using the CEENCOD service. (See the example for CEESGL-Signal a Condition for details.) The layout of the type_FEEDBACK condition token in the header file is: type_FEEDBACK Data Type as Defined in the leawi.h Header File typedef struct { short tok_sev ; /* severity */ short tok_msgno ; /* message number */ int tok_case :2, /* flags-case/sev/cont */ tok_sever:3, tok_ctrl :3 ; char tok_facid[3]; /* fac ID */ int tok_isi ; /* index in ISI block */ } _FEEDBACK;  OpenEdition MVS consideration-In multithread applications, CEENCOD affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCNCOD */ /*****************************************************/ /* In C/370 it is not necessary to use this service. */ /* The fields can be manipulated directly. See the */ /* example for CEESGL to see how to manipulate */ /* condition token fields directly. */ /*****************************************************/ #include #include #include #include int main(void) { _FEEDBACK fc,condtok; _INT2 c_1,c_2,cond_case,sev,control; _CHAR3 facid; _INT4 isi; c_1 = 1; c_2 = 99; cond_case = 1; sev = 1; control = 0; memcpy(facid,"ZZZ",3); isi = 0; CEENCOD(&c_1,&c_2,&cond_case,&sev,&control, facid,&isi,&condtok,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEENCOD failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTNCOD ************************************************* ** ** ** Function: CEENCOD - Construct a condition ** ** token ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLNCOD. DATA DIVISION. WORKING-STORAGE SECTION. 01 SEV PIC S9(4) COMP. 01 MSGNO PIC S9(4) COMP. 01 CASE PIC S9(4) COMP. 01 SEV2 PIC S9(4) COMP. 01 CNTRL PIC S9(4) COMP. 01 FACID PIC X(3). 01 ISINFO PIC S9(9) COMP. 01 NEWTOK. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLNCOD. ** Set severity portion of Condition_ID to 0, or ** information only. ** Set msg number portion of Condition_ID to 1. ** Set case to 1. This is a service condition. ** Set severity to 0, for information only. ** Set control to 1, for Facility_ID has been ** assigned by IBM. ** Set Facility_ID to CEE for an LE/370 condition ** token. ** Set I_S_Info to 0, indicating that no Instance ** Specific Information is to be supplied. MOVE 0 TO SEV. MOVE 1 TO MSGNO. MOVE 1 TO CASE. MOVE 0 TO SEV2. MOVE 1 TO CNTRL. MOVE 'CEE' TO FACID. MOVE 0 TO ISINFO. ** Call CEENCOD with the values assigned above to ** build a condition token "NEWTOK" CALL 'CEENCOD' USING SEV, MSGNO, CASE, SEV2, CNTRL, FACID, ISINFO, NEWTOK, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEENCOD failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMNCOD */ /****************************************************/ /** */ /** Function: CEENCOD - construct a condition token */ /** */ /****************************************************/ PLINCOD: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL SEV INT2; DCL MSGNO INT2; DCL CASE INT2; DCL SEV2 INT2; DCL CNTRL INT2; DCL FACID CHARACTER ( 3 ); DCL ISINFO INT4; DCL 01 NEWTOK FEEDBACK; DCL 01 FC FEEDBACK; SEV = 0; /* Set severity portion of */ /* Condition_ID to 0, or */ /* information only. */ MSGNO = 1; /* Set msg number portion of */ /* Condition_ID to 1. */ CASE = 1; /* Set case to 1. This is a */ /* service condition. */ SEV2 = 0; /* Set severity to 0, or */ /* information only. */ CNTRL = 0; /* Set control to 0, or Facility */ /* ID has been assigned by user */ FACID = 'USR'; /* Set Facility_ID to USR for a */ /* user condition token. */ ISINFO = 0; /* Set I_S_Info to 0, indicating */ /* that no Instance Specific */ /* Information is to be supplied. */ CALL CEENCOD ( SEV, MSGNO, CASE, SEV2, CNTRL, FACID, ISINFO, NEWTOK, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'CEENCOD created token for msg ' || NEWTOK.MsgNo || ' and facility ' || NEWTOK.FacID ); END; ELSE DO; DISPLAY( 'CEENCOD failed with msg ' || FC.MsgNo ); STOP; END; END PLINCOD; ═══ 3.3.45. CEEQCEN-Query the Century Window ═══ CEEQCEN queries the century in which LE/370 contains the 2-digit year value. When you want to change the setting, use CEEQCEN to get the setting and then use CEESCEN (CEESCEN-Set the Century Window) to save and restore the current setting. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEEQCEN──(──century_start──,──fc──)───────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ century_start (output) An integer between 0 and 100 indicating the year on which the century window is based. For example, if the LE/370 default is in effect, all 2-digit years lie within the 100-year window starting 80 years prior to the system date. CEEQCEN then returns the value 80. An 80 value indicates to LE/370 that, in 1993, all 2-digit years lie within the 100-year window starting 80 years before the system date (between 1913 and 2012, inclusive). fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-CEEQCEN applies to the enclave. The century window applies to the enclave. Examples  C/370 Example /*COMPILATION UNIT: EDCQCEN */ #include #include #include #include int main (void) { _INT4 century_start; _FEEDBACK fc; /* query the century window */ CEEQCEN(¢ury_start,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEQCEN failed with message number %d\n", fc.tok_msgno); exit(2999); } /* if the century window is not 50 set it to 50 */ if (century_start != 50) { century_start = 50; CEESCEN(¢ury_start,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEESCEN failed with message number %d\n", fc.tok_msgno); exit(2999); } } }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTQCEN ************************************************* ** ** ** Function: CEEQCEN - query century window ** ** ** ** In this example, CEEQCEN is called to query ** ** the date at which the century window starts ** ** The century window is the 100-year window ** ** windoe within which Language Environment ** ** assumes all two-digit years lie. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLQCEN. DATA DIVISION. WORKING-STORAGE SECTION. 01 STARTCW PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLQCEN. ** Call CEEQCEN to return the start of the ** century window CALL 'CEEQCEN' USING STARTCW , FC. ** CEEQCEN has no non-zero feedback codes to ** check, so just display result. IF CEE000 of FC THEN DISPLAY 'The start of the century ' 'window is: ' STARTCW ELSE DISPLAY 'CEEQCEN failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMQCEN */ /***************************************************/ /** */ /** Function: CEEQCEN - query the century window */ /** */ /** In this example, CEEQCEN is called to query */ /** The date at which the century window starts. */ /** The century window is the 100-year window */ /** within which Language Environment assumes */ /** all two-digit years lie. */ /** */ /***************************************************/ PLIQCEN: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL STARTCW INT4; DCL 01 FC FEEDBACK; /* Call CEEQCEN to return the start of the */ /* century window */ CALL CEEQCEN ( STARTCW, FC ); /* CEEQCEN has no non-zero feedback codes */ /* to check, so print result */ IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST ( 'The century window starts ' || STARTCW || ' years before today.'); END; ELSE DO; DISPLAY( 'CEEQCEN failed with msg ' || FC.MsgNo ); STOP; END; END PLIQCEN; ═══ 3.3.46. CEERAN0-Calculate Uniform Random Numbers ═══ CEERAN0 generates a sequence of uniform pseudo-random numbers between 0.0 and 1.0 using the multiplicative congruential method with a user-specified seed. The uniform (0,1) pseudo-random numbers are generated using the multiplicative congruential method: seed(i) = (950706376 * seed(i-1)) mod 2147483647; randomno(i) = seed(i) / 2147483647; ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEERAN0──(──seed──,──random_no──,──fc──)──────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ seed (input/output) A fullword binary signed integer representing an initial value used to generate random numbers. seed must be a variable; it cannot be an input-only parameter. The valid range is 0 to +2,147,483,646. If seed equals 0, the seed is generated from the current Greenwich Mean Time. On return to the calling routine, CEERAN0 changes the value of seed so that it can be used as the new seed in the next call. random_no(output) An 8-byte double precision floating-point number with a value between 0 and 1, exclusive. If seed is invalid, random_no is set to -1 and CEERAN0 terminates with a non-CEE000 symbolic feedback code. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2ER │ 1 │ 2523 │ The system time was not available when CEERAN0 │ │ │ │ │ was called. A seed value of 1 was used to │ │ │ │ │ generate a random number and a new seed value. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2ES │ 3 │ 2524 │ An invalid seed value was passed to CEERAN0. │ │ │ │ │ The random number was set to -1. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-In multithread applications, CEERAN0 affects only the calling thread. The seed is unique to the thread. Examples  C/370 Example /*COMPILATION UNIT: EDCRAN0 */ #include #include #include #include int main (void) { _INT4 seed; _FLOAT8 random; _FEEDBACK fc; int number; seed = 0; CEERAN0(&seed,&random,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEERAN0 failed with message number %d\n", fc.tok_msgno); exit(2999); } number = random * 1000; printf("The 3 digit random number is %d\n",number); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTRAN0 ************************************************ ** ** ** Function: CEERAN0 - generate uniform ** ** random numbers ** ** ** ************************************************ IDENTIFICATION DIVISION. PROGRAM-ID. CBLRAN0. DATA DIVISION. WORKING-STORAGE SECTION. 01 SEED PIC S9(9) COMP. 01 RANDNUM COMP-2. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLRAN0. ** Specify 0 for SEED, so the seed will be derived ** from the current Greenwich Mean Time MOVE 0 TO SEED. ** Call CEERAN0 to return random number between ** 0.0 and 1.0 CALL 'CEERAN0' USING SEED , RANDNUM , FC. ** If CEERAN0 runs successfully, display result. IF CEE000 of FC THEN DISPLAY 'The random number is: ' RANDNUM ELSE DISPLAY 'CEERAN0 failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMRAN0 */ /****************************************************/ /** **/ /** Function: CEERAN0 - calculate uniform random **/ /** numbers **/ /** **/ /****************************************************/ PLIRAN0: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL SEED INT4; DCL RANDNUM FLOAT8; DCL 01 FC FEEDBACK; SEED = 7; /* Specify an integer as the initial */ /* value used to calculate the random */ /* numbers */ /* Call CEERAN0 to generate random number between */ /* 0.0 and 1.0 */ CALL CEERAN0 ( SEED, RANDNUM, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST ( 'The random number is ' || RANDNUM ); END; ELSE DO; DISPLAY( 'CEERAN0 failed with msg ' || FC.MsgNo ); STOP; END; END PLIRAN0; ═══ 3.3.47. CEESCEN-Set the Century Window ═══ CEESCEN sets the century in which LE/370 contains the 2-digit year value. Use it in conjunction with CEEDAYS (CEEDAYS-Convert Date to Lilian Format) or CEESECS (CEESECS-Convert Timestamp to Number of Seconds) when:  You process date values containing 2-digit years (for example, in the YYMMDD format).  The LE/370 default century interval does not meet the requirements of a particular application. Century intervals are kept as thread-level data, so changing the interval in one thread does not affect the interval in another thread. To query the century window, use CEEQCEN (see CEEQCEN-Query the Century Window). ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESCEN──(──century_start──,──fc──)───────────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ century_start An integer between 0 and 100, setting the century window. A value of 80, for example, places all two-digit years within the 100-year window starting 80 years before the system date. In 1992, therefore, all two-digit years are assumed to represent dates between 1912 and 2011, inclusive. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2E6 │ 3 │ 2502 │ The UTC/GMT was not available from the system. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-CEESCEN applies to the enclave. The century window applies to the enclave. Examples  C/370 Example /*COMPILATION UNIT: EDCSCEN */ #include #include #include #include int main (void) { _INT4 century_start; _FEEDBACK fc; century_start = 50; CEESCEN(¢ury_start,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEESCEN failed with message number %d\n", fc.tok_msgno); exit(2999); } }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTSCEN ************************************************** ** ** ** Function: CEESCEN - set the century window ** ** ** ** In this example, CEESCEN is called to change ** ** the start of the century window to 30 years ** ** before the system date. CEEQCEN is then ** ** called to query that the change made. A ** ** message that this has been done is then ** ** displayed. ** ** ** ************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLSCEN. DATA DIVISION. WORKING-STORAGE SECTION. 01 STARTCW PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLSCEN. ** Specify 30 as century start, and two-digit ** years will be assumed to lie in the ** 100-year window starting 30 years before ** the system date. MOVE 30 TO STARTCW. ** Call CEESCEN to change the start of the century ** window. CALL 'CEESCEN' USING STARTCW , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEESCEN failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. PARA-CBLQCEN. ** Call CEEQCEN to return the start of the century ** window CALL 'CEEQCEN' USING STARTCW , FC. ** CEEQCEN has no non-zero feedback codes to ** check, so just display result. DISPLAY 'The start of the century ' 'window is: ' STARTCW GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMSCEN */ /****************************************************/ /** */ /** Function: CEESCEN - set the century window */ /** */ /****************************************************/ PLISCEN: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL STARTCW INT4; DCL 01 FC FEEDBACK; STARTCW = 20; /* Set 20 as century start */ /* Call CEESCEN to request that two-digit years */ /* lie in the 100-year window starting 20 */ /* years before the system date */ CALL CEESCEN ( STARTCW, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST ( 'The century window now starts ' || STARTCW || ' years before today.'); END; ELSE DO; DISPLAY( 'CEESCEN failed with msg ' || FC.MsgNo ); STOP; END; END PLISCEN; ═══ 3.3.48. CEESECI-Convert Seconds to Integers ═══ CEESECI converts a number representing the number of seconds since 00:00 14 October 1582 to seven separate binary integers representing year, month, day, hour, minute, second, and millisecond. Use CEESECI instead of CEEDATM when the output is needed in numeric format rather than in character format. The inverse of CEESECI is CEEISEC, which converts integer year, month, day, hour, second, and millisecond to number of seconds. If the input value is a Lilian date instead of seconds, multiply the Lilian date by 86,400 (number of seconds in a day), and pass the new value to CEESECI. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESECI──(──input_seconds──,──output_year──,──output_month──,──output_day──,───────────────> │ │ │ │ >──output_hours──,──output_minutes──,──output_seconds──,──output_milliseconds──,──fc──)───────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ input_seconds A 64-bit double floating-point number representing the number of seconds since 00:00 on 14 October 1582, not counting leap seconds. For example, 00:01 on 15 October 1582 is second number 86,401 (24*60*60 + 01). The valid range for input_seconds is 86,400 to 265,621,679,999.999 (23:59.999 31 December 9999). If input_seconds is invalid, all output parameters except the feedback code are set to 0. output_year (output) A 32-bit binary integer representing the year. The range of valid output_years is 1582 to 9999, inclusive. output_month (output) A 32-bit binary integer representing the month. The range of valid output_months is 1 to 12. output_day (output) A 32-bit binary integer representing the day. The range of valid output_days is 1 to 31. output_hours (output) A 32-bit binary integer representing the hour. The range of valid output_hours is 0 to 23. output_minutes (output) A 32-bit binary integer representing the minutes. The range of valid output_minutes is 0 to 59. output_seconds (output) A 32-bit binary integer representing the seconds. The range of valid output_seconds is 0 to 59. output_milliseconds (output) A 32-bit binary integer representing milliseconds. The range of valid output_milliseconds is 0 to 999. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2E9 │ 3 │ 2505 │ The number-of-seconds value was not within the │ │ │ │ │ supported range. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  OpenEdition MVS consideration-In multithread applications, CEESECI affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCSECI */ #include #include #include #include int main(void) { _INT4 year, month, day, hours, minutes, seconds, millisecs; _FLOAT8 input; _FEEDBACK fc; input = 13166064000.0; CEESECI(&input,&year,&month,&day,&hours,&minutes, &seconds,&millisecs,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEESECI failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("%f seconds corresponds to the date" " %d:%d:%d.%d %d/%d/%d\n",input,hours,minutes, seconds,millisecs,month,day,year); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTSECI ************************************************* ** ** ** Function: CEESECI - convert seconds to ** ** integers ** ** ** ** In this example a call is made to CEESECI ** ** to convert a number representing the number ** ** of seconds since 00:00 14 October 1582 ** ** to seven binary integers representing year, ** ** month, day, hour, minute, second, and ** ** millisecond. The results are displayed in ** ** this example. ** ** ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. CBLSECI. DATA DIVISION. WORKING-STORAGE SECTION. 01 INSECS COMP-2. 01 YEAR PIC S9(9) COMP. 01 MONTH PIC S9(9) COMP. 01 DAYS PIC S9(9) COMP. 01 HOURS PIC S9(9) COMP. 01 MINUTES PIC S9(9) COMP. 01 SECONDS PIC S9(9) COMP. 01 MILLSEC PIC S9(9) COMP. 01 IN-DATE. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of IN-DATE. 01 PICSTR. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of PICSTR. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLSECS. ** Call CEESECS to convert timestamp of 6/2/88 ** at 10:45 AM to Lilian representation MOVE 20 TO Vstring-length of IN-DATE. MOVE '06/02/88 10:45 AM' TO Vstring-text of IN-DATE. MOVE 20 TO Vstring-length of PICSTR. MOVE 'MM/DD/YY HH:MI:SS AM' TO Vstring-text of PICSTR. CALL 'CEESECS' USING IN-DATE, PICSTR, INSECS, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEESECS failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. PARA-CBLSECI. ** Call CEESECI to convert seconds to integers CALL 'CEESECI' USING INSECS, YEAR, MONTH, DAYS, HOURS, MINUTES, SECONDS, MILLSEC, FC. ** If CEESECI runs successfully, display results IF CEE000 of FC THEN DISPLAY 'Input seconds of ' INSECS ' represents:' DISPLAY ' Year......... ' YEAR DISPLAY ' Month........ ' MONTH DISPLAY ' Day.......... ' DAYS DISPLAY ' Hour......... ' HOURS DISPLAY ' Minute....... ' MINUTES DISPLAY ' Second....... ' SECONDS DISPLAY ' Millisecond.. ' MILLSEC ELSE DISPLAY 'CEESECI failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMSECI */ /****************************************************/ /** */ /** Function: CEESECI - convert seconds to integers */ /** */ /****************************************************/ PLISECI: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL INSECS FLOAT8; DCL YEAR INT4; DCL MONTH INT4; DCL DAYS INT4; DCL HOURS INT4; DCL MINUTES INT4; DCL SECONDS INT4; DCL MILLSEC INT4; DCL 01 FC FEEDBACK; INSECS = 13166064060; /* number of seconds since */ /* 14 October 1582 */ /* Call CEESECI to convert INSECS to separate */ /* binary integers representing the year, */ /* month, day, hours, minutes, seconds and */ /* milliseconds. */ CALL CEESECI ( INSECS, YEAR, MONTH, DAYS, HOURS, MINUTES, SECONDS, MILLSEC, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT EDIT( INSECS, ' seconds corresponds to ', MONTH, '/', DAYS, '/', YEAR, ' at ', HOURS, ':', MINUTES, ':', SECONDS, '.', MILLSEC ) (SKIP, F(9), A, 2 (P'99',A), P'9999', A, 3 (P'99', A), P'999' ); END; ELSE DO; DISPLAY( 'CEESECI failed with msg ' || FC.MsgNo ); STOP; END; END PLISECI; ═══ 3.3.49. CEESECS-Convert Timestamp to Number of Seconds ═══ CEESECS converts a string representing a timestamp into a number representing the number of Lilian seconds (number of seconds since 00:00 14 October 1582). This service makes it easier to perform time arithmetic, such as calculating the elapsed time between two timestamps. The inverse of CEESECS is CEEDATM, which converts output_seconds to character format. By default, 2-digit years lie within the 100 year range starting 80 years prior to the system date. Thus, in 1993, all 2-digit years represent dates between 1913 and 2012, inclusive. You can change this range by using the callable service CEESCEN-Set the Century Window. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESECS──(──input_timestamp──,──picture_string──,──output_seconds──,──fc──)───────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ input_timestamp (input) A length-prefixed character string representing a date or timestamp in a format matching that specified by picture_string. The character string must contain between 5 and 80 picture characters, inclusive. input_timestamp can contain leading or trailing blanks. Parsing begins with the first nonblank character (unless the picture string itself contains leading blanks; in this case, CEESECS skips exactly that many positions before parsing begins). After a valid date is parsed, as determined by the format of the date you specify in picture_string, all remaining characters are ignored by CEESECS. Valid dates range between and including the dates 15 October 1582 to 31 December 9999. A full date must be specified. Valid times range from 00:00.000 to 23:59.999. If any part or all of the time value is omitted, zeros are substituted for the remaining values. For example: 1992-05-17-19:02 is equivalent to 1992-05-17-19:00 1992-05-17 is equivalent to 1992-05-17-00:00 picture_string (input) VSTRING, a length-prefixed character string, indicating the format of the date or timestamp value specified in input_timestamp. Each character in the picture_string represents a character in input_timestamp. For example, if you specify MMDDYY HH.MI.SS as the picture_string, CEESECS reads an input_char_date of 060288 15.35.02 as 3:02 PM on 02 June 1988. If delimiters such as the slash (/) appear in the picture string, leading zeros can be omitted. For example, the following calls to CEESECS all assign the same value to variable secs: CALL CEESECS('92/06/03 15.35.03', 'YY/MM/DD HH.MI.SS', secs, fc); CALL CEESECS('92/6/3 15.35.03' , 'YY/MM/DD HH.MI.SS', secs, fc); CALL CEESECS('92/6/3 3.35.03 PM', 'YY/MM/DD HH.MI.SS AP', secs, fc); CALL CEESECS('92.155 3.35.03 pm', 'YY.DDD HH.MI.SS AP', secs, fc); If picture string is left null or blank, CEESECS obtains picture_string based on the current value of the COUNTRY run-time option (see COUNTRY). For example, if the current value of the COUNTRY run-time option is FR (France), the date format would be DD.MM.YYYY. If picture_string includes a Japanese era symbol , the YY position in input_timestamp represents the year number within the Japanese era. For example, the year 1988 equals the Japanese year 63 in the Showa era. See Japanese Eras Used by Date/Time Services when Specified for a list of Japanese eras supported by CEESECS. If picture_string includes a Republic of China (ROC) Era symbol or , the YY position in input_timestamp represents the year number within the ROC Era. For example, the year 1988 equals the ROC year 77 in the MinKow Era. See Republic of China Eras Used by Date/Time Services when or Specified for a list of ROC Eras supported by CEESECS. See Picture Terms Used in Picture Strings for a list of valid picture characters, and Examples of Picture Terms Recognized by Date/Time Services for examples of valid picture strings. output_seconds (output) A 64-bit double floating-point number representing the number of seconds since 00:00 on 14 October 1582, not counting leap seconds. For example, 00:01 on 15 October 1582 is second 86,401 (24*60*60 + 01) in the Lilian format. 19:01.12 on 16 May 1988 is second 12,799,191,601.12. The largest value represented is 23:59.999 on 31 December 9999, which is second 265,621,679,999.999 in the Lilian format. A 64-bit double floating-point value can accurately represent approximately 16 significant decimal digits without loss of precision. Therefore, accuracy is available to the nearest millisecond (15 decimal digits). If input_timestamp does not contain a valid date or timestamp, output_seconds is set to 0 and CEESECS terminates with a non-CEE000 symbolic feedback code. Elapsed time calculations are performed easily on the output_seconds, because it represents elapsed time. Leap year and end-of-year anomalies are avoided. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EB │ 3 │ 2507 │ Insufficient data was passed to CEEDAYS or │ │ │ │ │ CEESECS. The Lilian value was not calculated. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EC │ 3 │ 2508 │ The date value passed to CEEDAYS or CEESECS │ │ │ │ │ was invalid. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2ED │ 3 │ 2509 │ The Japanese or Republic of China Era passed │ │ │ │ │ to CEEDAYS or CEESECS was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EE │ 3 │ 2510 │ The hours value was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EH │ 3 │ 2513 │ The input date was not within the supported │ │ │ │ │ range. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EK │ 3 │ 2516 │ The minutes value was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EL │ 3 │ 2517 │ The month value was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EM │ 3 │ 2518 │ An invalid picture string was specified. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EN │ 3 │ 2519 │ The seconds value was not recognized. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2EP │ 3 │ 2521 │ The Japanese or Chinese year-within-Era value │ │ │ │ │ passed to CEEDAYS or CEESECS was zero. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2ET │ 3 │ 2525 │ CEESECS detected non-numeric data in a numeric │ │ │ │ │ field, or the timestamp string did not match │ │ │ │ │ the picture string. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  The probable cause for receiving message number 2518 is a picture string that contains an invalid DBCS string. You should verify that the data in the picture string is correct.  OpenEdition MVS consideration-In multithread applications, CEESECS affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCSECS */ #include #include #include #include int main(void) { _FEEDBACK fc; _FLOAT8 seconds1, seconds2; _VSTRING date,date_pic; /* use CEESECS to convert to seconds timestamp */ strcpy(date.string,"09/13/91 23:23"); date.length = strlen(date.string); strcpy(date_pic.string,"MM/DD/YY HH:MI:SS"); date_pic.length = strlen(date_pic.string); CEESECS(17 May 1994,17 May 1994_pic,&seconds1,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEESECS failed with message number %d\n", fc.tok_msgno); exit(2999); } strcpy(date.string, "December 15, 1992 at 8:45 AM"); date.length = strlen(date.string); strcpy(date_pic.string, "Mmmmmmmmmmmz DD, YYYY at ZH:MI:SS AP"); date_pic.length = strlen(date_pic.string); CEESECS(17 May 1994,17 May 1994_pic,&seconds2,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEESECS failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("The number of seconds between:\n"); printf(" September 13, 1991 at 11:23 PM"); printf( " and December 15, 1992 at 8:45 AM is: seconds2 - seconds1); }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTSECS ************************************************ ** ** ** Function: CEESECS - convert timestamp to ** ** number of seconds ** ** ** ** In this example, calls are made to CEESECS ** ** to convert two timestamps to the number of ** ** seconds since 00:00 14 October 1582. ** ** The Lilian seconds for the earlier ** ** timestamp are then subtracted from the ** ** Lilian seconds for the later timestamp ** ** to determine the number of between the ** ** two. This result is displayed. ** ** ** ************************************************ IDENTIFICATION DIVISION. PROGRAM-ID. CBLSECS. DATA DIVISION. WORKING-STORAGE SECTION. 01 SECOND1 COMP-2. 01 SECOND2 COMP-2. 01 TIMESTP. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of TIMESTP. 01 TIMESTP2. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of TIMESTP2. 01 PICSTR. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of PICSTR. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-SECS1. ** Specify first timestamp and a picture string ** describing the format of the timestamp ** as input to CEESECS MOVE 25 TO Vstring-length of TIMESTP. MOVE '1969-05-07 12:00.000' to Vstring-text of TIMESTP. MOVE 25 TO Vstring-length of PICSTR. MOVE 'YYYY-MM-DD HH:MI:SS.999' TO Vstring-text of PICSTR. ** Call CEESECS to convert the first timestamp to ** Lilian seconds CALL 'CEESECS' USING TIMESTP, PICSTR, SECOND1, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEESECS failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. PARA-SECS2. ** Specify second timestamp and a picture string ** describing the format of the timestamp as ** input to CEESECS. MOVE 25 TO Vstring-length of TIMESTP2. MOVE '2000-01-01 00:01.000' to Vstring-text of TIMESTP2. MOVE 25 TO Vstring-length of PICSTR. MOVE 'YYYY-MM-DD HH:MI:SS.999' TO Vstring-text of PICSTR. ** Call CEESECS to convert the second timestamp ** to Lilian seconds CALL 'CEESECS' USING TIMESTP2, PICSTR, SECOND2, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEESECS failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. PARA-SECS2. ** Subtract SECOND2 from SECOND1 to determine the ** number of seconds between the two timestamps SUBTRACT SECOND1 FROM SECOND2. DISPLAY 'The number of seconds between ' Vstring-text OF TIMESTP ' and ' Vstring-text OF TIMESTP2 ' is: ' SECOND2. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMSECS */ /*****************************************************/ /** */ /** Function: CEESECS - Convert timestamp to seconds */ /** */ /** In this example, CEESECS is called to return an */ /** input timestamp as the number of seconds since */ /** 14 October 1582. */ /** */ /*****************************************************/ PLISECS: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL TIMESTP VSTRING; DCL PICSTR VSTRING; DCL SECONDS FLOAT8; DCL 01 FC FEEDBACK; TIMESTP = '10 November 1992'; /* Specify input */ /* date as timestamp */ PICSTR = 'ZD Mmmmmmmmmmmmmmz YYYY'; /* Picture string that descibes timestamp */ /* Call CEESECS to return the input date as */ /* Lilian seconds */ CALL CEESECS ( TIMESTP, PICSTR, SECONDS, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'There were ' || SECONDS || ' seconds between 14 Oct 1582 and ' || TIMESTP ); END; ELSE DO; DISPLAY( 'CEESECS failed with msg ' || FC.MsgNo ); STOP; END; END PLISECS; ═══ 3.3.50. CEESGL-Signal a Condition ═══ CEESGL raises, or signals, a condition to the condition manager. It also provides qualifying data and creates an ISI for a particular instance of the condition. The ISI contains information used by the LE/370 condition manager to identify and react to conditions. CEESGL generates an LE/370 condition. You can map some of the LE/370 conditions to POSIX signals (see LE/370 Programming Guide for more information). Unique conditions signaled by CEESGL are considered to be enabled under LE/370. Therefore, they undergo LE/370 condition handling. CEESGL can signal a POSIX condition. If CEESGL signals a POSIX condition and the signal is blocked at the time of the generation but later unblocked and delivered, the POSIX signal processing semantics are applied. The LE/370 synchronous condition manager semantics do not apply. CEESGL is typically used to generate application-specific conditions that are recognized by condition handlers registered via CEEHDLR. Conditions can also be selected to simulate an LE/370 or system condition. Severity 0 and 1 conditions are considered safe conditions. They can be ignored if they are not handled and if no feedback token is passed when the condition is raised. Each enabled signaled condition (of severity 2 or above) increments the error count by one. If the error count exceeds the error count limit (as specified by the ERRCOUNT run-time option-see ERRCOUNT), the condition manager terminates the enclave with abend code 4091, reason code 11. T_I_U (Termination Imminent due to an Unhandled Condition) is not issued. Promoted conditions do not increment the error count. A program established using the CEEHDLR callable service or one of the high-level language condition handlers, can then process the raised condition. ERRCOUNT does not apply if the condition generated by CEESGL is delivered asynchronously. POSIX signal handling semantics are then applied to the condition. S/370 Interrupt Code Descriptions contains a list of the S/370 program interrupt codes and their corresponding LE/370 condition token names and message numbers. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESGL──(──cond_rep──,──┬─────────────────┬──fc──)────────────────────────────────────────>< │ │ └─q_data_token──,─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ cond_rep (input) A 12-byte condition token representing the condition to be signaled. You can either construct your own condition token or use one that LE/370 has already defined. To construct your own condition token, see CEENCOD-Construct a Condition Token. Conditions signaled by CEESGL are not necessarily handled by LE/370. If you call CEESGL with a cond_rep, LE/370 passes control to the language in which the routine is written. The condition manager then determines whether it should handle the condition. If so, the HLL handles the condition. If not, control returns to LE/370. The condition might also be ignored or blocked, or might result in enclave termination. q_data_token (input/output) An optional 32-bit data object placed in the ISI to access the qualifying data (q_data) associated with the given instance of the condition. The q_data_token is a list of information addresses a user condition handler uses to specifically identify and, if necessary, react to, a given condition. The information in the q_data_token provides a mechanism by which user-written condition handlers can provide a complete fix-up of some conditions. q_data tokens associated with a condition using CEESGL can be extracted later using the CEEGQDT callable service (see CEEGQDT-Retrieve q_data_token for more information). fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE069 │ 0 │ 0201 │ An unhandled condition was returned in a feed- │ │ │ │ │ back code. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0CE │ 1 │ 0398 │ Resume with new input. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0CF │ 1 │ 0399 │ Resume with new output. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0EB │ 3 │ 0459 │ Not enough storage was available to create a │ │ │ │ │ new instance specific information block. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE0EE │ 3 │ 0462 │ Instance specific information for the condi- │ │ │ │ │ tion token with message number message-number │ │ │ │ │ and facility ID facility-id could not be │ │ │ │ │ found. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Notes  PL/I consideration-Conditions with a facility ID of IBM cannot be used in CEESGL.  OpenEdition MVS consideration-In multithread applications, CEESGL affects only the calling thread. Examples  C/370 Example /*COMPILATION UNIT: EDCSGL */ #include #include #include #include int main(void) { _FEEDBACK fc,condtok; _ENTRY routine; _INT4 token,qdata; _INT2 c_1,c_2,cond_case,sev,control; _CHAR3 facid; _INT4 isi; /* . . . */ /* build the condition token */ c_1 = 1; c_2 = 99; cond_case = 1; sev = 1; control = 0; memcpy(facid,"ZZZ",3); isi = 0; CEENCOD(&c_1,&c_2,&cond_case,&sev,&control, facid,&isi,&condtok,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEENCOD failed with message number %d\n", fc.tok_msgno); exit(2999); } /* signal the condition */ CEESGL(&condtok,&qdata,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEESGL failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTSGL ******************************************** ** ** ** Function: CEESGL - signal a condition ** ** ** ******************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLSGL. DATA DIVISION. WORKING-STORAGE SECTION. 01 CONDTOK. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 QDATA PIC S9(9) COMP. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. 01 SEV PIC S9(4) COMP. 01 MSGNO PIC S9(4) COMP. 01 CASE PIC S9(4) COMP. 01 SEV2 PIC S9(4) COMP. 01 CNTRL PIC S9(4) COMP. 01 FACID PIC X(3). 01 ISINFO PIC S9(9) COMP. PROCEDURE DIVISION. PARA-CBLSGL. ** Call CEENCOD with the values assigned above to ** build a condition token "CONDTOK" ** Set CONDTOK to sev = 0, msgno = 1 facid = CEE MOVE 0 TO SEV. MOVE 1 TO MSGNO. MOVE 1 TO CASE. MOVE 0 TO SEV2. MOVE 1 TO CNTRL. MOVE 'CEE' TO FACID. MOVE 0 TO ISINFO. CALL 'CEENCOD' USING SEV, MSGNO, CASE, SEV2, CNTRL, FACID, ISINFO, CONDTOK, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEENCOD failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ** Call CEESGL to signal the condition with ** the condition token and qdata described ** in CONDTOK and QDATA MOVE 0 TO QDATA. CALL 'CEESGL' USING CONDTOK , QDATA , FC. IF NOT CEE000 of FC THEN DISPLAY 'CEESGL failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. GOBACK.  PL/I Example *PROCESS MACRO; /*COMPILATION UNIT: IBMSGL */ /*********************************************/ /** */ /** Function: CEESGL - Signal a Condition */ /** */ /*********************************************/ PLISGL: PROC OPTIONS(MAIN); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; DCL 01 CONDTOK FEEDBACK; DCL QDATA INT4; DCL 01 FC FEEDBACK; /* Give CONDTOK value of condition CEE001 */ ADDR( CONDTOK ) -> CEEIBMCT = CEE001; /* Signal condition CEE001 with qualifying data */ QDATA = 1; CALL CEESGL ( CONDTOK, QDATA, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Condition CEE001 signalled' ); END; ELSE DO; DISPLAY( 'CEESGL failed with msg ' || FC.MsgNo ); STOP; END; END PLISGL; ═══ 3.3.51. CEETEST-Invoke Debug Tool ═══ CEETEST invokes a debug service such as Debug Tool/370. Debug Tool/370 is not supported for applications with POSIX(ON) in effect. If you want to invoke another interactive debug service, refer to the appropriate user's guide. ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEETEST──(──┬───────────────────────┬──,──fc──)───────────────────────────────────────────>< │ │ └─string_of_commands──,─┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ string_of_commands (input) A halfword prefixed string containing a debug tool command list. string_of_commands is optional. If a debug tool is available, the commands in the list are passed to the debug tool and carried out. If this parameter is omitted, your debug service defines the action taken. For more information, refer to the appropriate user's guide for your debug service. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE2F2 │ 3 │ 2530 │ A debug tool was not available. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ Usage Note  OpenEdition MVS considerations-CEETEST applies to the enclave. All threads in the enclave can access debugger information. Examples  C/370 Example /*COMPILATION UNIT: EDCTEST */ #include #include #include #include int main (void) { int x,y,z; _VSTRING commands; _FEEDBACK fc; strcpy(commands.string, "AT LINE 30 { LIST(x); LIST(y); GO;"); commands.length = strlen(commands.string); CEETEST(&commands,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEETEST failed with message number %d\n", fc.tok_msgno); exit(2999); } x = y = 12; /* . . . */ /* debug tool displays the values of x and y */ /* at statement 30 */ /* . . . */ }  COBOL/370 Example CBL LIB,APOST *COMPILATION UNIT: IGZTTEST IDENTIFICATION DIVISION. PROGRAM-ID. IBCT002. DATA DIVISION. WORKING-STORAGE SECTION. 01 MANVAR1 PIC S9(9) COMP. 01 CEETEST-PARMS. 02 Vstring-length PIC S9(4) COMP. 02 Vstring-text. 03 Vstring-char PIC X, OCCURS 0 TO 256 TIMES, DEPENDING ON Vstring-length of CEETEST-PARMS. 01 FC. 02 Condition-Token-Value. COPY CEEIGZCT. 03 Case-1-Condition-ID. 04 Severity PIC S9(4) COMP. 04 Msg-No PIC S9(4) COMP. 03 Case-2-Condition-ID REDEFINES Case-1-Condition-ID. 04 Class-Code PIC S9(4) COMP. 04 Cause-Code PIC S9(4) COMP. 03 Case-Sev-Ctl PIC X. 03 Facility-ID PIC XXX. 02 I-S-Info PIC S9(9) COMP. PROCEDURE DIVISION. PARA-IBCT002. MOVE 0 TO MANVAR1 COMPUTE MANVAR1 = MANVAR1 + 100 DISPLAY 'The value of MANVAR1 is ' , MANVAR1 *************************************************** * CALL CEETEST FOR FIRST TIME. * *************************************************** MOVE 70 TO Vstring-length of CEETEST-PARMS. MOVE 'DESC PROGRAM;AT ENTRY IBCT002:>SUBRTN' TO Vstring-text of CEETEST-PARMS(1:37). move ' PERFORM Q LOC;GO;END-PERFORM;GO;' TO Vstring-text of CEETEST-PARMS(38:33). CALL 'CEETEST' USING CEETEST-PARMS, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEETEST(1st call) failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. *************************************************** * CALL CEETEST A SECOND TIME. * *************************************************** MOVE 4 TO Vstring-length of CEETEST-PARMS. MOVE 'QUIT;' TO Vstring-text of CEETEST-PARMS. CALL 'CEETEST' USING CEETEST-PARMS, FC. IF NOT CEE000 of FC THEN DISPLAY 'CEETEST(2nd call) failed with msg ' Msg-No of FC UPON CONSOLE; STOP RUN; END-IF. ************************************************** GOBACK. IDENTIFICATION DIVISION. PROGRAM-ID. SUBRTN. DATA DIVISION. WORKING-STORAGE SECTION. 01 MANVAR1 PIC S9(9) COMP. 01 MVAR PIC S9(9) COMP. PROCEDURE DIVISION. PARA-SUBRTN. COMPUTE MVAR = MVAR + 100 . COMPUTE MANVAR1 = MANVAR1 + 100 . GOBACK. END PROGRAM SUBRTN. END PROGRAM IBCT002. ═══ 3.3.52. CEEUTC-Get Coordinated Universal Time ═══ CEEUTC is an alias of CEEGMT. See CEEGMT-Get Current Greenwich Mean Time. ═══ 4. LE/370 Math Services ═══ LE/370 math services provide standard math computations. You can call them from LE/370-conforming languages or from assembler routines by using the call interface (defined below and shown throughout this chapter), or the syntax specific to the HLL of your application. Math services do not depend on enclave-level resources. You can invoke them from any thread. If your application uses extended-precision arithmetic and runs on a 370-mode machine, you must specify the TRAP(ON) run-time option and add the CMSLIB TXTLIB with the GLOBAL TXTLIB command. This chapter contains the following sections:  Call Interface to Math Services  Parameter Types: parm1 Type and parm2 Type  Sample Calls to Math Services  Examples of Math Services For a list of all the LE/370 math services, see LE/370 Quick Reference Tables. This section contains he following Math services: ┌─────────────────────────────────────────────────┬────────────────────────────────────────────────┐ │ CEESxABS-Absolute Value │ CEESxACS-Arccosine │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxASN-Arcsine │ CEESxATH-Hyperbolic Arctangent │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxATN-Arctangent │ CEESxAT2-Arctangent2 │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxCJG-Conjugate of Complex │ CEESxCOS-Cosine │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxCSH-Hyperbolic Cosine │ CEESxCTN-Cotangent │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxDIM-Positive Difference │ CEESxDVD-Floating Complex Divide │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxERC-Error Function Complement │ CEESxERF-Error Function │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxEXP-Exponential Base e │ CEESxGMA-Gamma Function │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxIMG-Imaginary Part of Complex │ CEESxINT-Truncation │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxLGM-Log Gamma │ CEESxLG1-Logarithm Base 10 │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxLG2-Logarithm Base 2 │ CEESxLOG-Logarithm Base e │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxMLT-Floating Complex Multiply │ CEESxMOD-Modular Arithmetic │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxNIN-Nearest Integer │ CEESxNWN-Nearest Whole Number │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxSGN-Transfer of Sign │ CEESxSIN-Sine │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxSNH-Hyperbolic Sine │ CEESxSQT-Square Root │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxTAN-Tangent │ CEESxTNH-Hyperbolic Tangent │ ├─────────────────────────────────────────────────┼────────────────────────────────────────────────┤ │ CEESxXPx-Exponentiation │ │ └─────────────────────────────────────────────────┴────────────────────────────────────────────────┘ ═══ 4.1. Call Interface to Math Services ═══ The syntax for math services has two forms, depending on how many input parameters the routine requires. The first four letters of the math services are always CEES. The fifth character is x, which you replace according to the parameter types listed in Parameter Types: parm1 Type and parm2 Type. The last three letters name the math function performed. In the following examples, the first function performed is the absolute value (ABS), and the second function is the positive difference (DIM). ┌─── ONE PARAMETER ────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxABS──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ┌─── TWO PARAMETERS ───────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxDIM──(──parm1──,──parm2──,──fc──,──result──)─────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ ═══ 4.1.1. Parameter Types: parm1 Type and parm2 Type ═══ The first parameter (parm1) is mandatory. The second parameter (parm2) is used only when you use a math service with two parameters. The x in the fifth space of CEESx must be replaced by a parameter type for input and output. Substitute I, S, D, Q, T, E, or R for x: I 32-bit binary integer S 32-bit single float number D 64-bit double float number Q 128-bit extended float number T 32-bit single float-complex number(**) E 64-bit double float-complex number(**) R 128-bit extended float-complex number(**) LE/370 math services expect normalized input. In the routines described in this chapter, the output range(**) for complex-valued functions can be determined from the input range. ═══ 4.1.2. Feedback Code Parameter (fc) ═══ fc is a feedback code that indicates the result of the math service. If you specify fc as an argument, feedback information in the form of a condition token is returned to the calling routine. The condition token indicates whether the routine completed successfully or whether a condition was encountered while the routine was running. If you do not specify fc as an argument and the requested service does not successfully complete, the condition is signaled. Because math services call other services, these other services might generate feedback codes. C/370, COBOL/370, and PL/I offer built-in math services that you can also use under LE/370. ═══ 4.2. Sample Calls to Math Services ═══ This section contains sample calls to LE/370 math services from C/370, COBOL/370, and PL/I. ═══ 4.2.1. C/370 Call to CEESLOG-Logarithm Base e ═══ #include #include #include int main (void) { float int1, intr; _FEEDBACK fc; #define SUCCESS "\0\0\0\0" int1 = 39; CEESSLOG(&int1,&fc,&intr); if (memcmp(&fc,SUCCESS,4) != 0) { printf("CEESSLOG failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("Log base e of %f is %f\n",int1,intr); } ═══ 4.2.2. COBOL/370 Call to CEESSLOG-Logarithm Base e ═══ . . . 77 ARG1RS COMP-1. 77 FBCODE PIC X(12). 77 RESLTRS COMP-1. CALL "CEESSLOG" USING ARG1RS , FBCODE , RESLTRS. . . . ═══ 4.2.3. PL/I Call to CEESSLOG-Logarithm Base e ═══ . . . DCL ARG1 RESULT REAL FLOAT DEC (6); DCL FC CHARACTER (12); CALL CEESSLOG (ARG1, FC, RESULT) . . . ═══ 4.3. Math Services ═══ This section contains an alphabetical list of the LE/370 math services. ═══ 4.3.1. CEESxABS-Absolute Value ═══ CEESxABS returns the absolute value of the parameter by using the equation result = |parm1|. The following routines are provided for the various data types supported: CEESIABS 32-bit binary integer CEESSABS 32-bit single float number CEESDABS 64-bit double float number CEESQABS 128-bit extended float number CEESTABS 32-bit single float-complex number CEESEABS 64-bit double float-complex number CEESRABS 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxABS──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the absolute value routine. The input range is not restricted. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V9 │ 1 │ 2025 │ An underflow has occurred in math routine │ │ │ │ │ routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the absolute value routine. The output range is the non-negative numbers <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.2. CEESxACS-Arccosine ═══ CEESxACS returns the arccosine of the parameter by using the equation result = arccos (parm1). The following routines are provided for the various data types supported: CEESSACS 32-bit single float number CEESDACS 64-bit double float number CEESQACS 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxACS──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the arccosine routine. The input range is |parm1| <= 1. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V0 │ 2 │ 2016 │ The absolute value of the argument was greater │ │ │ │ │ than limit in math routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result, in radians, of the arccosine routine. The output range is 0 <= result <= pi. ═══ 4.3.3. CEESxASN-Arcsine ═══ CEESxASN returns the arcsine of the parameter by using the equation result = arcsin(parm1). The following routines are provided for the various data types supported: CEESSASN 32-bit single float number CEESDASN 64-bit double float number CEESQASN 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxASN──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the arcsine routine. The input range is |parm1| <= 1. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V0 │ 2 │ 2016 │ The absolute value of the argument was greater │ │ │ │ │ than limit in math routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result, in radians, of the arcsine routine. The output range is |result| pi/2. ═══ 4.3.4. CEESxATH-Hyperbolic Arctangent ═══ CEESxATH returns the hyperbolic arctangent of the parameter by using the equation result = (tanh**(-1))parm1. The following routines are provided for the various data types supported: CEESSATH 32-bit single float number CEESDATH 64-bit double float number CEESQATH 128-bit extended float number CEESTATH 32-bit single float-complex number CEESEATH 64-bit double float-complex number CEESRATH 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxATH──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the hyperbolic arctangent routine. The input range for real variables is |parm1| < 1. For complex variables, parm1 cannot be equal to 1 or -1. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V1 │ 2 │ 2017 │ The absolute value of the argument was greater │ │ │ │ │ than or equal to limit in math routine │ │ │ │ │ routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V6 │ 2 │ 2022 │ The value of the argument was plus or minus │ │ │ │ │ limit in math routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the hyperbolic arctangent routine. The output range for functions of real variables is |result| <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.5. CEESxATN-Arctangent ═══ CEESxATN returns the arctangent of the parameter by using the equation result = arctan(parm1). The following routines are provided for the various data types supported: CEESSATN 32-bit single float number CEESDATN 64-bit double float number CEESQATN 128-bit extended float number CEESTATN 32-bit single float-complex number CEESEATN 64-bit double float-complex number CEESRATN 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxATN──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the arctangent routine. The input range for real variables is not restricted. The input range for complex variables is parm1 is not equal to i or -i (where i = sqrt -1). fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V6 │ 2 │ 2022 │ The value of the argument was plus or minus │ │ │ │ │ limit in math routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V9 │ 1 │ 2025 │ An underflow has occurred in math routine │ │ │ │ │ routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result, in radians, of the arctangent routine. The output range for functions of real variables is |result| < pi/2. ═══ 4.3.6. CEESxAT2-Arctangent2 ═══ CEESxAT2 calculates a result by using the equation result = the angle (in radians) between the positive X axis and a vector defined by (parm2, parm1) with a range from -pi to pi, inclusive. For example, if parm1 and parm2 are positive, then result = arctan (parm1/parm2). The following routines are provided for the various data types supported: CEESSAT2 32-bit single float number CEESDAT2 64-bit double float number CEESQAT2 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxAT2──(──parm1──,──parm2──,──fc──,──result──)─────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The first input to the arctangent2 routine. The input range is parm1 cannot equal 0 if parm2 equals 0. parm2 (input) The second parameter to the arctangent2 routine. The input range is parm2 cannot equal 0 if parm1 equals 0. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UU │ 2 │ 2014 │ Both arguments were equal to limit in math │ │ │ │ │ routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V9 │ 1 │ 2025 │ An underflow has occurred in math routine │ │ │ │ │ routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result, in radians, of the arctangent2 routine. The output range is |result| <= pi. ═══ 4.3.7. CEESxCJG-Conjugate of Complex ═══ CEESxCJG returns the conjugate of the complex number by using the equation result = u - vi, where parm1 = u + vi. The following routines are provided for the various data types supported: CEESTCJG 32-bit single float-complex number CEESECJG 64-bit double float-complex number CEESRCJG 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxCJG──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the math service. Any representable complex number can be used as input. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the conjugate of complex routine. ═══ 4.3.8. CEESxCOS-Cosine ═══ CEESxCOS returns the cosine of the parameter by using the equation result = cos(parm1). The following routines are provided for the various data types supported: CEESSCOS 32-bit single float number CEESDCOS 64-bit double float number CEESQCOS 128-bit extended float number CEESTCOS 32-bit single float-complex number CEESECOS 64-bit double float-complex number CEESRCOS 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxCOS──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The type is determined by the fifth character of the service name. The input range for real variables is | parm1 | < (2**18 · pi), for single float numbers | parm1 | < (2**50 · pi), for double float numbers | parm1 | < 2**100, for extended float numbers For complex functions, the input range differs for the imaginary and real parts of the input. For the imaginary part, the input range is | Im(parm1) | < 174.673. For the real part of the input, the input range is |Re(parm1)| < (2**18 · pi), for single float-complex numbers |Re(parm1)| < (2**50 · pi), for double float-complex numbers |Re(parm1)| < 2**100, for extended float-complex numbers fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UT │ 2 │ 2013 │ The absolute value of the imaginary part of │ │ │ │ │ the argument was greater than limit in math │ │ │ │ │ routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V1 │ 2 │ 2017 │ The absolute value of the argument was greater │ │ │ │ │ than or equal to limit in math routine │ │ │ │ │ routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V3 │ 2 │ 2019 │ The absolute value of the real part of the │ │ │ │ │ argument was greater than or equal to limit in │ │ │ │ │ math routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the cosine routine. The output range for functions of real variables is | result | <= 1. ═══ 4.3.9. CEESxCSH-Hyperbolic Cosine ═══ CEESxCSH returns the hyperbolic cosine of the parameter by using the equation result = cosh(parm1). The following routines are provided for the various data types supported: CEESSCSH 32-bit single float number CEESDCSH 64-bit double float number CEESQCSH 128-bit extended float number CEESTCSH 32-bit single float-complex number CEESECSH 64-bit double float-complex number CEESRCSH 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxCSH──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the hyperbolic cosine routine. The input range for the functions of real variables is |parm1| < 175.366. For complex functions, the input range differs for the imaginary and real parts of the input. For the real part of complex numbers, the input range is |Re(parm1)| < 175.366. For the imaginary part of the input, the input range is |Im(parm1)| < (2**18 · pi), for single float-complex numbers |Im(parm1)| < (2**50 · pi), for double float-complex numbers |Im(parm1)| < 2**100, for extended float-complex numbers fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V0 │ 2 │ 2016 │ The absolute value of the argument was greater │ │ │ │ │ than limit in math routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the hyperbolic cosine routine. The output range for functions of real variables is 1 <= result <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.10. CEESxCTN-Cotangent ═══ CEESxCTN returns the cotangent of the parameter by using the equation result = cot(parm1). The following routines are provided for the various data types supported: CEESSCTN 32-bit single float number CEESDCTN 64-bit double float number CEESQCTN 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxCTN──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input, in radians, into the cotangent routine. The input range varies, depending on the precision of parm1: Single-precision |parm1|< 2**18 · pi Double-precision |parm1|< 2**50 · pi Extended-precision |parm1|< 2**100 · pi If this is an extended float number, this argument cannot approach a multiple of pi. Single float numbers and double float numbers cannot approach zero. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UI │ 2 │ 2002 │ The argument value was too close to one of the │ │ │ │ │ singularities (plus or minus pi/2, plus or │ │ │ │ │ minus 3pi/2, for the tangent; or plus or minus │ │ │ │ │ pi, plus or minus 2pi, for the cotangent) in │ │ │ │ │ math routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V1 │ 2 │ 2017 │ The absolute value of the argument was greater │ │ │ │ │ than or equal to limit in math routine │ │ │ │ │ routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the cotangent routine. The output range is result <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.11. CEESxDIM-Positive Difference ═══ CEESxDIM returns the positive difference between two numbers by using one of the following equations: if parm1 > parm2, then result = parm1 - parm2 if parm1 <= parm2, then result = 0 The following routines are provided for the various data types supported: CEESIDIM 32-bit binary integer CEESSDIM 32-bit single float number CEESDDIM 64-bit double float number CEESQDIM 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxDIM──(──parm1──,──parm2──,──fc──,──result──)─────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The first input to the positive difference routine. The input range is not restricted. parm2 (input) The second parameter to the positive difference routine. The input range is not restricted. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the positive difference routine. The output range is the non-negative numbers Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.12. CEESxDVD-Floating Complex Divide ═══ CEESxDVD performs the mathematical function of floating complex divide by using the equation: result = parm1/parm2. The following routines are provided for the various data types supported: CEESTDVD 32-bit single float-complex number CEESEDVD 64-bit double float-complex number CEESRDVD 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxDVD──(──parm1──,──parm2──,──fc──,──result──)─────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The first input to the math service. Any representable complex number can be used as input. parm2 (input) The second parameter to the math service. Do not set parm2 to 0. fc (output) A 12-byte feedback code passed by reference indicating the result of the service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the floating complex divide routine. ═══ 4.3.13. CEESxERC-Error Function Complement ═══ CEESxERC calculates the error function complement. If necessary, see your printed book for equation. The following routines are provided for the various data types supported: CEESSERC 32-bit single float number CEESDERC 64-bit double float number CEESQERC 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxERC──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the error function complement routine. The input range is not restricted. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the error function complement routine. The output range is 0 < result < 2. ═══ 4.3.14. CEESxERF-Error Function ═══ CEESxERF calculates the error complement. If necessary, see your printed book for equation. The following routines are provided for the various data types supported: CEESSERF 32-bit single float number CEESDERF 64-bit double float number CEESQERF 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxERF──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the error function. The input range is not restricted. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the error function. The output range is | result | < 1. ═══ 4.3.15. CEESxEXP-Exponential Base e ═══ CEESxEXP calculates the mathematical function of e raised to a power by using the equation: result = e**parm1. The following routines are provided for the various data types supported: CEESSEXP 32-bit single float number CEESDEXP 64-bit double float number CEESQEXP 128-bit extended float number CEESTEXP 32-bit single float-complex number CEESEEXP 64-bit double float-complex number CEESREXP 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxEXP──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the exponential base e routine. For complex functions, the input range differs for the imaginary and real parts of the input. For the real part of complex numbers, the input range is |Re(parm1)| < 174.673. For the imaginary part of the input, the input range is |Im(parm1)| < (2**18 · pi), for single float-complex numbers |Im(parm1)| < (2**50 · pi), for double float-complex numbers |Im(parm1)| < 2**100, for extended float-complex numbers fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UP │ 2 │ 2009 │ The value of the real part of the argument was │ │ │ │ │ greater than limit in math routine routine- │ │ │ │ │ name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UR │ 2 │ 2011 │ The argument was greater than limit in math │ │ │ │ │ routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UT │ 2 │ 2013 │ The absolute value of the imaginary part of │ │ │ │ │ the argument was greater than limit in math │ │ │ │ │ routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UV │ 2 │ 2015 │ The absolute value of the imaginary part of │ │ │ │ │ the argument was greater than or equal to │ │ │ │ │ limit in math routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V9 │ 1 │ 2025 │ An underflow has occurred in math routine │ │ │ │ │ routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the exponential base e routine. The output range for functions of real variables is 0 < result <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.16. CEESxGMA-Gamma Function ═══ CEESxGMA performs the mathematical gamma function. If necessary, see your printed book for equation. The following routines are provided for the various data types supported: CEESSGMA 32-bit single float number CEESDGMA 64-bit double float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxGMA──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the gamma function. The input range is 2**(-252) < parm1 < 57.5744. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UL │ 2 │ 2005 │ The value of the argument was outside the │ │ │ │ │ valid range range in math routine │ │ │ │ │ routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the gamma function. The output range is 0.88560 <= result Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) ═══ 4.3.17. CEESxIMG-Imaginary Part of Complex ═══ CEESxIMG returns the imaginary part of a complex number using the equation result = v, where parm1 = u + vi. The following routines are provided for the various data types supported: CEESTIMG 32-bit single float-complex number CEESEIMG 64-bit double float-complex number CEESRIMG 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxIMG──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the math service. Any complex number can be used as input. fc (output) A 12-byte feedback code passed by reference indicating the result of the service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the math service. |result| <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.18. CEESxINT-Truncation ═══ CEESxINT returns the truncated value of the parameter by using the equation: result = (sign of parm1) · n, where n = | parm1 |. | parm1 | = | m |, where m is the greatest integer satisfying the relationship | m | <= | parm1 |, and the result is expressed as a float number. The following routines are provided for the various data types supported: CEESSINT 32-bit single float number CEESDINT 64-bit double float number CEESQINT 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxINT──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the truncation routine. The input range is not restricted. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the truncation routine. The output range is |result| <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.19. CEESxLGM-Log Gamma ═══ CEESxLGM performs the mathematical function of log Gamma. If necessary, see your printed book for equation. The following routines are provided for the various data types supported: CEESSLGM 32-bit single float number CEESDLGM 64-bit double float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxLGM──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the log gamma routine. The input range is parm1 < (4.2913 · 10**73). fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UL │ 2 │ 2005 │ The value of the argument was outside the │ │ │ │ │ valid range range in math routine │ │ │ │ │ routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the Log Gamma routine. The output range is -0.12149<=result<=Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) ═══ 4.3.20. CEESxLG1-Logarithm Base 10 ═══ CEESxLG1 returns the logarithm base 10 of parm1. The following routines are provided for the various data types supported: CEESSLG1 32-bit single float number CEESDLG1 64-bit double float number CEESQLG1 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxLG1──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the log base 10 routine. The input range is parm1 > 0. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1US │ 2 │ 2012 │ The argument was less than or equal to limit │ │ │ │ │ in math routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the log base 10 routine. The output range is -78.268<=result<=75.859. ═══ 4.3.21. CEESxLG2-Logarithm Base 2 ═══ CEESxLG2 performs the mathematical function logarithm base 2 on parm1. The following routines are provided for the various data types supported: CEESSLG2 32-bit single float number CEESDLG2 64-bit double float number CEESQLG2 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxLG2──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the log base 2 routine. The input range is parm1 > 0. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1US │ 2 │ 2012 │ The argument was less than or equal to limit │ │ │ │ │ in math routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the log base 2 routine. The output range is -260<=result<=252. ═══ 4.3.22. CEESxLOG-Logarithm Base e ═══ CEESxLOG performs the mathematical function logarithm base e on parm1. The following routines are provided for the various data types supported: CEESSLOG 32-bit single float number CEESDLOG 64-bit double float number CEESQLOG 128-bit extended float number CEESTLOG 32-bit single float-complex number CEESELOG 64-bit double float-complex number CEESRLOG 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxLOG──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the log base e routine. The input range for reals is parm1 > 0. The input range for complex numbers is parm1 not equal to 0. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1US │ 2 │ 2012 │ The argument was less than or equal to limit │ │ │ │ │ in math routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V2 │ 2 │ 2018 │ The real and imaginary parts of the argument │ │ │ │ │ were equal to limit in math routine routine- │ │ │ │ │ name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the log base e routine. The output range for functions of real variables is -180.218 <= result <= 174.673. ═══ 4.3.23. CEESxMLT-Floating Complex Multiply ═══ CEESxMLT performs the mathematical function floating complex multiply by using the equation result = parm1 · parm2. The following routines are provided for the various data types supported: CEESTMLT 32-bit single float-complex number CEESEMLT 64-bit double float-complex number CEESRMLT 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxMLT──(──parm1──,──parm2──,──fc──,──result──)─────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The first input to the math service. Any representable complex number can be used as input. parm2 (input) The second parameter to the math service. Any representable complex number can be used as input. fc (output) A 12-byte feedback code passed by reference indicating the result of the service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the floating complex multiply routine. ═══ 4.3.24. CEESxMOD-Modular Arithmetic ═══ CEESxMOD performs the mathematical function modular arithmetic by using the equation result = parm1(modulo parm2). The expression parm1 (modulo parm2) is defined as parm1 - [(parm1/parm2) · parm2], with the brackets indicating an integer part, that is, the largest integer whose magnitude does not exceed the magnitude of parm1/parm2 is used. The sign of the integer is the same as the sign of parm1 · parm2. The following routines are provided for the various data types supported: CEESIMOD 32-bit binary integer CEESSMOD 32-bit single float number CEESDMOD 64-bit double float number CEESQMOD 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxMOD──(──parm1──,──parm2──,──fc──,──result──)─────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The first parameter to the modular arithmetic routine. The input range is not restricted. parm2 (input) The second parameter to the modular arithmetic routine. The input range is parm2 cannot equal 0. If parm2 = 0, the modulus routine is undefined. In addition, a divide exception is recognized and an interrupt occurs. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the mod routine. The output range is |result| <= Omega. Omega varies depending on the precision of parm1 and parm2: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.25. CEESxNIN-Nearest Integer ═══ CEESxNIN performs the mathematical function nearest integer by using the equation: result = (sign of parm1) · n. If parm1 => 0, then n = [| parm1 + .5 |]. If parm1 < 0, then n = [| parm1 - .5 |]. n = | m |, where m is the greatest integer satisfying the relationship | m | <= | parm1 + .5 |, or | m | <= | parm1 - .5 |, respectively. The following routines are provided for the various data types supported: CEESSNIN 32-bit single float number CEESDNIN 64-bit double float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxNIN──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the nearest integer routine. The input range is not restricted. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the nearest integer routine. The output parameter is an unrestricted type I, a 32-bit binary integer. ═══ 4.3.26. CEESxNWN-Nearest Whole Number ═══ CEESxNWN performs the mathematical function nearest whole number by using the equation result = (sign of parm1) · v. If parm1 => 0, then v = | parm1 + .5 |. If parm1 < 0, then v = [| parm1 - .5 |]. v = | m |, where m is the greatest integer satisfying the relationship | m | <= | parm1 +.5 |, or | m | <= | parm1 -.5 |, respectively; and the resulting v is expressed as a float number. The following routines are provided for the various data types supported: CEESSNWN 32-bit single float number CEESDNWN 64-bit double float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxNWN──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the nearest whole number routine. The input range is not restricted. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the nearest whole number routine. The output range is | result | <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) ═══ 4.3.27. CEESxSGN-Transfer of Sign ═══ CEESxSGN performs the mathematical function transfer of sign by using either of the two equations: result = |parm1| if parm2 => 0 or result = -|parm1| if parm2 < 0. The following routines are provided for the various data types supported: CEESISGN 32-bit binary integer CEESSSGN 32-bit single float number CEESDSGN 64-bit double float number CEESQSGN 128-bit extended float number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxSGN──(──parm1──,──parm2──,──fc──,──result──)─────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The first input to the transfer of sign routine. The input range is not restricted. parm2 (input) The second parameter to the transfer of sign routine. The input range is not restricted. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the transfer of sign routine. The output range is |result| <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.28. CEESxSIN-Sine ═══ CEESxSIN returns the sine of the parameter by using the equation result = sin (parm1). The following routines are provided for the various data types supported: CEESSSIN 32-bit single float number CEESDSIN 64-bit double float number CEESQSIN 128-bit extended float number CEESTSIN 32-bit single float-complex number CEESESIN 64-bit double float-complex number CEESRSIN 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxSIN──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input, in radians, to the sine routine. For real functions, the input range differs depending on the precision of parm1: |parm1| < (2**18 · pi), for single-precision numbers |parm1| < (2**50 · pi), for double-precision numbers |parm1| < 2**100, for extended-precision numbers For complex functions, the input range differs for the imaginary and real parts of the input. For the imaginary part of complex numbers, the input range is |Im(parm1)| < 174.673. For the real part, it is |Im(parm1)| < (2**18 · pi), for single float-complex numbers |Im(parm1)| < (2**50 · pi), for double float-complex numbers |Im(parm1)| < 2**100, for extended float-complex numbers fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UT │ 2 │ 2013 │ The absolute value of the imaginary part of │ │ │ │ │ the argument was greater than limit in math │ │ │ │ │ routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V1 │ 2 │ 2017 │ The absolute value of the argument was greater │ │ │ │ │ than or equal to limit in math routine │ │ │ │ │ routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V3 │ 2 │ 2019 │ The absolute value of the real part of the │ │ │ │ │ argument was greater than or equal to limit in │ │ │ │ │ math routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the sine routine. The output range for functions of real variables is -1 <= result <= 1. ═══ 4.3.29. CEESxSNH-Hyperbolic Sine ═══ CEESxSNH performs the mathematical function hyperbolic sine by using the equation result = sinh (parm1). The following routines are provided for the various data types supported: CEESSSNH 32-bit single float number CEESDSNH 64-bit double float number CEESQSNH 128-bit extended float number CEESTSNH 32-bit single float-complex number CEESESNH 64-bit double float-complex number CEESRSNH 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxSNH──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the hyperbolic sine routine. Input range for reals is |parm1| < 175.366. For complex functions, the input range differs for the imaginary and real parts of the input. For the real part, the input range is |Re(parm1)| < 174.673. The input range of the imaginary part differs depending on the precision of parm1: |Im(parm1)| < (2**18 · pi), for single float-complex numbers |Im(parm1)| < (2**50 · pi), for double float-complex numbers |Im(parm1)| < 2**100, for extended float-complex numbers fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V0 │ 2 │ 2016 │ The absolute value of the argument was greater │ │ │ │ │ than limit in math routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the hyperbolic sine routine. The output range for functions of real variables is | result | <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.30. CEESxSQT-Square Root ═══ CEESxSQT returns the square root of parm1. The following routines are provided for the various data types supported: CEESSSQT 32-bit single float number CEESDSQT 64-bit double float number CEESQSQT 128-bit extended float number CEESTSQT 32-bit single float-complex number CEESESQT 64-bit double float-complex number CEESRSQT 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxSQT──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the square root routine. The input range for real number functions is parm1 => 0. For complex numbers, the input range is not restricted. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UQ │ 2 │ 2010 │ The argument was less than limit in math │ │ │ │ │ routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the square root routine. The output range for functions of real variables is 0 <= result <= square root of Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.31. CEESxTAN-Tangent ═══ CEESxTAN returns the tangent of the parameter by using the equation result = tan (parm1). The following routines are provided for the various data types supported: CEESSTAN 32-bit single float number CEESDTAN 64-bit double float number CEESQTAN 128-bit extended float number CEESTTAN 32-bit single float-complex number CEESETAN 64-bit double float-complex number CEESRTAN 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxTAN──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input, in radians, to the tangent routine. For real functions, the input range differs depending on the precision of parm1: |parm1| < (2**18 · pi), for single-precision numbers |parm1| < (2**50 · pi), for double-precision numbers |parm1| < 2**100, for extended-precision numbers Also, for extended as well as complex functions, parm1 cannot approach odd multiples of pi/2. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UI │ 2 │ 2002 │ The argument value was too close to one of the │ │ │ │ │ singularities (plus or minus pi/2, plus or │ │ │ │ │ minus 3pi/2, for the tangent; or plus or minus │ │ │ │ │ pi, plus or minus 2pi, for the cotangent) in │ │ │ │ │ math routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V1 │ 2 │ 2017 │ The absolute value of the argument was greater │ │ │ │ │ than or equal to limit in math routine │ │ │ │ │ routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V9 │ 1 │ 2025 │ An underflow has occurred in math routine │ │ │ │ │ routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the tangent routine. The output range for functions of real variables is |result| <= &Omega.. The output range is the non-negative numbers <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.3.32. CEESxTNH-Hyperbolic Tangent ═══ CEESxTNH performs the mathematical function hyperbolic tangent by using the equation: result = tanh (parm1). The following routines are provided for the various data types supported: CEESSTNH 32-bit single float number CEESDTNH 64-bit double float number CEESQTNH 128-bit extended float number CEESTTNH 32-bit single float-complex number CEESETNH 64-bit double float-complex number CEESRTNH 128-bit extended float-complex number ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxTNH──(──parm1──,──fc──,──result──)───────────────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input to the hyperbolic tangent routine. The input range is not restricted for real functions. For complex functions, parm1 must not approach odd multiples of pi/2 · i, where i = sqrt of -1. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the hyperbolic tangent routine. The output range for functions of real variables is: | result | < 1. ═══ 4.3.33. CEESxXPx-Exponentiation ═══ CEESxXPx performs the mathematical function exponentiation by using the equation result = parm1**parm2. The following routines are provided for the various data types supported: CEESIXPI 32-bit binary integer raised to a 32-bit binary integer CEESSXPI 32-bit single float number raised to a 32-bit binary integer CEESDXPI 64-bit double float number raised to a 32-bit binary integer CEESQXPI 128-bit extended float number raised to a 32-bit binary integer CEESTXPI 32-bit single float-complex number raised to a 32-bit binary integer CEESEXPI 64-bit double float-complex number raised to a 32-bit binary integer CEESRXPI 128-bit extended float-complex number raised to a 32-bit binary integer CEESSXPS 32-bit single floating point raised to a 32-bit single floating point CEESDXPD 64-bit double floating point raised to a 64-bit double floating point CEESQXPQ 128-bit extended floating point raised to a 128-bit extended floating point CEESTXPT 32-bit single float-complex raised to a 32-bit single float-complex CEESEXPE 64-bit double float-complex raised to a 64-bit double float-complex CEESRXPR 128-bit extended float-complex raised to a 128-bit extended float-complex ┌─── SYNTAX ───────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ >>──CEESxXPx──(──parm1──,──parm2──,──fc──,──result──)─────────────────────────────────────────>< │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ parm1 (input) The input for the base of the exponentiation routine. The input range for functions of real variables is  If parm1 = 0, then parm2 > 0.  If parm1 is a 32-bit number and parm1 < 0, then |parm1| <= ((16**6) - 1) and parm2 = a whole number.  If parm1 is a 64-bit number and parm1 < 0, then |parm1| <= ((16**14) - 1) and parm2 = a whole number.  If parm1 is a 128-bit number and parm1 < 0, then |parm1| <= ((16**28) - 1) and parm2 = a whole number the input range for functions of complex variables: If Re(parm1) = 0 and Im(parm1) = 0, then Re(parm2) must be positive. parm2 (input) The input for the power of the exponentiation routine. The type is determined by the eighth character of the service name. fc (output) A 12-byte feedback code, optional in some languages, that indicates the result of this service. The following symbolic conditions can result from this service: ┌───────────────┬────────────────┬────────────────┬────────────────────────────────────────────────┐ │ SYMBOLIC │ │ │ │ │ FEEDBACK CODE │ SEVERITY │ MESSAGE NUMBER │ MESSAGE TEXT │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE000 │ 0 │ - │ The service completed successfully. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UJ │ 2 │ 2003 │ For an exponentiation operation (I**J) where I │ │ │ │ │ and J are integers, I was equal to zero and J │ │ │ │ │ was less than or equal to zero in math routine │ │ │ │ │ routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UK │ 2 │ 2004 │ For an exponentiation operation (R**I) where R │ │ │ │ │ is real and I is integer, R was equal to zero │ │ │ │ │ and I was less than or equal to zero in math │ │ │ │ │ routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UL │ 2 │ 2005 │ The value of the argument was outside the │ │ │ │ │ valid range range in math routine │ │ │ │ │ routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UM │ 2 │ 2006 │ For an exponentiation operation (R**S) where R │ │ │ │ │ and S are real values, R was equal to zero and │ │ │ │ │ S was less than or equal to zero in math │ │ │ │ │ routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UN │ 2 │ 2007 │ The exponent exceeded limit in math routine │ │ │ │ │ routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1UO │ 2 │ 2008 │ For an exponentiation operation (Z**P) where │ │ │ │ │ the complex base Z equals zero, the real part │ │ │ │ │ of the complex exponent P, or the integer │ │ │ │ │ exponent P was less than or equal to zero in │ │ │ │ │ math routine routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V4 │ 2 │ 2020 │ For an exponentiation operation (R**S) where R │ │ │ │ │ and S are real values, either R is equal to │ │ │ │ │ zero and S is negative or R is negative and S │ │ │ │ │ is not an integer whose absolute value is less │ │ │ │ │ than or equal to limit in math routine │ │ │ │ │ routine-name. │ ├───────────────┼────────────────┼────────────────┼────────────────────────────────────────────────┤ │ CEE1V5 │ 2 │ 2021 │ For an exponentiation operation (X**Y), the │ │ │ │ │ argument combination of Y*log2(X) generated a │ │ │ │ │ number greater than or equal to limit in math │ │ │ │ │ routine routine-name. │ └───────────────┴────────────────┴────────────────┴────────────────────────────────────────────────┘ result (output) The result of the exponentiation routine. The output range for functions of real variables is | result | <= Omega. Omega varies depending on the precision of parm1: For single-precision routines, Omega = (16**63)(1-16**(-6)) For double-precision routines, Omega = (16**63)(1-16**(-14)) For extended-precision routines, Omega = (16**63)(1-16**(-28)) ═══ 4.4. Examples of Math Services ═══ This section contains representative calls to math services from each supported language. ═══ 4.4.1. C/370 Math Service Example ═══ The following are C/370 examples. Log Base 10 and Modular Arithmetic (CEESDGL1 and CEESIMOD) #include #include #include int main (void) { _FLOAT8 f1,result; _INT4 int1, int2, intr; _FEEDBACK fc; #define SUCCESS "\0\0\0\0" f1 = 1000.0; CEESDLG1(&f1,&fc,&result); if (memcmp(&fc,SUCCESS,4) != 0) { printf("CEESDLG1 failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("%f log base 10 is %f\n",f1,result); int1 = 39; int2 = 7; CEESIMOD(&int1,&int2,&fc,&intr); if (memcmp(&fc,SUCCESS,4) != 0) { printf("CEESIMOD failed with message number %d\n", fc.tok_msgno); exit(2999); } printf("%d modulo %d is %d\n",int1,int2,intr); } ═══ 4.4.2. COBOL/370 Math Service Examples ═══ The following are COBOL/370 examples. Log Base e (CEESSLOG) 77 ARG1RS COMP-1. 77 FBCODE PIC X(12). 77 RESLTRS COMP-1. CALL "CEESSLOG" USING ARG1RS , FBCODE , RESLTRS. Log Base 10 (CEESDLG1) 77 ARG1RL COMP-2. 77 FBCODE PIC X(12). 77 RESLTRL COMP-2. CALL "CEESDLG1" USING ARG1RL , FBCODE , RESLTRL. Exponentiation (CEESIXPI) 77 ARG1IS PIC S9(9) COMP. 77 ARG2IS PIC S9(9) COMP. 77 FBCODE PIC X(12). 77 RESLTIS PIC S9(9) COMP. CALL "CEESIXPI" USING ARG1IS , ARG2IS , FBCODE , RESLTIS. Exponentiation (CEESSXPI) 77 ARG1RS COMP-1. 77 ARG2IS PIC S9(9) COMP. 77 FBCODE PIC X(12). 77 RESLTRS COMP-1. CALL "CEESSXPI" USING ARG1RS , ARG2IS , FBCODE , RESLTRS. Arctangent2 (CEESSAT2) 77 ARG1RS COMP-1. 77 ARG2RS COMP-1. 77 FBCODE PIC X(12). 77 RESLTRS COMP-1. CALL "CEESSAT2" USING ARG1RS , ARG2RS , FBCODE , RESLTRS. ═══ 4.4.3. PL/I Math Service Examples ═══ The following are PL/I examples. Modular Arithmetic and Log Base e (CEESIMOD and CEESSLOG) PLIMATH: PROC OPTIONS(MAIN); DCL CEESSLOG ENTRY OPTIONS(ASM) EXTERNAL; DCL CEESIMOD ENTRY OPTIONS(ASM) EXTERNAL; DCL ARG1 RESULT REAL FLOAT DEC (6); DCL ARGM1 ARGM2 RES2 FLOAT BINARY(21) DCL FC CHARACTER (12); /* Call log base e routine, which has */ /* only one input parameter */ CALL CEESSLOG (ARG1, FC, RESULT) IF ( FC к= '000000000000000000000000'X ) THEN DO; PUT SKIP LIST ( 'Error occurred in call to CEESSLOG.' ); ELSE; /* Call modular arithmetic routine, */ /* which has two input parameters */ CALL CEESIMOD (ARGM1, ARGM2, FC, RES2); IF ( FC к= '000000000000000000000000'X ) THEN DO; PUT SKIP LIST ( 'Error occurred in call to CEESIMOD.' ); ELSE; END; Double-Precision Complex Tangent (CEESETAN) TRYETAN: PROCEDURE OPTIONS( MAIN ); DECLARE FC CHARACTER(12); DECLARE PARM1 COMPLEX FLOAT BINARY(53); DECLARE RESULT COMPLEX FLOAT BINARY(53); DECLARE CEESETAN ENTRY(COMPLEX FLOAT BINARY(53), *, COMPLEX FLOAT BINARY(53)) OPTIONS(ASSEMBLER) EXTERNAL; PARM1 = COMPLEX(7,1.1); CALL CEESETAN ( PARM1, FC, RESULT); IF ( FC к= '000000000000000000000000'X) THEN PUT SKIP LIST( 'Error in call to CEESETAN.'); ELSE PUT SKIP LIST( 'Result is ' || RESULT); END TRYETAN; ═══ 5. IBM-Supplied Country Code Defaults ═══ Defaults Currency and Picture Strings Based on COUNTRY Setting contains the currency symbols and default picture strings for the country_code parameters of the COUNTRY run-time option and the national language support callable services. See COUNTRY and the services listed in National Language Support Callable Services for more information. Note: In the table, some currency symbols are shown as X'9F404040'. How this is displayed differs; in the United States, it is shown as a '$' followed by three blanks. ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 20. Defaults Currency and Picture Strings Based on COUNTRY Setting │ ├─────────────────────┬──────────┬──────────┬──────────┬─────────────────────┬─────────────────────┤ │ COUNTRY │ COUNTRY │ DEFAULT │ DEFAULT │ DEFAULT CURRENCY │ DEFAULT DATE AND │ │ │ CODE │ DECIMAL │ THOU- │ SYMBOL │ TIME PICTURE STRING │ │ │ │ SEPA- │ SANDS │ │ │ │ │ │ RATOR │ SEPA- │ │ │ │ │ │ │ RATOR │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Afghanistan │ AF │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Albania │ AL │ , │ . │ Lek │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Algeria │ DZ │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Andorra │ AD │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Angola │ AO │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Antigua and Barbuda │ AG │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Argentina │ AR │ , │ . │ A. │ DD/MM/YY HH.MI.SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Armenia │ AM │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Australia │ AU │ . │ , │ $ │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Austria │ AT │ , │ . │ YYYY-MM-DD │ │ │ │ │ │ │ HH:MI:SS,999 │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Azerbaijan │ AZ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Bahamas │ BS │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Bahrain │ BH │ , │ . │ YYYY/MM/DD HH:MI:SS │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Bangladesh │ BD │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Barbados │ BB │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Belarus │ BY │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Belgium │ BE │ , │ . │ BF │ DD/MM/YY │ │ │ │ │ │ │ HH:MI:SS,999 │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Benin │ BJ │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Bermuda │ BM │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Bolivia │ BO │ , │ . │ BS │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Bosnia/ │ BA │ , │ . │ BHD (Dinar) │ DD.MM.YYYY HH:MI:SS │ │ Herzegovina │ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Botswana │ BW │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Brazil │ BR │ , │ . │ NCz$ │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Brunei Darussalam │ BN │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Bulgaria │ BG │ . │ , │ LV (Lev) │ DD.MM.YYYY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Burkina Faso (Upper │ BF │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ │ Volta) │ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Burma │ BU │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Canada │ CA │ . │ , │ $ │ YY-MM-DD │ │ │ │ │ │ │ HH:MI:SS.99 │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Cayman Islands │ KY │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Chad │ TD │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Chile │ CL │ , │ . │ $ │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Colombia │ CO │ , │ . │ $ │ DD/MM/YY ZH:MI:SS │ │ │ │ │ │ │ AP │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Costa Rica │ CR │ , │ . │ c/. │ DD/MM/YY ZH:MI:SS │ │ │ │ │ │ │ AP │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Croatia │ HR │ , │ . │ HRD (Dinar) │ DD.MM.YYYY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Cuba │ CU │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Cyprus │ CY │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Czech Republic │ CZ │ , │ . │ X'D247A240' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Czechoslovakia │ CS │ , │ . │ X'D247A240' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Denmark │ DK │ , │ . │ kr │ DD-MM-YY │ │ │ │ │ │ │ HH.MI.SS,99 │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Dominican Republic │ DO │ . │ , │ $ │ DD/MM/YY ZH:MI:SS │ │ │ │ │ │ │ AP │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Ecuador │ EC │ , │ . │ $ │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Egypt │ EG │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ └─────────────────────┴──────────┴──────────┴──────────┴─────────────────────┴─────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 20. Defaults Currency and Picture Strings Based on COUNTRY Setting │ ├─────────────────────┬──────────┬──────────┬──────────┬─────────────────────┬─────────────────────┤ │ COUNTRY │ COUNTRY │ DEFAULT │ DEFAULT │ DEFAULT CURRENCY │ DEFAULT DATE AND │ │ │ CODE │ DECIMAL │ THOU- │ SYMBOL │ TIME PICTURE STRING │ │ │ │ SEPA- │ SANDS │ │ │ │ │ │ RATOR │ SEPA- │ │ │ │ │ │ │ RATOR │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ El Salvador │ SV │ . │ , │ c/. │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Estonia │ EE │ , │ . │ │ DD mmm. YYYY g. │ │ │ │ │ │ │ HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Ethiopia │ ET │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Finland │ FI │ , │ │ Mk │ DD.MM.YYYY │ │ │ │ │ │ │ HH.MI.SS,99 │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ France │ FR │ , │ │ F │ DD.MM.YYYY │ │ │ │ │ │ │ HH:MI:SS,9 │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Gabon │ GA │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Gambia │ GM │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Georgia │ GE │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Germany │ DE │ , │ . │ DM │ DD.MM.YYYY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Ghana │ GH │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Greece │ GR │ , │ . │ Drs │ DD/MM/YY │ │ │ │ │ │ │ HH:MI:SS.999 │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Guatemala │ GT │ . │ , │ Q │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Guinea- │ GW │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ │ Bissau │ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Guyana │ GY │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Haiti │ HT │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Honduras │ HN │ . │ , │ L. │ DD/MM/YY ZH:MI:SS │ │ │ │ │ │ │ AP │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Hong Kong │ HK │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Hungary │ HU │ , │ │ FT │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Iceland │ IS │ , │ . │ kr │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ India │ IN │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Indonesia │ ID │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Iran │ IR │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Iraq │ IQ │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Ireland │ IE │ , │ , │ X'5B404040' │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Israel │ IL │ . │ , │ NIS │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Italy │ IT │ , │ . │ L. │ DD/MM/YY │ │ │ │ │ │ │ HH.MI.SS,999 │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Jamaica │ JM │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Japan │ JP │ . │ , │ X'5B404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Jordan │ JO │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Kazakhstan │ KZ │ , │ . │ Rub │ DD.MM.YYYY HH:MI:SE │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Kenya │ KE │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Korea, Republic of │ KR │ . │ , │ X'E0404040' │ YYYY.MM.DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Kuwait │ KW │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Kyrgyzstan │ KG │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Latvia │ LV │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Lebanon │ LB │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Lesotho │ LS │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Liberia │ LR │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Libya │ LY │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Liechtenstein │ LI │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Lithuania │ LT │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Luxembourg │ LU │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Macau │ MO │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Macedonia, Former │ MK │ , │ . │ DEN (Dinar) │ DD.MM.YYYY HH:MI:SS │ │ Yugoslav Republic │ │ │ │ │ │ │ of │ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Madagascar │ MG │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ └─────────────────────┴──────────┴──────────┴──────────┴─────────────────────┴─────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 20. Defaults Currency and Picture Strings Based on COUNTRY Setting │ ├─────────────────────┬──────────┬──────────┬──────────┬─────────────────────┬─────────────────────┤ │ COUNTRY │ COUNTRY │ DEFAULT │ DEFAULT │ DEFAULT CURRENCY │ DEFAULT DATE AND │ │ │ CODE │ DECIMAL │ THOU- │ SYMBOL │ TIME PICTURE STRING │ │ │ │ SEPA- │ SANDS │ │ │ │ │ │ RATOR │ SEPA- │ │ │ │ │ │ │ RATOR │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Malawi │ MW │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Malaysia │ MY │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Mali │ ML │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Mauritania │ MR │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Mauritius │ MU │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Mexico │ MX │ . │ , │ $ │ DD/MM/YY ZH:MI:SS │ │ │ │ │ │ │ AP │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Moldavia, Republic │ MD │ │ │ │ │ │ of │ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Monaco │ MC │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Morocco │ MA │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Mozambique │ MZ │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Namibia │ NA │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Netherlands │ NL │ , │ . │ F │ DD-MM-YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Netherlands │ AN │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ │ Antilles │ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ New Caledonia │ NC │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ New Zealand │ NZ │ . │ , │ $ │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Nicaragua │ NI │ . │ , │ X'9F404040' │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Niger │ NE │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Nigeria │ NG │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Norway │ NO │ , │ . │ kr │ DD.MM.YY │ │ │ │ │ │ │ HH:MI:SS,999 │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Oman │ OM │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Pakistan │ PK │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Panama │ PA │ . │ , │ B/ │ DD/MM/YY ZH:MI:SS │ │ │ │ │ │ │ AP │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Papua New Guinea │ PG │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Paraguay │ PY │ , │ . │ Gs. │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ People's Republic │ CN │ . │ , │ X'5B404040' │ YYYY.MM.DD HH:MI:SS │ │ of China │ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Peru │ PE │ . │ , │ I/. │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Philippines │ PH │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Poland │ PL │ , │ . │ X'E99A4040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Portugal │ PT │ , │ . │ Esc. │ DD-MM-YYYY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Puerto Rico │ PR │ . │ , │ $ │ DD/MM/YY ZH:MI:SS │ │ │ │ │ │ │ AP │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Qatar │ QA │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Republic of China │ TW │ . │ , │ $ │ YY/MM/DD │ │ │ │ │ │ │ HH:MI:SS.999 │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Romania │ RO │ , │ . │ Lei │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Russia │ RU │ , │ . │ RUB (Ruble) │ DD.MM.YYYY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Saint Lucia │ LC │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Saudi Arabia │ SA │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Senegal │ SN │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Seychelles │ SC │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Sierra Leone │ SL │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Singapore │ SG │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Slovakia │ SK │ , │ . │ X'D247A240' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Slovenia │ SI │ , │ . │ SIT (Tolar) │ DD.MM.YYYY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Somalia │ SO │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ South Africa │ ZA │ . │ │ R │ YYYY-MM-DD │ │ │ │ │ │ │ HHhMI:SS.999 │ └─────────────────────┴──────────┴──────────┴──────────┴─────────────────────┴─────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 20. Defaults Currency and Picture Strings Based on COUNTRY Setting │ ├─────────────────────┬──────────┬──────────┬──────────┬─────────────────────┬─────────────────────┤ │ COUNTRY │ COUNTRY │ DEFAULT │ DEFAULT │ DEFAULT CURRENCY │ DEFAULT DATE AND │ │ │ CODE │ DECIMAL │ THOU- │ SYMBOL │ TIME PICTURE STRING │ │ │ │ SEPA- │ SANDS │ │ │ │ │ │ RATOR │ SEPA- │ │ │ │ │ │ │ RATOR │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ South Georgia and │ GS │ │ │ │ │ │ the S.S.I. │ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Spain │ ES │ , │ . │ Pts │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Sri Lanka │ LK │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Sudan │ SD │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Surinam │ SR │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Swaziland │ SZ │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Sweden │ SE │ , │ . │ kr │ YYYY-MM-DD kl │ │ │ │ │ │ │ HH.MI.SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Switzerland │ CH │ , │ . │ Fr │ DD. Mmmmmmmmz YYYY │ │ │ │ │ │ │ HH,MI,SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Syria │ SY │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Tajikistan │ TJ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Tanzania │ TZ │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Thailand │ TH │ . │ , │ X'70404040' │ DD/MM/YYYY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Togo │ TG │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Tunisia │ TN │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Turkey │ TR │ , │ . │ TL │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Turkmenistan │ TM │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Uganda │ UG │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Ukraine │ UA │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Union of Soviet │ SU │ , │ . │ Rub │ DD mmm. YYYY g. │ │ Socialist Republics │ │ │ │ │ HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ United Arab │ AE │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ │ Emirates │ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ United Kingdom │ GB │ . │ , │ X'5B404040' │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ United States │ US │ . │ , │ $ │ MM/DD/YY ZH:MI:SS │ │ │ │ │ │ │ AP │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Uruguay │ UY │ , │ . │ N$ │ DD/MM/YY HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Uzbekistan │ UZ │ │ │ │ │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Vanuatu │ VU │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Venezuela │ VE │ , │ . │ Bs. │ DD/MM/YY ZH:MI:SS │ │ │ │ │ │ │ AP │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Western Samoa │ WS │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Yemen │ YE │ , │ . │ │ YYYY/MM/DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Yugoslavia │ YU │ , │ . │ Din │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Zaire │ ZR │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Zambia │ ZM │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ ├─────────────────────┼──────────┼──────────┼──────────┼─────────────────────┼─────────────────────┤ │ Zimbabwe │ ZW │ , │ . │ X'9F404040' │ YYYY-MM-DD HH:MI:SS │ └─────────────────────┴──────────┴──────────┴──────────┴─────────────────────┴─────────────────────┘ 1. The Czechoslovakia country code CS is obsolete: use either the Czech Republic country code CZ, or the Slovakia country code SK. 2. Country code DE was used for the former Federal Republic of Germany. 3. The SU country code is obsolete. Use the following country codes for the appropriate country: Armenia, AM; Azerbaijan, AZ; Belarus, BY; Estonia, EE; Georgia, GE; Kazakhstan, KZ; Kyrgyzstan, KG; Latvia, LV; Lithuania, LT; Moldavia, MD; Russian Federation, RU; Tajikistan, TJ; Turkmenistan, TM; Ukraine, UA; Uzbekistan, UZ; ═══ 6. Date and Time Services Tables ═══ This appendix contains information to help you use LE/370 date and time callable services. Included are tables for picture term and national language era usage. ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 21. Picture Terms Used in Picture Strings │ ├─────────────┬─────────────────┬─────────────────────┬───────────────────────────────────────────────────────────────────────┤ │ PICTURE │ │ │ │ │ TERMS │ EXPLANATION │ VALID VALUES │ NOTES │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "Y" │ 1-digit year │ 0-9 │ "Y" valid for output only. │ │ "YY" │ 2-digit year │ 00-99 │ "YY" assumes range set by CEESCEN. │ │ "YYY" │ 3-digit year │ 000-999 │ "YYY/ZYY" used with ", " and "". │ │ "ZYY" │ 3-digit year │ 1-999 │ │ │ "YYYY" │ within era │ 1582-9999 │ │ │ │ 4-digit year │ │ │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "" │ Japanese era │ see below │ Affects "YY" field: if "" specified, "YY" means the year │ │ │ name in DBCS │ │ within Japanese era, for example, 1988 equals Showa 63. │ │ │ characters │ │ │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "" │ Republic of │ see below │ Affects "YY" field: if "" specified, "YY" means the year │ │ ""│ China (ROC) era │ │ within ROC era, for example, 1988 equals Minkow 77. │ │ │ name in DBCS │ │ │ │ │ characters │ │ │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "MM" │ 2-digit month │ 01-12 │ │ │ "ZM" │ 1- or 2-digit │ 1-12 │ For output, leading zero suppressed. For input, "ZM" treated as │ │ │ month │ │ "MM". │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "RRRR" │ Roman numeral │ Ibbb-XIIb (Left │ For input, source string is folded to uppercase. For output, upper- │ │ "RRRZ" │ month │ justified) │ case only. I=Jan, II=Feb, ..., XII=Dec. │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "MMM" │ 3-char month, │ JAN-DEC │ For input, source string always folded to uppercase. For output, "M" │ │ "Mmm" │ uppercase │ Jan-Dec │ generates uppercase and "m" generates lowercase. Output is padded │ │ "MMMM...M" │ 3-char month, │ JANUARYbb-DECEMBERb │ with blanks (b) (unless "Z" specified) or truncated to match the │ │ "Mmmm...m" │ mixed case │ Januarybb-Decemberb │ number of "M"s, up to 20. │ │ "MMMMMMMMMZ"│ 3-20 char mo., │ JANUARY-DECEMBER │ │ │ "Mmmmmmmmmz"│ uppercase │ January-December │ │ │ │ 3-20 char mo., │ │ │ │ │ mixed case │ │ │ │ │ trailing blanks │ │ │ │ │ suppressed │ │ │ │ │ trailing blanks │ │ │ │ │ suppressed │ │ │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "DD" │ 2-digit day of │ 01-31 │ For output, leading zero is always suppressed. For input, "ZD" │ │ "ZD" │ month │ 1-31 │ treated as "DD". │ │ "DDD" │ 1- or 2-digit │ 001-366 │ │ │ │ day of mo. │ │ │ │ │ day of year │ │ │ │ │ (Julian day) │ │ │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "HH" │ 2-digit hour │ 00-23 │ │ │ "ZH" │ 1- or 2-digit │ 0-23 │ For output, leading zero suppressed. For input, "ZH" treated as │ │ │ hour │ │ "HH". If "AP" specified, valid values are 01-12. │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "MI" │ minute │ 00-59 │ │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "SS" │ second │ 00-59 │ │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "9" │ tenths of a │ 0-9 │ No rounding. │ │ "99" │ second │ 00-99 │ │ │ "999" │ hundredths of a │ 000-999 │ │ │ │ second │ │ │ │ │ thousandths of │ │ │ │ │ a second │ │ │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "AP" │ AM/PM indicator │ AM or PM │ "AP" affects "HH"/"ZH" field. For input, source string always folded │ │ "ap" │ │ am or pm │ to uppercase. For output, "AP" generates uppercase and "ap" gener- │ │ "A.P." │ │ A.M. or P.M. │ ates lowercase. │ │ "a.p." │ │ a.m. or p.m. │ │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ "W" │ 1-char day-of- │ S, M, T, W, T, F, S │ For input, "W"s are ignored. For output, "W" generates uppercase and │ │ "WWW" │ week │ SUN-SAT │ "w" generates lowercase. Output padded with blanks (unless "Z" spec- │ │ "Www" │ 3-char day, │ Sun-Sat │ ified) or truncated to match the number of "W"s, up to 20. │ │ "WWW...W" │ uppercase │ SUNDAYbbb-SATURDAYb │ │ │ "Www...w" │ 3-char day, │ Sundaybbb-Saturdayb │ │ │ " WWWWWWWWWZ"│ mixed case │ SUNDAY-SATURDAY │ │ │ "Wwwwwwwwwz"│ 3-20 char day, │ Sunday-Saturday │ │ │ │ uppercase │ │ │ │ │ 3-20 char day, │ │ │ │ │ mixed case │ │ │ │ │ trailing blanks │ │ │ │ │ suppressed │ │ │ │ │ trailing blanks │ │ │ │ │ suppressed │ │ │ ├─────────────┼─────────────────┼─────────────────────┼───────────────────────────────────────────────────────────────────────┤ │ All others │ delimiters │ X'01'-X'FF' │ For input, treated as delimiters between the month, day, year, hour, │ │ │ │ (X'00' reserved for │ minute, second, and fraction of a second. For output, copied exactly │ │ │ │ LE/370 use) │ as is to the target string. │ └─────────────┴─────────────────┴─────────────────────┴───────────────────────────────────────────────────────────────────────┘ Japanese era names in DBCS characters are as follows:  Heisei valid value is (X'0E458D45BA0F')  Showa valid value is (X'0E45B3457A0F')  Taisho valid value is (X'0E455B45770F')  Meiji valid value is (X'0E45A645840F') Republic of China (ROC) era names in DBCS characters are as follows:  MinKow valid value is (X'0E4D8256CE0F')  ChuHwaMinKow valid value is (X'0E4C845ADD4D8256CE0F') ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Table 22. Examples of Picture Terms Recognized by Date/Time Services │ ├──────────────────────────┬─────────────────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────┤ │ PICTURE TERMS │ EXAMPLE │ NOTES │ ├──────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤ │ "YYMMDD" │ 880516 │ │ │ "YYYYMMDD" │ 19880516 │ │ │ "YYYY-MM-DD" │ 1988-05-16 │ 1988-5-16 would also be valid input. │ │ " YY.MM.DD" │ Showa 63.05.16 │ Showa is a Japanese Era name. Showa 63 equals 1988. │ │ │ │ MinKow is an ROC Era name. MinKow 77 equals 1988. │ │ " YY.MM.DD" │ MinKow 77.05.16 │ │ ├──────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤ │ "MMDDYY" │ 050688 │ │ │ "MM/DD/YY" │ 05/06/88 │ │ │ "ZM/ZD/YY" │ 5/6/88 │ │ │ "MM/DD/YYYY" │ 05/06/1988 │ │ │ "MM/DD/Y" │ 05/06/8 │ 1-digit year format ("Y") valid for output only │ ├──────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤ │ "DD.MM.YY" │ 09.06.88 │ │ │ "DD-RRRR-YY" │ 09-VI -88 │ │ │ "DD MMM YY" │ 09 JUN 88 │ │ │ "DD Mmmmmmmmmm YY" │ 09 June 88 │ │ │ "ZD Mmmmmmmmmz YY" │ 9 June 88 │ "Z" suppresses zeros/blanks │ │ "Mmmmmmmmmz ZD, YYYY" │ June 9, 1988 │ │ │ "ZDMMMMMMMMzYY" │ 9JUNE88 │ │ ├──────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤ │ "YY.DDD" │ 88.137 │ Julian date │ │ "YYDDD" │ 88137 │ │ │ "YYYY/DDD" │ 1988/137 │ │ ├──────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤ │ "YYMMDDHHMISS" │ 880516204229 │ Timestamp-valid only for CEESECS and CEEDATM. If used with CEEDATE, time positions are left │ │ "YYYYMMDDHHMISS" │ 19880516204229 │ blank. If used with CEEDAYS, "HH", "MI", "SS", and "999" fields are ignored. │ │ "YYYY-MM-DD │ 1988-05-16 20:42:29.046 │ │ │ HH:MI:SS.999" │ MON, 5/16/88 08:42 PM │ │ │ "WWW, ZM/ZD/YY HH:MI AP" │ Monday, 16 May 1988, 8:42 PM │ │ │ "Wwwwwwwwwz, DD Mmm │ │ │ │ YYYY, ZH:MI AP" │ │ │ ├──────────────────────────┴─────────────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────┤ │ NOTE: Lowercase characters must be used only for alphabetic picture terms. │ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────┐ │ Table 23. Japanese Eras Used by Date/Time Services when Specified │ ├─────────────────┬──────────┬──────────────────────────┬──────────────────────┤ │ FIRST DATE OF │ ERA │ ERA NAME IN IBM JAPANESE │ │ │ JAPANESE ERA │ NAME │ DBCS CODE │ VALID YEAR VALUES │ ├─────────────────┼──────────┼──────────────────────────┼──────────────────────┤ │ 1868-09-08 │ Meiji │ "X'0E45A645840F'" │ 01-45 │ ├─────────────────┼──────────┼──────────────────────────┼──────────────────────┤ │ 1912-07-30 │ Taisho │ "X'0E455B45770F'" │ 01-15 │ ├─────────────────┼──────────┼──────────────────────────┼──────────────────────┤ │ 1926-12-25 │ Showa │ "X'0E45B3457A0F'" │ 01-64 │ ├─────────────────┼──────────┼──────────────────────────┼──────────────────────┤ │ 1989-01-08 │ Heisei │ "X'0E458D45BA0F'" │ 01-999 (01 = 1989) │ │ │ │ │ │ └─────────────────┴──────────┴──────────────────────────┴──────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────┐ │ Table 24. Republic of China Eras Used by Date/Time Services when or │ │ Specified │ ├───────────────┬──────────────┬──────────────────────────┬────────────────────┤ │ FIRST DATE OF │ │ ERA NAME IN TRADITIONAL │ │ │ ROC ERA │ ERA NAME │ CHINESE │ VALID YEAR (YY, │ │ │ │ DBCS CODE │ ZYY) VALUES │ ├───────────────┼──────────────┼──────────────────────────┼────────────────────┤ │ 1912-01-01 │ MinKow │ "X'0E4D8256CE0F'" │ 01-999 (77 equals │ │ │ │ │ 1988) │ ├───────────────┼──────────────┼──────────────────────────┼────────────────────┤ │ │ ChuHwaMinKow │ "X'0E4C845ADD4D8256CE0F'"│ │ │ │ │ │ │ └───────────────┴──────────────┴──────────────────────────┴────────────────────┘ ═══ ═══ This parameter type is comprised of a 32-bit real part and a 32-bit imaginary part. ═══ ═══ This parameter type is comprised of a 64-bit real part and a 64-bit imaginary part. ═══ ═══ This parameter type is comprised of a 128-bit real part and a 128-bit imaginary part. ═══ ═══ For functions of complex variables, the image of the input is generally a non-rectangular shape. For this reason,