?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Statistics Facility: Statistic Command Processors' ??
MODULE sfm$statistic_commands;

{ PURPOSE
{   This module contains SCL command processors to update and retrieve system and job routing control
{   information.
{
{ DESIGN:
{   The command processors in this module simply convert the parameter values specified on the command into
{   their internal formats (when necessary) and call the appropriate statistics facility program interface.

?? NEWTITLE := 'Global declarations referenced by this module.', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc clt$path_display_chunks
*copyc sfe$call_again_job_recovered
*copyc sfe$unknown_display_command
*copyc sfe$unknown_log
*copyc sft$binary_logs
?? POP ??
*copyc clp$build_standard_title
*copyc clp$close_display
*copyc clp$convert_integer_to_string
*copyc clp$count_list_elements
*copyc clp$evaluate_parameters
*copyc clp$get_set_count
*copyc clp$get_value
*copyc clp$new_display_line
*copyc clp$open_display_reference
*copyc clp$put_display
*copyc clp$put_partial_display
*copyc clp$reset_for_next_display_page
*copyc clp$scan_parameter_list
*copyc clp$test_parameter
*copyc mmp$create_scratch_segment
*copyc mmp$delete_scratch_segment
*copyc osp$establish_block_exit_hndlr
*copyc osp$set_status_abnormal
*copyc sfp$activate_job_statistic
*copyc sfp$activate_system_statistic
*copyc sfp$convert_stat_code_to_name
*copyc sfp$convert_stat_name_to_code
*copyc sfp$deactivate_job_statistic
*copyc sfp$deactivate_system_statistic
*copyc sfp$emit_statistic
*copyc sfp$get_active_job_statistics
*copyc sfp$get_active_system_stats
*copyc sfp$get_log_name
*copyc sfp$lock_statistic
?? OLDTITLE ??
?? NEWTITLE := '[INLINE] get_log_set', EJECT ??

{ PURPOSE:
{   Translate the keyword values for logs into a set of logs.

  PROCEDURE [INLINE] get_log_set
    (    parameter_name: string ( * <= osc$max_name_size);
         parameter_value: ^clt$data_value;
     VAR logs: sft$binary_logset;
     VAR status: ost$status);

    VAR
      current_parameter_value: ^clt$data_value;

    status.normal := TRUE;

    logs := $sft$binary_logset [];

    current_parameter_value := parameter_value;
    REPEAT
      IF (current_parameter_value^.element_value^.keyword_value = 'JOB_STATISTIC_LOG') THEN
        logs := logs + $sft$binary_logset [pmc$job_statistic_log];
      ELSEIF (current_parameter_value^.element_value^.keyword_value = 'STATISTIC_LOG') THEN
        logs := logs + $sft$binary_logset [pmc$statistic_log];
      ELSEIF (current_parameter_value^.element_value^.keyword_value = 'SECURITY_LOG') THEN
        logs := logs + $sft$binary_logset [pmc$security_log];
      ELSEIF (current_parameter_value^.element_value^.keyword_value = 'JOB_ACCOUNT_LOG') THEN
        logs := logs + $sft$binary_logset [pmc$job_account_log];
      ELSEIF (current_parameter_value^.element_value^.keyword_value = 'ACCOUNT_LOG') THEN
        logs := logs + $sft$binary_logset [pmc$account_log];
      ELSEIF (current_parameter_value^.element_value^.keyword_value = 'ENGINEERING_LOG') THEN
        logs := logs + $sft$binary_logset [pmc$engineering_log];
      ELSEIF (current_parameter_value^.element_value^.keyword_value = 'HISTORY_LOG') THEN
        logs := logs + $sft$binary_logset [pmc$history_log];
      ELSEIF current_parameter_value^.element_value^.keyword_value = 'ALL' THEN
        IF clp$count_list_elements (parameter_value) <> 1 THEN
          osp$set_status_abnormal ('SF', cle$all_must_be_used_alone, parameter_name, status);
          RETURN;
        ELSE
          logs := -$sft$binary_logset [];
          RETURN;
        IFEND;
      ELSE
        osp$set_status_abnormal ('SF', sfe$unknown_log, current_parameter_value^.element_value^.keyword_value,
              status);
        RETURN;
      IFEND;
      current_parameter_value := current_parameter_value^.link;
    UNTIL current_parameter_value = NIL;

  PROCEND get_log_set;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] sfp$_activate_job_statistic', EJECT ??

{ PURPOSE:
{   Command processor for the ACTIVATE_JOB_STATISTIC_COMMAND.

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

{ PROCEDURE (osm$actjs) activate_job_statistic, activate_job_statistics, actjs (
{   statistics, statistic, s: list of statistic_code = $required
{   logs, log, l: list of key
{       (job_account_log, jal)
{       (job_statistic_log, jsl)
{       (account_log, al)
{       (engineering_log, el)
{       (history_log, hl)
{       (statistic_log, sl)
{     keyend = job_statistic_log
{   lock: (BY_NAME) boolean = false
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  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,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 12] of clt$keyword_specification,
        recend,
        default_value: string (17),
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 5, 7, 8, 44, 15, 478],
    clc$command, 8, 4, 1, 0, 0, 0, 4, 'OSM$ACTJS'], [
    ['L                              ',clc$abbreviation_entry, 2],
    ['LOCK                           ',clc$nominal_entry, 3],
    ['LOG                            ',clc$alias_entry, 2],
    ['LOGS                           ',clc$nominal_entry, 2],
    ['S                              ',clc$abbreviation_entry, 1],
    ['STATISTIC                      ',clc$alias_entry, 1],
    ['STATISTICS                     ',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, 19, clc$required_parameter,
  0, 0],
{ PARAMETER 2
    [4, 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, 467,
  clc$optional_default_parameter, 0, 17],
{ PARAMETER 3
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 5],
{ 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$list_type], [3, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$statistic_code_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$list_type], [451, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$keyword_type], [12], [
      ['ACCOUNT_LOG                    ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['AL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['EL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['ENGINEERING_LOG                ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['HISTORY_LOG                    ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['HL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['JAL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['JOB_ACCOUNT_LOG                ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['JOB_STATISTIC_LOG              ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['JSL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['SL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
      ['STATISTIC_LOG                  ', clc$nominal_entry, clc$normal_usage_entry, 6]]
      ]
    ,
    'job_statistic_log'],
{ PARAMETER 3
    [[1, 0, clc$boolean_type],
    'false'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$statistics = 1,
      p$logs = 2,
      p$lock = 3,
      p$status = 4;

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

    VAR
      current_parameter_value: ^clt$data_value,
      logs: sft$binary_logset,
      statistic_code: 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;

    get_log_set ('LOGS', pvt [p$logs].value, logs, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    current_parameter_value := pvt [p$statistics].value;
    REPEAT
      statistic_code := current_parameter_value^.element_value^.statistic_code_value;

      sfp$convert_stat_code_to_name (statistic_code, statistic_name, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      sfp$activate_job_statistic (statistic_code, logs, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      IF pvt [p$lock].value^.boolean_value.value THEN
        sfp$lock_statistic (statistic_code, logs, sfc$job_routing_control_table, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      IFEND;
      current_parameter_value := current_parameter_value^.link;
    UNTIL current_parameter_value = NIL;

  PROCEND sfp$_activate_job_statistic;
?? OLDTITLE ??
?? TITLE := 'sfp$activate_sys_stat_command', EJECT ??

{ PURPOSE:
{   This is the command processor for the ACTIVATE_SYSTEM_STATISTIC command.

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

{ PROCEDURE (osm$actss) activate_system_statistic, activate_system_statistics, actss (
{   statistics, statistic, s: list of statistic_code = $required
{   logs, log, l: list of key
{       (job_account_log, jal)
{       (job_statistic_log, jsl)
{       (account_log, al)
{       (engineering_log, el)
{       (history_log, hl)
{       (statistic_log, sl)
{     keyend = statistic_log
{   lock: (BY_NAME) boolean = false
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  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,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 12] of clt$keyword_specification,
        recend,
        default_value: string (13),
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 5, 7, 8, 45, 10, 410],
    clc$command, 8, 4, 1, 0, 0, 0, 4, 'OSM$ACTSS'], [
    ['L                              ',clc$abbreviation_entry, 2],
    ['LOCK                           ',clc$nominal_entry, 3],
    ['LOG                            ',clc$alias_entry, 2],
    ['LOGS                           ',clc$nominal_entry, 2],
    ['S                              ',clc$abbreviation_entry, 1],
    ['STATISTIC                      ',clc$alias_entry, 1],
    ['STATISTICS                     ',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, 19, clc$required_parameter,
  0, 0],
{ PARAMETER 2
    [4, 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, 467,
  clc$optional_default_parameter, 0, 13],
{ PARAMETER 3
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 5],
{ 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$list_type], [3, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$statistic_code_type]]
    ],
{ PARAMETER 2
    [[1, 0, clc$list_type], [451, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$keyword_type], [12], [
      ['ACCOUNT_LOG                    ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['AL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['EL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['ENGINEERING_LOG                ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['HISTORY_LOG                    ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['HL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['JAL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['JOB_ACCOUNT_LOG                ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['JOB_STATISTIC_LOG              ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['JSL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['SL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
      ['STATISTIC_LOG                  ', clc$nominal_entry, clc$normal_usage_entry, 6]]
      ]
    ,
    'statistic_log'],
{ PARAMETER 3
    [[1, 0, clc$boolean_type],
    'false'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$statistics = 1,
      p$logs = 2,
      p$lock = 3,
      p$status = 4;

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

    VAR
      current_parameter_value: ^clt$data_value,
      logs: sft$binary_logset,
      statistic_code: 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;

    get_log_set ('LOGS', pvt [p$logs].value, logs, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    current_parameter_value := pvt [p$statistics].value;
    REPEAT
      statistic_code := current_parameter_value^.element_value^.statistic_code_value;

      sfp$convert_stat_code_to_name (statistic_code, statistic_name, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      sfp$activate_system_statistic (statistic_code, logs, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      IF pvt [p$lock].value^.boolean_value.value THEN
        sfp$lock_statistic (statistic_code, logs, sfc$sys_routing_control_table, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      IFEND;
      current_parameter_value := current_parameter_value^.link;
    UNTIL current_parameter_value = NIL;

  PROCEND sfp$activate_sys_stat_command;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] sfp$_deactivate_job_statistic', EJECT ??

{ PURPOSE:
{   This is the command processor for the DEACTIVATE_JOB_STATISTIC command.

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

{ PROCEDURE (osm$deajs) deactivate_job_statistic, deactivate_job_statistics, deajs (
{   statistics, statistic, s: list of statistic_code = $required
{   logs, log, l: list of key
{       (job_account_log, jal)
{       (job_statistic_log, jsl)
{       (account_log, al)
{       (engineering_log, el)
{       (history_log, hl)
{       (statistic_log, sl)
{     keyend = job_statistic_log
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 7] of clt$pdt_parameter_name,
        parameters: array [1 .. 3] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
          recend,
        recend,
        type2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 12] of clt$keyword_specification,
          recend,
          default_value: string (17),
        recend,
        type3: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 10, 24, 8, 50, 34, 672], clc$command, 7, 3, 1, 0, 0, 0, 3, 'OSM$DEAJS'],
            [['L                              ', clc$abbreviation_entry, 2],
            ['LOG                            ', clc$alias_entry, 2],
            ['LOGS                           ', clc$nominal_entry, 2],
            ['S                              ', clc$abbreviation_entry, 1],
            ['STATISTIC                      ', clc$alias_entry, 1],
            ['STATISTICS                     ', clc$nominal_entry, 1],
            ['STATUS                         ', clc$nominal_entry, 3]], [

{ PARAMETER 1

      [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, 19, 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, 467, clc$optional_default_parameter, 0, 17],

{ PARAMETER 3

      [7, 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$list_type], [3, 1, clc$max_list_size, FALSE], [[1, 0, clc$statistic_code_type]]],

{ PARAMETER 2

      [[1, 0, clc$list_type], [451, 1, clc$max_list_size, FALSE],
            [[1, 0, clc$keyword_type], [12], [['ACCOUNT_LOG                    ', clc$nominal_entry,
            clc$normal_usage_entry, 3], ['AL                             ', clc$abbreviation_entry,
            clc$normal_usage_entry, 3], ['EL                             ', clc$abbreviation_entry,
            clc$normal_usage_entry, 4], ['ENGINEERING_LOG                ', clc$nominal_entry,
            clc$normal_usage_entry, 4], ['HISTORY_LOG                    ', clc$nominal_entry,
            clc$normal_usage_entry, 5], ['HL                             ', clc$abbreviation_entry,
            clc$normal_usage_entry, 5], ['JAL                            ', clc$abbreviation_entry,
            clc$normal_usage_entry, 1], ['JOB_ACCOUNT_LOG                ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['JOB_STATISTIC_LOG              ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['JSL                            ', clc$abbreviation_entry,
            clc$normal_usage_entry, 2], ['SL                             ', clc$abbreviation_entry,
            clc$normal_usage_entry, 6], ['STATISTIC_LOG                  ', clc$nominal_entry,
            clc$normal_usage_entry, 6]]], 'job_statistic_log'],

{ PARAMETER 3

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

?? POP ??

    CONST
      p$statistics = 1,
      p$logs = 2,
      p$status = 3;

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

    VAR
      current_parameter_value: ^clt$data_value,
      logs: sft$binary_logset,
      statistic_code: 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;

    get_log_set ('LOGS', pvt [p$logs].value, logs, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    current_parameter_value := pvt [p$statistics].value;
    REPEAT
      statistic_code := current_parameter_value^.element_value^.statistic_code_value;

      sfp$convert_stat_code_to_name (statistic_code, statistic_name, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      sfp$deactivate_job_statistic (statistic_code, logs, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      current_parameter_value := current_parameter_value^.link;
    UNTIL current_parameter_value = NIL;

  PROCEND sfp$_deactivate_job_statistic;
?? OLDTITLE ??
?? TITLE := 'sfp$deactivate_sys_stat_command', EJECT ??

{ PURPOSE:
{   This is the command processor for the DEACTIVATE_SYSTEM_STATISTIC command.

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

{ PROCEDURE (osm$deass) deactivate_system_statistic, deactivate_system_statistics, deass (
{   statistics, statistic, s: list of statistic_code = $required
{   logs, log, l: list of key
{       (job_account_log, jal)
{       (job_statistic_log, jsl)
{       (account_log, al)
{       (engineering_log, el)
{       (history_log, hl)
{       (statistic_log, sl)
{     keyend = statistic_log
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 7] of clt$pdt_parameter_name,
        parameters: array [1 .. 3] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
          recend,
        recend,
        type2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 12] of clt$keyword_specification,
          recend,
          default_value: string (13),
        recend,
        type3: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 10, 24, 8, 54, 21, 708], clc$command, 7, 3, 1, 0, 0, 0, 3, 'OSM$DEASS'],
            [['L                              ', clc$abbreviation_entry, 2],
            ['LOG                            ', clc$alias_entry, 2],
            ['LOGS                           ', clc$nominal_entry, 2],
            ['S                              ', clc$abbreviation_entry, 1],
            ['STATISTIC                      ', clc$alias_entry, 1],
            ['STATISTICS                     ', clc$nominal_entry, 1],
            ['STATUS                         ', clc$nominal_entry, 3]], [

{ PARAMETER 1

      [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, 19, 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, 467, clc$optional_default_parameter, 0, 13],

{ PARAMETER 3

      [7, 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$list_type], [3, 1, clc$max_list_size, FALSE], [[1, 0, clc$statistic_code_type]]],

{ PARAMETER 2

      [[1, 0, clc$list_type], [451, 1, clc$max_list_size, FALSE],
            [[1, 0, clc$keyword_type], [12], [['ACCOUNT_LOG                    ', clc$nominal_entry,
            clc$normal_usage_entry, 3], ['AL                             ', clc$abbreviation_entry,
            clc$normal_usage_entry, 3], ['EL                             ', clc$abbreviation_entry,
            clc$normal_usage_entry, 4], ['ENGINEERING_LOG                ', clc$nominal_entry,
            clc$normal_usage_entry, 4], ['HISTORY_LOG                    ', clc$nominal_entry,
            clc$normal_usage_entry, 5], ['HL                             ', clc$abbreviation_entry,
            clc$normal_usage_entry, 5], ['JAL                            ', clc$abbreviation_entry,
            clc$normal_usage_entry, 1], ['JOB_ACCOUNT_LOG                ', clc$nominal_entry,
            clc$normal_usage_entry, 1], ['JOB_STATISTIC_LOG              ', clc$nominal_entry,
            clc$normal_usage_entry, 2], ['JSL                            ', clc$abbreviation_entry,
            clc$normal_usage_entry, 2], ['SL                             ', clc$abbreviation_entry,
            clc$normal_usage_entry, 6], ['STATISTIC_LOG                  ', clc$nominal_entry,
            clc$normal_usage_entry, 6]]], 'statistic_log'],

{ PARAMETER 3

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

?? POP ??

    CONST
      p$statistics = 1,
      p$logs = 2,
      p$status = 3;

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

    VAR
      current_parameter_value: ^clt$data_value,
      logs: sft$binary_logset,
      statistic_code: 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;

    get_log_set ('LOGS', pvt [p$logs].value, logs, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    current_parameter_value := pvt [p$statistics].value;
    REPEAT
      statistic_code := current_parameter_value^.element_value^.statistic_code_value;

      sfp$convert_stat_code_to_name (statistic_code, statistic_name, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      sfp$deactivate_system_statistic (statistic_code, logs, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      current_parameter_value := current_parameter_value^.link;
    UNTIL current_parameter_value = NIL;

  PROCEND sfp$deactivate_sys_stat_command;
?? OLDTITLE ??
?? NEWTITLE := 'display_active_statistics', EJECT ??

{ PURPOSE:
{   This procedure performs the actual processing for both
{   DISPLAY_ACTIVE_JOB_STATISTICS and DISPLAY_ACTIVE_SYSTEM_STATS.

  PROCEDURE display_active_statistics
    (    command_name: ost$name;
         output: fst$file_reference;
         logs: sft$binary_logset;
     VAR status: ost$status);

    VAR
      current_log: sft$binary_logs,
      current_log_name: ost$name,
      current_routing_control: ^sft$routing_control,
      display_control: clt$display_control,
      file_contents: amt$file_contents,
      first_routing_control: ^sft$routing_control,
      found_statistics: boolean,
      ring_attributes: amt$ring_attributes,
      segment_pointer: amt$segment_pointer,
      statistic_name: ost$name,
      work_area: ^SEQ ( * );

*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 ??
?? NEWTITLE := 'block_exit_handler', EJECT ??

{ PURPOSE:
{   This block exit handler is used to close the display file and delete the
{   scratch segment used by the command processor in case of an abnormal exit.

    PROCEDURE block_exit_handler
      (    condition: pmt$condition;
           condition_information: ^pmt$condition_information;
           save_area: ^ost$stack_frame_save_area;
       VAR handler_status: ost$status);

      VAR
        ignore_status: ost$status;

      clp$close_display (display_control, ignore_status);

      mmp$delete_scratch_segment (segment_pointer, ignore_status);

    PROCEND block_exit_handler;
?? OLDTITLE, EJECT ??

    status.normal := TRUE;

    osp$establish_block_exit_hndlr (^block_exit_handler);

    mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_sequential, segment_pointer, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    RESET segment_pointer.sequence_pointer;
    work_area := segment_pointer.sequence_pointer;

    IF command_name = 'display_active_system_statistic' THEN
      REPEAT
        sfp$get_active_system_stats (logs, first_routing_control, work_area, status);
      UNTIL (status.normal) OR (status.condition <> sfe$call_again_job_recovered);
    ELSEIF command_name = 'display_active_job_statistic' THEN
      sfp$get_active_job_statistics (logs, first_routing_control, work_area, status);
    ELSE
      osp$set_status_abnormal ('SF', sfe$unknown_display_command, command_name, status);
    IFEND;
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clv$titles_built := FALSE;
    clv$command_name := command_name;
    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 (output, ^clp$new_page_procedure, file_contents, ring_attributes,
          display_control, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  /process_logs/
    FOR current_log := LOWERVALUE (sft$binary_logs) TO UPPERVALUE (sft$binary_logs) DO
      IF current_log IN logs THEN

        found_statistics := FALSE;
        current_routing_control := first_routing_control;

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

        clp$put_partial_display (display_control, 'Statistics activated to ', clc$no_trim, amc$start, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        sfp$get_log_name (current_log, current_log_name, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        clp$put_partial_display (display_control, current_log_name, clc$trim, amc$continue, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF command_name = 'display_active_system_statistic' THEN
          clp$put_partial_display (display_control, ' by the system:', clc$trim, amc$terminate, status);
        ELSE
          clp$put_partial_display (display_control, ' by this job:', clc$trim, amc$terminate, status);
        IFEND;
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        WHILE current_routing_control <> NIL DO
          IF current_log IN current_routing_control^.activated_logs THEN
            found_statistics := TRUE;

            sfp$convert_stat_code_to_name (current_routing_control^.statistic_code, statistic_name, status);
            IF NOT status.normal THEN
              EXIT /process_logs/;
            IFEND;

            clp$put_partial_display (display_control, '    ', clc$no_trim, amc$start, status);
            IF NOT status.normal THEN
              EXIT /process_logs/;
            IFEND;

            clp$put_partial_display (display_control, statistic_name, clc$trim, amc$continue, status);
            IF NOT status.normal THEN
              EXIT /process_logs/;
            IFEND;

            IF current_log IN current_routing_control^.locked_logs THEN
              clp$put_partial_display (display_control, ' (Locked)', clc$trim, amc$terminate, status);
            ELSE
              clp$put_partial_display (display_control, ' ', clc$trim, amc$terminate, status);
            IFEND;
            IF NOT status.normal THEN
              EXIT /process_logs/;
            IFEND;

          IFEND;
          current_routing_control := current_routing_control^.forward;
        WHILEND;

        IF NOT found_statistics THEN
          clp$put_display (display_control, ' No active statistics.', clc$trim, status);
        IFEND;

      IFEND;
    FOREND /process_logs/;

  PROCEND display_active_statistics;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] sfp$_display_active_job_statist', EJECT ??

{ PURPOSE:
{   This is the command processor for the DISPLAY_ACTIVE_JOB_STATISTICS command.

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

{ PROCEDURE (osm$disajs) display_active_job_statistic, display_active_job_statistics, disajs (
{   output, o: file = $output
{   display_option, display_options, do: list of key
{       (job_account_log, jal)
{       (job_statistic_log, jsl)
{       (account_log, al)
{       (engineering_log, el)
{       (history_log, hl)
{       security_log
{       (statistic_log, sl)
{       all
{     keyend = job_statistic_log
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 6] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 14] of clt$keyword_specification,
        recend,
        default_value: string (17),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 5, 6, 9, 27, 12, 222],
    clc$command, 6, 3, 0, 0, 0, 0, 3, 'OSM$DISAJS'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 2],
    ['DISPLAY_OPTIONS                ',clc$alias_entry, 2],
    ['DO                             ',clc$abbreviation_entry, 2],
    ['O                              ',clc$abbreviation_entry, 1],
    ['OUTPUT                         ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [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, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 2
    [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, 541,
  clc$optional_default_parameter, 0, 17],
{ PARAMETER 3
    [6, 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$list_type], [525, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$keyword_type], [14], [
      ['ACCOUNT_LOG                    ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['AL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 8],
      ['EL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['ENGINEERING_LOG                ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['HISTORY_LOG                    ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['HL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['JAL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['JOB_ACCOUNT_LOG                ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['JOB_STATISTIC_LOG              ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['JSL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['SECURITY_LOG                   ', clc$nominal_entry, clc$normal_usage_entry, 6],
      ['SL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
      ['STATISTIC_LOG                  ', clc$nominal_entry, clc$normal_usage_entry, 7]]
      ]
    ,
    'job_statistic_log'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

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

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

    VAR
      logs: sft$binary_logset,
      output: clt$value;

    status.normal := TRUE;

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

    get_log_set ('DISPLAY_OPTIONS', pvt [p$display_option].value, logs, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    display_active_statistics ('display_active_job_statistic   ', pvt [p$output].value^.file_value^, logs,
          status);

  PROCEND sfp$_display_active_job_statist;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] sfp$_display_active_system_stat', EJECT ??

{ PURPOSE:
{   This is the command processor for the DISPLAY_ACTIVE_SYSTEM_STATS command.

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

{ PROCEDURE (osm$disass) display_active_system_statistic, display_active_system_stats, disass (
{   output, o: file = $output
{   display_option, display_options, do: list of key
{       (job_account_log, jal)
{       (job_statistic_log, jsl)
{       (account_log, al)
{       (engineering_log, el)
{       (history_log, hl)
{       security_log
{       (statistic_log, sl)
{       all
{     keyend = job_statistic_log
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 6] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 14] of clt$keyword_specification,
        recend,
        default_value: string (17),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 5, 6, 9, 27, 44, 482],
    clc$command, 6, 3, 0, 0, 0, 0, 3, 'OSM$DISASS'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 2],
    ['DISPLAY_OPTIONS                ',clc$alias_entry, 2],
    ['DO                             ',clc$abbreviation_entry, 2],
    ['O                              ',clc$abbreviation_entry, 1],
    ['OUTPUT                         ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [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, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 2
    [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, 541,
  clc$optional_default_parameter, 0, 17],
{ PARAMETER 3
    [6, 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$list_type], [525, 1, clc$max_list_size, FALSE],
      [[1, 0, clc$keyword_type], [14], [
      ['ACCOUNT_LOG                    ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['AL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 8],
      ['EL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['ENGINEERING_LOG                ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['HISTORY_LOG                    ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['HL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['JAL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['JOB_ACCOUNT_LOG                ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['JOB_STATISTIC_LOG              ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['JSL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['SECURITY_LOG                   ', clc$nominal_entry, clc$normal_usage_entry, 6],
      ['SL                             ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
      ['STATISTIC_LOG                  ', clc$nominal_entry, clc$normal_usage_entry, 7]]
      ]
    ,
    'job_statistic_log'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

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

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

    VAR
      logs: sft$binary_logset,
      output: clt$value;

    status.normal := TRUE;

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

    get_log_set ('DISPLAY_OPTION', pvt [p$display_option].value, logs, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    display_active_statistics ('display_active_system_statistic', pvt [p$output].value^.file_value^, logs,
          status);

  PROCEND sfp$_display_active_system_stat;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] sfp$_emit_statistic', EJECT ??

{ PURPOSE:
{   This is the command processor for the EMIT_STATISTIC command.

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

{ PROCEDURE (osm$emis) emit_statistic, emis (
{   statistic, s: statistic_code = $required
{   descriptive_data, dd: string 1..0fff(16) = $optional
{   counters, c: list 1..0fff(16) of integer = $optional
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 7] 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$string_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [104, 1, 23, 13, 9, 23, 734],
    clc$command, 7, 4, 1, 0, 0, 0, 4, 'OSM$EMIS'], [
    ['C                              ',clc$abbreviation_entry, 3],
    ['COUNTERS                       ',clc$nominal_entry, 3],
    ['DD                             ',clc$abbreviation_entry, 2],
    ['DESCRIPTIVE_DATA               ',clc$nominal_entry, 2],
    ['S                              ',clc$abbreviation_entry, 1],
    ['STATISTIC                      ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ PARAMETER 1
    [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, 3, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [4, 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 3
    [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, 36, clc$optional_parameter,
  0, 0],
{ PARAMETER 4
    [7, 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$string_type], [1, 0fff(16), FALSE]],
{ PARAMETER 3
    [[1, 0, clc$list_type], [20, 1, 0fff(16), 0, FALSE, FALSE],
      [[1, 0, clc$integer_type], [clc$min_integer, clc$max_integer, 10]]
    ],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

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

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

    VAR
      counters_p: sft$counters,
      descriptive_data_p: ^sft$descriptive_data,
      i: integer,
      number_of_counters: integer,
      statistic_code: sft$statistic_code,
      value_p: ^clt$data_value;

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

    IF pvt [p$descriptive_data].specified THEN
      descriptive_data_p := pvt [p$descriptive_data].value^.string_value;
    ELSE
      PUSH descriptive_data_p: [0];
    IFEND;

    IF pvt [p$counters].specified THEN
      value_p := pvt [p$counters].value;
      number_of_counters := clp$count_list_elements (value_p);
      PUSH counters_p: [1 .. number_of_counters];
      FOR i := 1 TO number_of_counters DO
        counters_p^ [i] := 0;
        IF value_p <> NIL THEN
          IF value_p^.kind = clc$list THEN
            IF (value_p^.element_value <> NIL) AND (value_p^.element_value^.kind = clc$integer) THEN
              counters_p^ [i] := value_p^.element_value^.integer_value.value;
            IFEND;
            value_p := value_p^.link;
          IFEND;
        IFEND;
      FOREND;
    ELSE
      counters_p := NIL;
    IFEND;

    sfp$emit_statistic (pvt [p$statistic].value^.statistic_code_value, descriptive_data_p^, counters_p,
          status);

  PROCEND sfp$_emit_statistic;
?? OLDTITLE ??
MODEND sfm$statistic_commands;
