?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Statistics Facility: Test Harness' ??

MODULE sfm$test_harness;

{ PURPOSE:
{  This module contains the test harness for the NOS/VE statistics facility.

?? NEWTITLE := 'Global declarations referenced by this module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc clt$path_display_chunks
*copyc clt$when_conditions
*copyc ift$condition_codes
*copyc jmt$job_control_block
*copyc jmt$job_statistics
*copyc lgt$log_read_activity
*copyc oss$job_pageable
*copyc oss$mainframe_pageable
*copyc oss$mainframe_paged_literal
*copyc ost$global_task_id
*copyc ost$heap
*copyc ost$status
*copyc ost$system_flag
*copyc ost$user_identification
*copyc pmd$system_log_interface
*copyc pmt$signal
*copyc sfc$unlimited
*copyc sft$file_space_limit_kind
?? POP ??
*copyc amp$close
*copyc amp$get_segment_pointer
*copyc amp$open
*copyc amp$put_next
*copyc amp$return
*copyc clp$begin_utility
*copyc clp$build_standard_title
*copyc clp$close_display
*copyc clp$convert_integer_to_string
*copyc clp$count_list_elements
*copyc clp$end_include
*copyc clp$end_utility
*copyc clp$evaluate_parameters
*copyc clp$get_set_count
*copyc clp$get_value
*copyc clp$include_file
*copyc clp$new_display_line
*copyc clp$open_display_reference
*copyc clp$put_display
*copyc clp$reset_for_next_display_page
*copyc clp$scan_parameter_list
*copyc clp$test_parameter
*copyc clp$trimmed_string_size
*copyc fsp$close_file
*copyc fsp$open_file
*copyc jmp$default_job_resource_hndlr
*copyc osp$set_status_abnormal
*copyc pmp$generate_unique_name
*copyc pmp$get_executing_task_gtid
*copyc pmp$get_task_cp_time
*copyc pmp$get_task_id
*copyc pmp$log
*copyc sfp$convert_stat_code_to_name
*copyc sfp$convert_stat_name_to_code
*copyc sfp$create_job_limit
*copyc sfp$emit_statistic
*copyc sfp$init_job_routing_control
*copyc sfp$init_system_routing_control
?? OLDTITLE ??
?? NEWTITLE := 'Global declarations declared by this module.', EJECT ??

  CONST
    test_harness_name = 'SF_TEST_HARNESS                ',
    test_harness_prompt = 'SFTH';

  VAR
    avv$accumulated_srus: [XDCL] sft$counter := 0,
    avv$monitor_statistics_lock: [XDCL] ost$signature_lock,
    clv$value_descriptors: [XDCL] array [clc$variable_reference .. clc$status_value] of string (8) :=
          ['VARIABLE', 'FILE', 'NAME', 'STRING', 'REAL', 'INTEGER', 'BOOLEAN', 'STATUS'],
    family_administrator: boolean,
    ignored_status: ost$status,
    jmv$jcb: [XDCL] jmt$job_control_block,
    job_pageable_file_id: amt$file_identifier,
    lgv$log_names: [XDCL] array [pmt$logs] of ost$name := ['$TEST_JOB_ACCOUNT_LOG', '$TEST_JOB_STATISTIC_LOG',
          '$TEST_ACCOUNT_LOG', '$TEST_ENGINEERING_LOG', '$TEST_HISTORY_LOG', '$TEST_SECURITY_LOG',
          '$TEST_STATISTIC_LOG', '$TEST_SYSTEM_LOG', '$TEST_JOB_LOG'],
    mainframe_pageable_file_id: amt$file_identifier,
    osv$job_pageable_heap: [XDCL] ^ost$heap := NIL,
    osv$mainframe_pageable_heap: [XDCL] ^ost$heap := NIL,
    system_administrator: boolean,
    system_error_encountered: boolean;

*copyc sfv$job_routing_control_table
?? OLDTITLE ??
?? NEWTITLE := 'sfp$test_harness', EJECT ??

  PROCEDURE [XDCL, #GATE] sfp$test_harness
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE sf_test_harness (
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 1] of clt$pdt_parameter_name,
        parameters: array [1 .. 1] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 10, 27, 14, 24, 25, 279], clc$command, 1, 1, 0, 0, 0, 0, 1, 'SF_TEST_HARNESS'],
            [['STATUS                         ', clc$nominal_entry, 1]], [

{ PARAMETER 1

      [1, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods [clc$specify_by_name],
            clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
            clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$status = 1;

    VAR
      pvt: array [1 .. 1] of clt$parameter_value;

{ table commands
{ command (activate_job_statistic, activate_job_statistics, actjs) sfp$_activate_job_statistic xref
{ command (activate_system_statistic, activate_system_statistics, actss) sfp$activate_sys_stat_command xref
{ command (change_administrator_status, chaas) sfp$_change_administrator_statu local
{ command (change_job_limit, chajl) sfp$_change_job_limit xref
{ command (create_job_limit, crejl) sfp$_create_job_limit local
{ command (deactivate_job_statistic, deactivate_job_statistics, deajs) sfp$_deactivate_job_statistic xref
{ command (deactivate_system_statistic, deactivate_system_statistics, deass)             ..
{   sfp$deactivate_sys_stat_command     xref
{ command (display_active_job_statistic, display_active_job_statistics, disajs)                 ..
{   sfp$_display_active_job_statist xref
{ command (display_active_system_statistic, disass) sfp$_display_active_system_stat xref
{ command (display_administrator_status, disas) sfp$_display_administrator_stat local
{ command (display_job_limit, display_job_limits, disjl) sfp$_display_job_limit xref
{ command (emit_statistic, emis) sfp$_emit_statistic local
{ command (quit, qui) sfp$_quit local
{ command (set_job_limit, set_job_limits, setjl) sfp$_set_job_limit xref
{ tablend

?? PUSH (LISTEXT := ON) ??

VAR
  commands: [STATIC, READ] ^clt$command_table := ^commands_entries,

  commands_entries: [STATIC, READ] array [1 .. 35] of clt$command_table_entry := [
  {} ['ACTIVATE_JOB_STATISTIC         ', clc$nominal_entry, clc$normal_usage_entry, 1,
        clc$automatically_log, clc$linked_call, ^sfp$_activate_job_statistic],
  {} ['ACTIVATE_JOB_STATISTICS        ', clc$alias_entry, clc$normal_usage_entry, 1,
        clc$automatically_log, clc$linked_call, ^sfp$_activate_job_statistic],
  {} ['ACTIVATE_SYSTEM_STATISTIC      ', clc$nominal_entry, clc$normal_usage_entry, 2,
        clc$automatically_log, clc$linked_call, ^sfp$activate_sys_stat_command],
  {} ['ACTIVATE_SYSTEM_STATISTICS     ', clc$alias_entry, clc$normal_usage_entry, 2,
        clc$automatically_log, clc$linked_call, ^sfp$activate_sys_stat_command],
  {} ['ACTJS                          ', clc$abbreviation_entry, clc$normal_usage_entry, 1,
        clc$automatically_log, clc$linked_call, ^sfp$_activate_job_statistic],
  {} ['ACTSS                          ', clc$abbreviation_entry, clc$normal_usage_entry, 2,
        clc$automatically_log, clc$linked_call, ^sfp$activate_sys_stat_command],
  {} ['CHAAS                          ', clc$abbreviation_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^sfp$_change_administrator_statu],
  {} ['CHAJL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^sfp$_change_job_limit],
  {} ['CHANGE_ADMINISTRATOR_STATUS    ', clc$nominal_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^sfp$_change_administrator_statu],
  {} ['CHANGE_JOB_LIMIT               ', clc$nominal_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^sfp$_change_job_limit],
  {} ['CREATE_JOB_LIMIT               ', clc$nominal_entry, clc$normal_usage_entry, 5,
        clc$automatically_log, clc$linked_call, ^sfp$_create_job_limit],
  {} ['CREJL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 5,
        clc$automatically_log, clc$linked_call, ^sfp$_create_job_limit],
  {} ['DEACTIVATE_JOB_STATISTIC       ', clc$nominal_entry, clc$normal_usage_entry, 6,
        clc$automatically_log, clc$linked_call, ^sfp$_deactivate_job_statistic],
  {} ['DEACTIVATE_JOB_STATISTICS      ', clc$alias_entry, clc$normal_usage_entry, 6,
        clc$automatically_log, clc$linked_call, ^sfp$_deactivate_job_statistic],
  {} ['DEACTIVATE_SYSTEM_STATISTIC    ', clc$nominal_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^sfp$deactivate_sys_stat_command],
  {} ['DEACTIVATE_SYSTEM_STATISTICS   ', clc$alias_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^sfp$deactivate_sys_stat_command],
  {} ['DEAJS                          ', clc$abbreviation_entry, clc$normal_usage_entry, 6,
        clc$automatically_log, clc$linked_call, ^sfp$_deactivate_job_statistic],
  {} ['DEASS                          ', clc$abbreviation_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^sfp$deactivate_sys_stat_command],
  {} ['DISAJS                         ', clc$abbreviation_entry, clc$normal_usage_entry, 8,
        clc$automatically_log, clc$linked_call, ^sfp$_display_active_job_statist],
  {} ['DISAS                          ', clc$abbreviation_entry, clc$normal_usage_entry, 10,
        clc$automatically_log, clc$linked_call, ^sfp$_display_administrator_stat],
  {} ['DISASS                         ', clc$abbreviation_entry, clc$normal_usage_entry, 9,
        clc$automatically_log, clc$linked_call, ^sfp$_display_active_system_stat],
  {} ['DISJL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^sfp$_display_job_limit],
  {} ['DISPLAY_ACTIVE_JOB_STATISTIC   ', clc$nominal_entry, clc$normal_usage_entry, 8,
        clc$automatically_log, clc$linked_call, ^sfp$_display_active_job_statist],
  {} ['DISPLAY_ACTIVE_JOB_STATISTICS  ', clc$alias_entry, clc$normal_usage_entry, 8,
        clc$automatically_log, clc$linked_call, ^sfp$_display_active_job_statist],
  {} ['DISPLAY_ACTIVE_SYSTEM_STATISTIC', clc$nominal_entry, clc$normal_usage_entry, 9,
        clc$automatically_log, clc$linked_call, ^sfp$_display_active_system_stat],
  {} ['DISPLAY_ADMINISTRATOR_STATUS   ', clc$nominal_entry, clc$normal_usage_entry, 10,
        clc$automatically_log, clc$linked_call, ^sfp$_display_administrator_stat],
  {} ['DISPLAY_JOB_LIMIT              ', clc$nominal_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^sfp$_display_job_limit],
  {} ['DISPLAY_JOB_LIMITS             ', clc$alias_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^sfp$_display_job_limit],
  {} ['EMIS                           ', clc$abbreviation_entry, clc$normal_usage_entry, 12,
        clc$automatically_log, clc$linked_call, ^sfp$_emit_statistic],
  {} ['EMIT_STATISTIC                 ', clc$nominal_entry, clc$normal_usage_entry, 12,
        clc$automatically_log, clc$linked_call, ^sfp$_emit_statistic],
  {} ['QUI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 13,
        clc$automatically_log, clc$linked_call, ^sfp$_quit],
  {} ['QUIT                           ', clc$nominal_entry, clc$normal_usage_entry, 13,
        clc$automatically_log, clc$linked_call, ^sfp$_quit],
  {} ['SETJL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 14,
        clc$automatically_log, clc$linked_call, ^sfp$_set_job_limit],
  {} ['SET_JOB_LIMIT                  ', clc$nominal_entry, clc$normal_usage_entry, 14,
        clc$automatically_log, clc$linked_call, ^sfp$_set_job_limit],
  {} ['SET_JOB_LIMITS                 ', clc$alias_entry, clc$normal_usage_entry, 14,
        clc$automatically_log, clc$linked_call, ^sfp$_set_job_limit]];

  PROCEDURE [XREF] sfp$activate_sys_stat_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] sfp$deactivate_sys_stat_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] sfp$_activate_job_statistic
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] sfp$_change_job_limit
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] sfp$_deactivate_job_statistic
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] sfp$_display_active_job_statist
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] sfp$_display_active_system_stat
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] sfp$_display_job_limit
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] sfp$_set_job_limit
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

?? POP ??

{ table functions type=function
{ function ($job_limit) sfp$$job_limit xref
{ tablend

?? PUSH (LISTEXT := ON) ??

VAR
  functions: [STATIC, READ] ^clt$function_processor_table := ^functions_entries,

  functions_entries: [STATIC, READ] array [1 .. 1] of clt$function_proc_table_entry := [
  {} ['$JOB_LIMIT                     ', clc$nominal_entry, clc$normal_usage_entry, 1, clc$linked_call,
         ^sfp$$job_limit]];

  PROCEDURE [XREF] sfp$$job_limit
    (    parameter_list: clt$parameter_list;
     VAR work_area {input, output} : ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

?? POP ??

    VAR
      binary_log: pmt$logs,
      ignore_status: ost$status,
      utility_attributes: ^clt$utility_attributes;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ Delete the local files used to hold the test harness versions of the logs.

    FOR binary_log := pmc$job_account_log TO pmc$job_log DO
      amp$return (lgv$log_names [binary_log], ignore_status);
    FOREND;

{ Create the fake system heaps used by the test harness.

    create_heap (osv$job_pageable_heap, job_pageable_file_id, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    create_heap (osv$mainframe_pageable_heap, mainframe_pageable_file_id, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ Initialize the administrator variables.

    family_administrator := FALSE;
    system_administrator := TRUE;
    system_error_encountered := FALSE;

    RESET osv$job_pageable_heap^;

{ Initialize the fake system routing control table.

    sfp$init_system_routing_control (status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ Initialize the fake job routing control table.

    sfp$init_job_routing_control (status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ Initialize the fake limit chain (no limits are automatically created).

    sfv$job_limit_count := 0;

{ Start up the test harness utility.

    PUSH utility_attributes: [1 .. 3];
    utility_attributes^ [1].key := clc$utility_prompt;
    utility_attributes^ [1].prompt.value := test_harness_prompt;
    utility_attributes^ [1].prompt.size := clp$trimmed_string_size (utility_attributes^ [1].prompt.value);
    utility_attributes^ [2].key := clc$utility_command_table;
    utility_attributes^ [2].command_table := commands;
    utility_attributes^ [3].key := clc$utility_function_proc_table;
    utility_attributes^ [3].function_processor_table := functions;
    clp$begin_utility (test_harness_name, utility_attributes^, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$include_file (clc$current_command_input, '', test_harness_name, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ Exit the utility.

    clp$end_utility (test_harness_name, ignored_status);

{ Close the fake operating system heaps.

    amp$close (job_pageable_file_id, ignored_status);
    amp$close (mainframe_pageable_file_id, ignored_status);

{ Report if a system error occured.

    IF system_error_encountered THEN
      osp$set_status_abnormal ('SF', 0, 'A system error was encountered during the test harness execution.',
            status);
    IFEND;

  PROCEND sfp$test_harness;
?? OLDTITLE ??
?? NEWTITLE := 'Test Harness Subcommand Processors' ??
?? NEWTITLE := 'sfp$_change_administrator_statu', EJECT ??

  PROCEDURE sfp$_change_administrator_statu
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE change_administrator_status, chaas (
{   administrator_status, as: key
{       (system_administrator, sa)
{       (family_administrator, fa)
{       none
{     keyend = family_administrator
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 3] of clt$pdt_parameter_name,
        parameters: array [1 .. 2] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 5] of clt$keyword_specification,
          default_value: string (20),
        recend,
        type2: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 10, 27, 15, 6, 44, 229], clc$command, 3, 2, 0, 0, 0, 0, 2,
            'CHANGE_ADMINISTRATOR_STATUS'], [['ADMINISTRATOR_STATUS           ', clc$nominal_entry, 1],
            ['AS                             ', clc$abbreviation_entry, 1],
            ['STATUS                         ', clc$nominal_entry, 2]], [

{ PARAMETER 1

      [1, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 192, clc$optional_default_parameter, 0, 20],

{ PARAMETER 2

      [3, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods [clc$specify_by_name],
            clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
            clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$keyword_type], [5], [['FA                             ', clc$abbreviation_entry,
            clc$normal_usage_entry, 2], ['FAMILY_ADMINISTRATOR           ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['NONE                           ', clc$nominal_entry,
            clc$normal_usage_entry, 3], ['SA                             ', clc$abbreviation_entry,
            clc$normal_usage_entry, 1], ['SYSTEM_ADMINISTRATOR           ', clc$nominal_entry,
            clc$normal_usage_entry, 1]], 'family_administrator'],

{ PARAMETER 2

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$administrator_status = 1,
      p$status = 2;

    VAR
      pvt: array [1 .. 2] of clt$parameter_value;

    VAR
      value: clt$value;

    status.normal := TRUE;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    IF pvt [p$administrator_status].value^.keyword_value = 'SYSTEM_ADMINISTRATOR' THEN
      family_administrator := FALSE;
      system_administrator := TRUE;
    ELSEIF pvt [p$administrator_status].value^.keyword_value = 'FAMILY_ADMINISTRATOR' THEN
      family_administrator := TRUE;
      system_administrator := FALSE;
    ELSE { NONE }
      family_administrator := FALSE;
      system_administrator := FALSE;
    IFEND;

  PROCEND sfp$_change_administrator_statu;
?? OLDTITLE ??
?? NEWTITLE := 'sfp$_create_job_limit', EJECT ??

  PROCEDURE sfp$_create_job_limit
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE create_job_limit, crejl (
{   limit_name, ln: name = $required
{   statistic_codes, sc: list of statistic_code = $optional
{   initial_value, iv: integer = 0
{   job_warning_limit, jwl: any of
{       integer 0..clc$max_integer
{       key
{         unlimited
{       keyend
{     anyend = unlimited
{   job_maximum_limit, jmaxl: any of
{       integer 0..clc$max_integer
{       key
{         unlimited
{       keyend
{     anyend = unlimited
{   enforcement, e: key
{       (accumulation, a)
{       (other, o)
{     keyend = accumulation
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 13] of clt$pdt_parameter_name,
        parameters: array [1 .. 7] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        type2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
          recend,
        recend,
        type3: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
          default_value: string (1),
        recend,
        type4: record
          header: clt$type_specification_header,
          qualifier: clt$union_type_qualifier,
          type_size_1: clt$type_specification_size,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 1] of clt$keyword_specification,
          recend,
          default_value: string (9),
        recend,
        type5: record
          header: clt$type_specification_header,
          qualifier: clt$union_type_qualifier,
          type_size_1: clt$type_specification_size,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
          type_size_2: clt$type_specification_size,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 1] of clt$keyword_specification,
          recend,
          default_value: string (9),
        recend,
        type6: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 4] of clt$keyword_specification,
          default_value: string (12),
        recend,
        type7: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 10, 28, 8, 42, 23, 161], clc$command, 13, 7, 1, 0, 0, 0, 7, 'CREJL'],
            [['E                              ', clc$abbreviation_entry, 6],
            ['ENFORCEMENT                    ', clc$nominal_entry, 6],
            ['INITIAL_VALUE                  ', clc$nominal_entry, 3],
            ['IV                             ', clc$abbreviation_entry, 3],
            ['JMAXL                          ', clc$abbreviation_entry, 5],
            ['JOB_MAXIMUM_LIMIT              ', clc$nominal_entry, 5],
            ['JOB_WARNING_LIMIT              ', clc$nominal_entry, 4],
            ['JWL                            ', clc$abbreviation_entry, 4],
            ['LIMIT_NAME                     ', clc$nominal_entry, 1],
            ['LN                             ', clc$abbreviation_entry, 1],
            ['SC                             ', clc$abbreviation_entry, 2],
            ['STATISTIC_CODES                ', clc$nominal_entry, 2],
            ['STATUS                         ', clc$nominal_entry, 7]], [

{ PARAMETER 1

      [9, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 5, clc$required_parameter, 0, 0],

{ PARAMETER 2

      [12, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 19, clc$optional_parameter, 0, 0],

{ PARAMETER 3

      [3, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 20, clc$optional_default_parameter, 0, 1],

{ PARAMETER 4

      [7, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 84, clc$optional_default_parameter, 0, 9],

{ PARAMETER 5

      [6, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 84, clc$optional_default_parameter, 0, 9],

{ PARAMETER 6

      [2, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 155, clc$optional_default_parameter, 0, 12],

{ PARAMETER 7

      [13, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name], clc$pass_by_reference, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$name_type], [1, osc$max_name_size]],

{ PARAMETER 2

      [[1, 0, clc$list_type], [3, 1, clc$max_list_size, FALSE], [[1, 0, clc$statistic_code_type]]],

{ PARAMETER 3

      [[1, 0, clc$integer_type], [clc$min_integer, clc$max_integer, 10], '0'],

{ PARAMETER 4

      [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type], FALSE, 2], 20,
            [[1, 0, clc$integer_type], [0, clc$max_integer, 10]], 44,
            [[1, 0, clc$keyword_type], [1], [['UNLIMITED                      ', clc$nominal_entry,
            clc$normal_usage_entry, 1]]], 'unlimited'],

{ PARAMETER 5

      [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type], FALSE, 2], 20,
            [[1, 0, clc$integer_type], [0, clc$max_integer, 10]], 44,
            [[1, 0, clc$keyword_type], [1], [['UNLIMITED                      ', clc$nominal_entry,
            clc$normal_usage_entry, 1]]], 'unlimited'],

{ PARAMETER 6

      [[1, 0, clc$keyword_type], [4], [['A                              ', clc$abbreviation_entry,
            clc$normal_usage_entry, 1], ['ACCUMULATION                   ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['O                              ', clc$abbreviation_entry,
            clc$normal_usage_entry, 2], ['OTHER                          ', clc$nominal_entry,
            clc$normal_usage_entry, 2]], 'accumulation'],

{ PARAMETER 7

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$limit_name = 1,
      p$statistic_codes = 2,
      p$initial_value = 3,
      p$job_warning_limit = 4,
      p$job_maximum_limit = 5,
      p$enforcement = 6,
      p$status = 7;

    VAR
      pvt: array [1 .. 7] of clt$parameter_value;

    VAR
      current_parameter_value: ^clt$data_value,
      enforcement: sft$enforcement,
      index: integer,
      initial_value: sft$counter,
      job_maximum_limit: sft$counter,
      job_warning_limit: sft$counter,
      limit_name: ost$name,
      statistic_codes: ^array [1 .. * ] of sft$statistic_code,
      statistic_name: ost$name;

    status.normal := TRUE;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    limit_name := pvt [p$limit_name].value^.name_value;

    IF pvt [p$statistic_codes].specified THEN
      index := 0;
      PUSH statistic_codes: [1 .. clp$count_list_elements (pvt [p$statistic_codes].value)];
      current_parameter_value := pvt [p$statistic_codes].value;
      WHILE current_parameter_value <> NIL DO
        sfp$convert_stat_code_to_name (current_parameter_value^.statistic_code_value, statistic_name, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
        index := index + 1;
        statistic_codes^ [index] := current_parameter_value^.statistic_code_value;
        current_parameter_value := current_parameter_value^.link;
      WHILEND;
    ELSE
      statistic_codes := NIL;
    IFEND;

    initial_value := pvt [p$initial_value].value^.integer_value.value;

    IF pvt [p$job_warning_limit].value^.kind = clc$keyword THEN
      job_warning_limit := sfc$unlimited;
    ELSE
      job_warning_limit := pvt [p$job_warning_limit].value^.integer_value.value;
    IFEND;

    IF pvt [p$job_maximum_limit].value^.kind = clc$keyword THEN
      job_maximum_limit := sfc$unlimited;
    ELSE
      job_maximum_limit := pvt [p$job_maximum_limit].value^.integer_value.value;
    IFEND;

    IF pvt [p$enforcement].value^.keyword_value = 'ACCUMULATION' THEN
      enforcement := sfc$accumulation_enforcement;
    ELSE { OTHER }
      enforcement := sfc$other_enforcement;
    IFEND;

    sfp$create_job_limit (limit_name, statistic_codes, initial_value, job_warning_limit, job_maximum_limit,
          enforcement, status);

  PROCEND sfp$_create_job_limit;
?? OLDTITLE ??
?? NEWTITLE := 'sfp$_display_administrator_stat', EJECT ??

  PROCEDURE sfp$_display_administrator_stat
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE display_administrator_status, disao (
{   output, o: file = $output
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 3] of clt$pdt_parameter_name,
        parameters: array [1 .. 2] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
          default_value: string (7),
        recend,
        type2: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 10, 28, 8, 4, 28, 466], clc$command, 3, 2, 0, 0, 0, 0, 2, 'DISAO'],
            [['O                              ', clc$abbreviation_entry, 1],
            ['OUTPUT                         ', clc$nominal_entry, 1],
            ['STATUS                         ', clc$nominal_entry, 2]], [

{ PARAMETER 1

      [2, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$optional_default_parameter, 0, 7],

{ PARAMETER 2

      [3, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods [clc$specify_by_name],
            clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
            clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$file_type], '$output'],

{ PARAMETER 2

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$output = 1,
      p$status = 2;

    VAR
      pvt: array [1 .. 2] of clt$parameter_value;

    VAR
      display_control: clt$display_control,
      file_contents: amt$file_contents,
      ring_attributes: amt$ring_attributes;

*copy clv$display_variables

?? NEWTITLE := 'Dummy title because of error in clp$new_page_procedure' ??
*copyc clp$new_page_procedure

    PROCEDURE put_subtitle
      (VAR display_control: clt$display_control;
       VAR status: ost$status);

{ Dummy subtitle procedure

    PROCEND put_subtitle;
?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ Open the output file.

    clv$titles_built := FALSE;
    clv$command_name := 'display_administrator_status';
    ring_attributes.r1 := #RING (^ring_attributes);
    ring_attributes.r2 := #RING (^ring_attributes);
    ring_attributes.r3 := #RING (^ring_attributes);
    file_contents := amc$list;

    clp$open_display_reference (pvt [p$output].value^.file_value^, ^clp$new_page_procedure, file_contents,
          ring_attributes, display_control, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ Set default page width.

    IF display_control.page_width < clc$narrow_page_width THEN
      clv$page_width := clc$narrow_page_width;
    ELSE
      clv$page_width := display_control.page_width;
    IFEND;

    clp$put_display (display_control, ' ', clc$trim, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    IF system_administrator THEN
      clp$put_display (display_control, ' System administrator', clc$trim, status);
    ELSEIF family_administrator THEN
      clp$put_display (display_control, ' Family administrator', clc$trim, status);
    ELSE
      clp$put_display (display_control, ' Not an administrator', clc$trim, status);
    IFEND;
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$put_display (display_control, ' ', clc$trim, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$close_display (display_control, status);

  PROCEND sfp$_display_administrator_stat;
?? OLDTITLE ??
?? NEWTITLE := 'sfp$_emit_statistic', EJECT ??

  PROCEDURE sfp$_emit_statistic
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE emit_statistic, emis (
{   statistic_code, sc: statistic_code = $required
{   counters, counter, c: list of integer = $optional
{   descriptive_data, dd: string = $optional
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 8] of clt$pdt_parameter_name,
        parameters: array [1 .. 4] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
        type2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$integer_type_qualifier,
          recend,
        recend,
        type3: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
        type4: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 10, 27, 16, 11, 11, 424], clc$command, 8, 4, 1, 0, 0, 0, 4, 'EMIS'],
            [['C                              ', clc$abbreviation_entry, 2],
            ['COUNTER                        ', clc$alias_entry, 2],
            ['COUNTERS                       ', clc$nominal_entry, 2],
            ['DD                             ', clc$abbreviation_entry, 3],
            ['DESCRIPTIVE_DATA               ', clc$nominal_entry, 3],
            ['SC                             ', clc$abbreviation_entry, 1],
            ['STATISTIC_CODE                 ', clc$nominal_entry, 1],
            ['STATUS                         ', clc$nominal_entry, 4]], [

{ PARAMETER 1

      [7, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 3, clc$required_parameter, 0, 0],

{ PARAMETER 2

      [3, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 36, clc$optional_parameter, 0, 0],

{ PARAMETER 3

      [5, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods
            [clc$specify_by_name, clc$specify_positionally], clc$pass_by_value, clc$immediate_evaluation,
            clc$standard_parameter_checking, 8, clc$optional_parameter, 0, 0],

{ PARAMETER 4

      [8, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods [clc$specify_by_name],
            clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
            clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$statistic_code_type]],

{ PARAMETER 2

      [[1, 0, clc$list_type], [20, 1, clc$max_list_size, FALSE],
            [[1, 0, clc$integer_type], [clc$min_integer, clc$max_integer, 10]]],

{ PARAMETER 3

      [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]],

{ PARAMETER 4

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$statistic_code = 1,
      p$counters = 2,
      p$descriptive_data = 3,
      p$status = 4;

    VAR
      pvt: array [1 .. 4] of clt$parameter_value;

    VAR
      counter_array: sft$counters,
      current_parameter_value: ^clt$data_value,
      descriptive_data: ost$string,
      number_of_counters: 0 .. clc$max_value_sets,
      index: integer,
      statistic_name: ost$name;

    status.normal := TRUE;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    sfp$convert_stat_code_to_name (pvt [p$statistic_code].value^.statistic_code_value, statistic_name,
          status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    IF pvt [p$counters].specified THEN
      index := 0;
      PUSH counter_array: [1 .. clp$count_list_elements (pvt [p$counters].value)];
      current_parameter_value := pvt [p$counters].value;
      WHILE current_parameter_value <> NIL DO
        index := index + 1;
        counter_array^ [index] := current_parameter_value^.integer_value.value;
        current_parameter_value := current_parameter_value^.link;
      WHILEND;
    ELSE
      counter_array := NIL;
    IFEND;

    IF pvt [p$descriptive_data].specified THEN
      descriptive_data.value := pvt [p$descriptive_data].value^.string_value^;
      descriptive_data.size := STRLENGTH (pvt [p$descriptive_data].value^.string_value^);
    ELSE
      descriptive_data.value := '';
      descriptive_data.size := 0;
    IFEND;

    sfp$emit_statistic (pvt [p$statistic_code].value^.statistic_code_value, descriptive_data.
          value (1, descriptive_data.size), counter_array, status);

  PROCEND sfp$_emit_statistic;
?? OLDTITLE ??
?? NEWTITLE := 'sfp$_quit', EJECT ??

  PROCEDURE sfp$_quit
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE quit (
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 1] of clt$pdt_parameter_name,
        parameters: array [1 .. 1] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 10, 28, 7, 48, 16, 241], clc$command, 1, 1, 0, 0, 0, 0, 1, 'QUIT'],
            [['STATUS                         ', clc$nominal_entry, 1]], [

{ PARAMETER 1

      [1, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods [clc$specify_by_name],
            clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
            clc$optional_parameter, 0, 0]],

{ PARAMETER 1

      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$status = 1;

    VAR
      pvt: array [1 .. 1] of clt$parameter_value;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$end_include (test_harness_name, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  PROCEND sfp$_quit;
?? OLDTITLE ??
?? OLDTITLE ??
?? NEWTITLE := 'Test Harness Miscellaneous Support Routines' ??
?? NEWTITLE := 'create_heap', EJECT ??

  PROCEDURE create_heap
    (VAR heap_pointer: ^ost$heap;
     VAR file_id: amt$file_identifier;
     VAR status: ost$status);

    VAR
      file_attributes: array [1 .. 1] of amt$access_selection,
      file_name: amt$local_file_name,
      segment_pointer: amt$segment_pointer,
      unique_name: ost$unique_name;

    pmp$generate_unique_name (unique_name, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    file_name := unique_name.value;
    file_attributes [1].key := amc$return_option;
    file_attributes [1].return_option := amc$return_at_close;
    amp$open (file_name, amc$segment, ^file_attributes, file_id, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    amp$get_segment_pointer (file_id, amc$heap_pointer, segment_pointer, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    RESET segment_pointer.heap_pointer^;
    heap_pointer := segment_pointer.heap_pointer;
    RETURN;

  PROCEND create_heap;
?? OLDTITLE ??
?? OLDTITLE ??
?? NEWTITLE := 'Test Harness Stubs for System Routines' ??
?? NEWTITLE := 'avp$monitor_statistics_handler', EJECT ??

  PROCEDURE [XDCL] avp$monitor_statistics_handler
    (    flag_id: ost$system_flag);

  PROCEND avp$monitor_statistics_handler;
?? OLDTITLE ??
?? NEWTITLE := 'avp$system_administrator', EJECT ??

  FUNCTION [XDCL] avp$system_administrator: boolean;

    avp$system_administrator := system_administrator;

  FUNCEND avp$system_administrator;
?? OLDTITLE ??
?? NEWTITLE := 'clp$find_current_job_synch_task', EJECT ??

  PROCEDURE [XDCL] clp$find_current_job_synch_task
    (VAR task_id: pmt$task_id;
     VAR status: ost$status);

    pmp$get_task_id (task_id, status);

  PROCEND clp$find_current_job_synch_task;
?? OLDTITLE ??
?? NEWTITLE := 'clp$process_when_condition', EJECT ??

  PROCEDURE [XDCL] clp$process_when_condition
    (    condition: clt$when_condition;
         condition_status: ost$status;
     VAR condition_processed: boolean;
     VAR status: ost$status);

    condition_processed := FALSE;
    status.normal := TRUE;

  PROCEND clp$process_when_condition;
?? OLDTITLE ??
?? NEWTITLE := 'jmp$logout', EJECT ??

  PROCEDURE [XDCL] jmp$logout
    (VAR status: ost$status);

    osp$set_status_abnormal ('SF', 0, ' LOGOUT was called.', status);

  PROCEND jmp$logout;
?? OLDTITLE ??
?? NEWTITLE := 'lgp$add_entry_global_binary_log', EJECT ??

  PROCEDURE [XDCL] lgp$add_entry_global_binary_log
    (    global_binary_log: pmt$global_binary_logs;
         entry: ^SEQ ( * );
     VAR log_cycle: lgt$log_cycle;
     VAR status: ost$status);

    VAR
      log_name: amt$local_file_name,
      log_id: amt$file_identifier,
      log_attachment_option: ^fst$attachment_options,
      record_byte_address: amt$file_byte_address;

    log_name := lgv$log_names [global_binary_log];
    PUSH log_attachment_option: [1 .. 3];
    log_attachment_option^ [1].selector := fsc$access_and_share_modes;
    log_attachment_option^ [1].access_modes.selector := fsc$specific_access_modes;
    log_attachment_option^ [1].access_modes.value := $fst$file_access_options [fsc$append];
    log_attachment_option^ [1].share_modes.selector := fsc$specific_share_modes;
    log_attachment_option^ [1].share_modes.value := $fst$file_access_options [];
    log_attachment_option^ [2].selector := fsc$create_file;
    log_attachment_option^ [2].create_file := TRUE;
    log_attachment_option^ [3].selector := fsc$open_position;
    log_attachment_option^ [3].open_position := amc$open_at_eoi;
    fsp$open_file (log_name, amc$record, log_attachment_option, NIL, NIL, NIL, NIL, log_id, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    amp$put_next (log_id, entry, #SIZE (entry^), record_byte_address, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    fsp$close_file (log_id, status);

  PROCEND lgp$add_entry_global_binary_log;
?? OLDTITLE ??
?? NEWTITLE := 'lgp$add_entry_local_binary_log', EJECT ??

  PROCEDURE [XDCL] lgp$add_entry_local_binary_log
    (    local_binary_log: pmt$local_binary_logs;
         entry: ^SEQ ( * );
     VAR log_cycle: lgt$log_cycle;
     VAR status: ost$status);

    VAR
      log_name: amt$local_file_name,
      log_id: amt$file_identifier,
      log_attachment_option: ^fst$attachment_options,
      record_byte_address: amt$file_byte_address;

    log_name := lgv$log_names [local_binary_log];
    PUSH log_attachment_option: [1 .. 3];
    log_attachment_option^ [1].selector := fsc$access_and_share_modes;
    log_attachment_option^ [1].access_modes.selector := fsc$specific_access_modes;
    log_attachment_option^ [1].access_modes.value := $fst$file_access_options [fsc$append];
    log_attachment_option^ [1].share_modes.selector := fsc$specific_share_modes;
    log_attachment_option^ [1].share_modes.value := $fst$file_access_options [];
    log_attachment_option^ [2].selector := fsc$create_file;
    log_attachment_option^ [2].create_file := TRUE;
    log_attachment_option^ [3].selector := fsc$open_position;
    log_attachment_option^ [3].open_position := amc$open_at_eoi;
    fsp$open_file (log_name, amc$record, log_attachment_option, NIL, NIL, NIL, NIL, log_id, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    amp$put_next (log_id, entry, #SIZE (entry^), record_byte_address, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    fsp$close_file (log_id, status);

  PROCEND lgp$add_entry_local_binary_log;
?? OLDTITLE ??
?? NEWTITLE := 'osp$system_error', EJECT ??

  PROCEDURE [XDCL] osp$system_error
    (    error_message: string ( * );
         status: ^ost$status);

    VAR
      ignored_status: ost$status;

    pmp$log ('* * * * * * * * * * * * * * * * * * * *', ignored_status);
    pmp$log ('*                                      ', ignored_status);
    pmp$log ('* THE FOLLOWING SYSTEM ERROR OCCURRED: ', ignored_status);
    pmp$log (error_message, ignored_status);
    pmp$log ('*                                      ', ignored_status);
    pmp$log ('* * * * * * * * * * * * * * * * * * * *', ignored_status);
    system_error_encountered := TRUE;

  PROCEND osp$system_error;
?? OLDTITLE ??
?? NEWTITLE := 'osp$test_signature_lock', EJECT ??

  PROCEDURE [XDCL] osp$test_signature_lock
    (VAR lock: ost$signature_lock;
     VAR lock_status: ost$signature_lock_status;
     VAR status: ost$status);

    IF lock.lock_id = 0 THEN
      lock_status := osc$sls_not_locked;
    ELSE
      lock_status := osc$sls_locked_by_current_task;
    IFEND;

  PROCEND osp$test_signature_lock;
?? OLDTITLE ??
?? NEWTITLE := 'pmp$dispose_interactive_cond', EJECT ??

  PROCEDURE [XDCL] pmp$dispose_interactive_cond
    (    interactive_condition: ift$interactive_condition);

  PROCEND pmp$dispose_interactive_cond;
?? OLDTITLE ??
?? NEWTITLE := 'pmp$get_global_task_id', EJECT ??

  PROCEDURE [XDCL] pmp$get_global_task_id
    (    task_id: pmt$task_id;
     VAR global_task_id: ost$global_task_id;
     VAR status: ost$status);

    pmp$get_executing_task_gtid (global_task_id);

  PROCEND pmp$get_global_task_id;
?? OLDTITLE ??
?? NEWTITLE := 'pmp$send_signal', EJECT ??

  PROCEDURE [XDCL] pmp$send_signal
    (    recipient: ost$global_task_id;
         signal: pmt$signal;
     VAR status: ost$status);

    VAR
      condition: pmt$condition,
      condition_id: ^jmt$job_resource_condition;

    condition_id := #LOC (signal.contents);
    condition.selector := jmc$job_resource_condition;
    condition.job_resource_condition := condition_id^;
    jmp$default_job_resource_hndlr (condition, status);

  PROCEND pmp$send_signal;
?? OLDTITLE ??
?? NEWTITLE := 'sfp$change_file_space_limit', EJECT ??

  PROCEDURE [XDCL] sfp$change_file_space_limit
    (    file_space_limit_kind: sft$file_space_limit_kind;
         job_warning_limit: ^sft$counter;
         job_maximum_limit: ^sft$counter;
         accumulator: ^sft$counter;
         job_warning_checking: ^boolean);

  PROCEND sfp$change_file_space_limit;
?? OLDTITLE ??
?? NEWTITLE := 'sfp$get_file_space_limit', EJECT ??

  PROCEDURE [XDCL] sfp$get_file_space_limit
    (    file_space_limit_kind: sft$file_space_limit_kind;
     VAR job_warning_limit: sft$counter;
     VAR job_maximum_limit: sft$counter;
     VAR accumulator: sft$counter);

    job_warning_limit := sfc$unlimited;
    job_maximum_limit := sfc$unlimited;
    accumulator := 0;

  PROCEND sfp$get_file_space_limit;
?? OLDTITLE ??
?? NEWTITLE := 'tmp$fetch_job_statistics', EJECT ??

  PROCEDURE [XDCL] tmp$fetch_job_statistics
    (VAR statistics: jmt$job_statistics;
     VAR status: ost$status);

    VAR
      cp_time: pmt$task_cp_time;

    pmp$get_task_cp_time (cp_time, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    statistics.cp_time.time_spent_in_job_mode := cp_time.task_time;
    statistics.cp_time.time_spent_in_mtr_mode := cp_time.monitor_time;
    statistics.working_set_size := 1;
    statistics.ready_task_count := 2;
    statistics.paging_statistics.page_in_count := 3;
    statistics.paging_statistics.pages_reclaimed_from_queue := 4;
    statistics.paging_statistics.new_pages_assigned := 5;

  PROCEND tmp$fetch_job_statistics;
?? OLDTITLE ??
?? OLDTITLE ??
MODEND sfm$test_harness;
