?? RIGHT := 110 ??

MODULE clm$display_system_data;

{
{PURPOSE:
{        This module is the command language interface to display
{        system and job statistics.
{
?? EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc jmt$dispatching_priority
*copyc jmt$job_scheduler_statistics
*copyc mmt$page_frame_queue_id
*copyc ost$data_id
*copyc oss$job_paged_literal
*copyc syc$monitor_request_codes
*copyc ost$stack_frame_save_area
*copyc pmt$condition_information
*copyc sye$command_processor_errors
?? POP ??
*copyc jsv$swap_status_id_array

  VAR
    sys_data_id_set: [READ, STATIC, oss$job_paged_literal] ost$data_id_set :=
      [osc$page_faults, osc$mtr_requests, osc$aging_statistics,
      osc$jm_mm_statistics, osc$swap_statistics, osc$cpu_statistics, osc$pio_stats,
      osc$job_sched_statistics, osc$swap_file_statistics],
    job_data_id_set: [READ, STATIC, oss$job_paged_literal] ost$data_id_set := [osc$job_data];

*copyc avp$configuration_administrator
*copyc avp$system_administrator
*copyc clp$convert_integer_to_rjstring
*copyc clp$open_display
*copyc clp$new_display_line
*copyc clp$new_display_page
*copyc clp$close_display
*copyc clp$scan_parameter_list
*copyc clp$get_set_count
*copyc clp$get_value
*copyc clp$put_display
*copyc clv$nil_display_control
*copyc pmp$get_time
*copyc pmp$get_date
*copyc osp$get_pp_unit_count
*copyc osp$i_get_page_stats
*copyc osp$get_paging_stats
*copyc osp$get_mtr_stats
*copyc osp$get_aging_stats
*copyc osp$get_swap_stats
*copyc osp$get_swap_file_statistics
*copyc osp$get_cpu_stats
*copyc osp$get_job_stats
*copyc osp$get_jm_mm_stats
*copyc osp$get_sched_stats
*copyc osp$get_pio_pp_stats
*copyc osp$get_pio_unit_stats
*copyc osp$establish_block_exit_hndlr
*copyc osp$disestablish_cond_handler
*copyc osp$reset_maximum_time
*copyc osp$set_status_abnormal
*copyc clt$path_display_chunks
*copyc clp$build_standard_title
*copyc clp$reset_for_next_display_page
*copyc clp$convert_integer_to_string
*copyc ost$page_size
*copyc osc$processor_defined_registers
?? EJECT, TITLE := 'PROCEDURE clp$display_system_data_command' ??

  PROCEDURE [XDCL] clp$display_system_data_command (parameter_list: clt$parameter_list;
    VAR status: ost$status);

?? RIGHT := 110 ??

{      PDT display_system_data_pdt(
{          display_option, display_options, do : list of key page_faults, pf, monitor_requests, mr, ..
{            cpu_statistics, cs, pio_statistics, ps, aging_statistics, as, jm_mm_statistics, jms, ..
{            swap_statistics, ss, job_sched_statistics, jss, swap_file_statistics, sfs, all = all
{          display_format, df : key incremental, i, total, t = incremental
{          reset_maximum_time, rmt : boolean = false
{          output, o : file = $output
{          status)

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

  VAR
    display_system_data_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table := [
  ^display_system_data_pdt_names, ^display_system_data_pdt_params];

  VAR
    display_system_data_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 10] of
  clt$parameter_name_descriptor := [['DISPLAY_OPTION', 1], ['DISPLAY_OPTIONS', 1], ['DO', 1], [
  'DISPLAY_FORMAT', 2], ['DF', 2], ['RESET_MAXIMUM_TIME', 3], ['RMT', 3], ['OUTPUT', 4], ['O', 4], ['STATUS',
  5]];

  VAR
    display_system_data_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 5] of
  clt$parameter_descriptor := [

{ DISPLAY_OPTION DISPLAY_OPTIONS DO }
    [[clc$optional_with_default, ^display_system_data_pdt_dv1], 1, clc$max_value_sets,1, 1,
  clc$value_range_not_allowed, [^display_system_data_pdt_kv1, clc$keyword_value]],

{ DISPLAY_FORMAT DF }
    [[clc$optional_with_default, ^display_system_data_pdt_dv2], 1, 1, 1, 1, clc$value_range_not_allowed, [^
  display_system_data_pdt_kv2, clc$keyword_value]],

{ RESET_MAXIMUM_TIME RMT }
    [[clc$optional_with_default, ^display_system_data_pdt_dv3], 1, 1, 1, 1, clc$value_range_not_allowed,
  [NIL, clc$boolean_value]],

{ OUTPUT O }
    [[clc$optional_with_default, ^display_system_data_pdt_dv4], 1, 1, 1, 1, clc$value_range_not_allowed,
  [NIL, clc$file_value]],

{ STATUS }
    [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
  clc$array_not_allowed, clc$status_value]]];

  VAR
    display_system_data_pdt_kv1: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 19] of ost$name := [
  'PAGE_FAULTS','PF','MONITOR_REQUESTS','MR','CPU_STATISTICS','CS','PIO_STATISTICS','PS','AGING_STATISTICS',
  'AS','JM_MM_STATISTICS','JMS','SWAP_STATISTICS','SS','JOB_SCHED_STATISTICS','JSS','SWAP_FILE_STATISTICS',
  'SFS','ALL'];

  VAR
    display_system_data_pdt_kv2: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 4] of ost$name := [
  'INCREMENTAL','I','TOTAL','T'];

  VAR
    display_system_data_pdt_dv1: [STATIC, READ, cls$pdt_names_and_defaults] string (3) := 'all';

  VAR
    display_system_data_pdt_dv2: [STATIC, READ, cls$pdt_names_and_defaults] string (11) := 'incremental';

  VAR
    display_system_data_pdt_dv3: [STATIC, READ, cls$pdt_names_and_defaults] string (5) := 'false';

  VAR
    display_system_data_pdt_dv4: [STATIC, READ, cls$pdt_names_and_defaults] string (7) := '$output';

?? FMT (FORMAT := ON) ??
?? POP ??
    display_data (parameter_list, display_system_data_pdt, sys_data_id_set, status);

  PROCEND clp$display_system_data_command;

?? EJECT, TITLE := 'PROCEDURE clp$display_job_data_command' ??

  PROCEDURE [XDCL] clp$display_job_data_command (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PDT display_job_data_pdt(
{ display_option, display_options, do: KEY job_data = job_data
{ display_format, df: KEY incremental, i, total, t = incremental
{ output, o: FILE = $output
{ STATUS)

?? PUSH (LISTEXT := ON) ??

    VAR
      display_job_data_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table :=
        [^display_job_data_pdt_names, ^display_job_data_pdt_params];

    VAR
      display_job_data_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 8] of
        clt$parameter_name_descriptor := [['DISPLAY_OPTION', 1], ['DISPLAY_OPTIONS', 1], ['DO', 1], [
        'DISPLAY_FORMAT', 2], ['DF', 2], ['OUTPUT', 3], ['O', 3], ['STATUS', 4]];

    VAR
      display_job_data_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 4] of
        clt$parameter_descriptor := [

{ DISPLAY_OPTION DISPLAY_OPTIONS DO }
      [[clc$optional_with_default, ^display_job_data_pdt_dv1], 1, 1, 1, 1, clc$value_range_not_allowed,
        [^display_job_data_pdt_kv1, clc$keyword_value]],

{ DISPLAY_FORMAT DF }
      [[clc$optional_with_default, ^display_job_data_pdt_dv2], 1, 1, 1, 1, clc$value_range_not_allowed,
        [^display_job_data_pdt_kv2, clc$keyword_value]],

{ OUTPUT O }
      [[clc$optional_with_default, ^display_job_data_pdt_dv3], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL,
        clc$file_value]],

{ STATUS }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
        clc$array_not_allowed, clc$status_value]]];

    VAR
      display_job_data_pdt_kv1: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 1] of ost$name := [
        'JOB_DATA'];

    VAR
      display_job_data_pdt_kv2: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 4] of ost$name := [
        'INCREMENTAL', 'I', 'TOTAL', 'T'];

    VAR
      display_job_data_pdt_dv1: [STATIC, READ, cls$pdt_names_and_defaults] string (8) := 'job_data';

    VAR
      display_job_data_pdt_dv2: [STATIC, READ, cls$pdt_names_and_defaults] string (11) := 'incremental';

    VAR
      display_job_data_pdt_dv3: [STATIC, READ, cls$pdt_names_and_defaults] string (7) := '$output';

?? POP ??

    display_data (parameter_list, display_job_data_pdt, job_data_id_set, status);

  PROCEND clp$display_job_data_command;


?? EJECT, TITLE := 'PROCEDURE display_data' ??

  PROCEDURE display_data (parameter_list: clt$parameter_list;
        display_data_pdt: clt$parameter_descriptor_table;
        id_set: ost$data_id_set;
    VAR status: ost$status);


    CONST
      table_length = 19;

    TYPE
      converted_names = record
        name: string (20),
        id: ost$data_id,
        title_name: string (30),
        data_title: string (20),
      recend,
      option_set = set of ost$data_id;

    VAR
      i,
      j: integer,
      count: 0 .. clc$max_value_sets,
      k: ost$data_id,
      table: [STATIC, READ, oss$job_paged_literal] array [1 .. table_length] of converted_names :=
{              } [['PAGE_FAULTS', osc$page_faults, 'PAGE_FAULTS, PAGING STATISTICS', ' system data- '],
{              } ['PF', osc$page_faults, 'PAGE_FAULTS, PAGING STATISTICS', ' system data- '],
{              } ['MONITOR_REQUESTS', osc$mtr_requests, 'MONITOR_REQUESTS', ' system data- '],
{              } ['MR', osc$mtr_requests, 'MONITOR_REQUESTS', ' system data- '],
{              } ['AGING_STATISTICS', osc$aging_statistics, 'AGING_STATISTICS', ' system data- '],
{              } ['AS', osc$aging_statistics, 'AGING_STATISTICS', ' system data- '],
{              } ['JM_MM_STATISTICS', osc$jm_mm_statistics, 'JOB/MEMORY STATISTICS', ' system data- '],
{              } ['JMS', osc$jm_mm_statistics, 'JOB/MEMORY STATISTICS', ' system_data- '],
{              } ['JOB_DATA', osc$job_data, '    ', ' job data- '],
{              } ['SWAP_STATISTICS', osc$swap_statistics, 'SWAPPING STATISTICS', ' system data- '],
{              } ['SS', osc$swap_statistics, 'SWAPPING STATISTICS', ' system data- '],
{              } ['CPU_STATISTICS', osc$cpu_statistics, 'CPU STATISTICS', ' system data- '],
{              } ['CS', osc$cpu_statistics, 'CPU STATISTICS', ' system data- '],
{              } ['PIO_STATISTICS', osc$pio_stats, 'PIO_STATISTICS', ' system data- '],
{              } ['PS', osc$pio_stats, 'PIO_STATISTICS', ' system data- '],
{              } ['JOB_SCHED_STATISTICS', osc$job_sched_statistics, 'SCHEDULER STATISTICS',' system data- '],
{              } ['JSS', osc$job_sched_statistics, 'SCHEDULER STATISTICS', ' system data- '],
{              } ['SWAP_FILE_STATISTICS', osc$swap_file_statistics, 'SWAP FILE STATISTICS', ' system_data- '],
{              } ['SFS', osc$swap_file_statistics, 'SWAP FILE STATISTICS', ' system_data- ']],

      requested_options: option_set,
      value: clt$value,
      reset_maximum_time: boolean,
      file_name: clt$file,
      display_control: clt$display_control,
      display_format: ost$display_format;

*copy clv$display_variables
*copy clp$new_page_procedure

?? TITLE := 'PROCEDURE display_data' ??
?? NEWTITLE := 'abort_handler' ??
?? EJECT ??

    PROCEDURE abort_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);

    PROCEND abort_handler;
?? TITLE := 'put_subtitle', EJECT ??

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

      { The display_system_data and display_job_data commands have
      { subtitles but they are written in another procedure.  This is
      { merely a dummy routine used to keep the module consistent
      { with those that do produce subtitles.

    PROCEND put_subtitle;
?? OLDTITLE ??
?? EJECT, NEWTITLE := '    PROCEDURE format_data' ??

    PROCEDURE format_data (table_entry: converted_names;
          display_format: ost$display_format;
      VAR display_control: clt$display_control;
      VAR status: ost$status);


      VAR
        line: string (75),
        string_rep1: string (30),
        time_increment,
        length: integer,
        current_date: ost$date,
        current_time: ost$time,
        unit_count: integer,
        pp_count: integer,
        swap_file_stats_enabled: boolean,
        user_swap_stats: ost$swap_stats,
        user_page_stats: ost$i_page_fault_stats,
        user_server_page_stats: ost$i_page_fault_stats,
        user_paging_stats: ost$paging_stats,
        user_mtr_stats: ost$mtr_stats,
        user_aging_stats: ost$aging_stats,
        user_cpu_stats: ost$cpu_stats,
        user_job_stats: ost$job_stats,
        user_jm_mm_stats: ost$jm_mm_stats,
        user_sched_stats: ost$sched_stats,
        user_swap_file_stats: ost$swap_file_stats,
        user_pp_stats_p: ^ost$disk_pp_stats,
        user_unit_stats_p: ^ost$disk_unit_stats;

      clp$new_display_page (display_control, status);
      IF NOT status.normal THEN
        EXIT display_data;
      IFEND;

      IF table_entry.id <> osc$swap_file_statistics THEN
        line (1, * ) := '   ';
        line (1, 21) := table_entry.data_title;
        line (22, * ) := table_entry.title_name;
        clp$put_display (display_control, line, clc$trim, status);
        IF NOT status.normal THEN
          EXIT display_data;
        IFEND;
      IFEND;

      CASE table_entry.id OF
      = osc$page_faults =
        osp$i_get_page_stats (display_format = osc$incremental, user_page_stats, user_server_page_stats,
              status);
        osp$get_paging_stats (display_format = osc$incremental, user_paging_stats, status);
        time_increment := user_page_stats.time div 1000000;
      = osc$mtr_requests =
        osp$get_mtr_stats (display_format = osc$incremental, user_mtr_stats, status);
        time_increment := user_mtr_stats.time div 1000000;
      = osc$aging_statistics =
        osp$get_aging_stats (display_format = osc$incremental, user_aging_stats, status);
        time_increment := user_aging_stats.time div 1000000;
      = osc$swap_statistics =
        osp$get_swap_stats (display_format = osc$incremental, user_swap_stats, status);
        time_increment := user_swap_stats.time div 1000000;
      = osc$cpu_statistics =
        osp$get_cpu_stats (display_format = osc$incremental, user_cpu_stats, status);
        time_increment := user_cpu_stats.time div 1000000;
      = osc$job_data =
        osp$get_job_stats (display_format = osc$incremental, user_job_stats, status);
        time_increment := user_job_stats.time div 1000000;
      = osc$jm_mm_statistics =
        osp$get_jm_mm_stats (display_format = osc$incremental, user_jm_mm_stats, status);
        time_increment := user_jm_mm_stats.time div 1000000;
      = osc$pio_stats =
        osp$get_pp_unit_count (pp_count, unit_count, status);
        IF (pp_count <> 0) AND (unit_count <> 0) THEN
          PUSH user_pp_stats_p: [1 .. pp_count];
          PUSH user_unit_stats_p: [1 .. unit_count];
          osp$get_pio_pp_stats (display_format = osc$incremental, user_pp_stats_p^, status);
          osp$get_pio_unit_stats (display_format = osc$incremental, user_unit_stats_p^, status);
          time_increment := user_pp_stats_p^.time div 1000000;
        IFEND;
      = osc$job_sched_statistics =
        osp$get_sched_stats (display_format = osc$incremental, user_sched_stats, status);
        time_increment := user_sched_stats.time div 1000000;
      = osc$swap_file_statistics =
        osp$get_swap_file_statistics (display_format = osc$incremental, swap_file_stats_enabled,
              user_swap_file_stats, status);
        IF NOT swap_file_stats_enabled THEN
          line (1, * ) := ' Swap File Statistics Not Currently Enabled.';
          clp$put_display (display_control, line, clc$trim, status);
          RETURN;
        ELSE
          line (1, * ) := '   ';
          line (1, 21) := table_entry.data_title;
          line (22, * ) := table_entry.title_name;
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT display_data;
          IFEND;
        IFEND;
        time_increment := user_swap_file_stats.time div 1000000;
      CASEND;

      pmp$get_date (osc$mdy_date, current_date, status);
      IF NOT status.normal THEN
        EXIT display_data;
      IFEND;

      pmp$get_time (osc$hms_time, current_time, status);
      IF NOT status.normal THEN
        EXIT display_data;
      IFEND;

      line (1, * ) := '   ';
      line (2, 8) := current_date.mdy;
      line (10, 4) := '    ';
      line (14, 8) := current_time.hms;

      IF (display_format = osc$incremental) AND (table_entry.id <> osc$jm_mm_statistics) THEN
        line (22, 6) := '      ';
        line (28, 19) := '[time increment of ';
        STRINGREP (string_rep1, length, time_increment);
        line (47, length) := string_rep1;
        line (47 + length, * ) := ' seconds]';
      ELSE
        line (22, * ) := '    ';
      IFEND;

      clp$put_display (display_control, line, clc$trim, status);
      IF NOT status.normal THEN
        EXIT display_data;
      IFEND;

      clp$new_display_line (display_control, 2, status);
      IF NOT status.normal THEN
        EXIT display_data;
      IFEND;

      CASE table_entry.id OF
      = osc$page_faults =
        format_system_pf_data (user_page_stats, user_server_page_stats, display_control, status);
        format_system_paging_data (user_paging_stats, display_control, status);
      = osc$mtr_requests =
        format_system_mr_data (user_mtr_stats, display_control, status);
      = osc$aging_statistics =
        format_system_as_data (user_aging_stats, display_control, status);
      = osc$swap_statistics =
        format_swap_statistics (user_swap_stats, display_control, status);
      = osc$cpu_statistics =
        format_cpu_statistics (user_cpu_stats, display_control, status);
      = osc$job_data =
        format_job_data (user_job_stats, display_control, status);
      = osc$jm_mm_statistics =
        format_jm_mm_statistics (user_jm_mm_stats, display_control, status);
      = osc$pio_stats =
        format_pio_stats (user_pp_stats_p, user_unit_stats_p,
                          pp_count, unit_count, display_control, status);
      = osc$job_sched_statistics =
        format_scheduler_data (user_sched_stats, display_control, status);
      = osc$swap_file_statistics =
        format_swap_file_statistics (user_swap_file_stats, display_control, status);
      CASEND;
      IF NOT status.normal THEN
        EXIT display_data;
      IFEND;

    PROCEND format_data;
?? TITLE := '    PROCEDURE format_swap_statistics', EJECT ??

    PROCEDURE format_swap_statistics (
          user_copy_of_data: ost$swap_stats;
      VAR display_control: clt$display_control;
      VAR status: ost$status);

      VAR
        s: string (60),
        interval_in_seconds,
        swap_rate: real,
        from_state,
        to_state: jmt$ijl_swap_status,
        len: integer;

      s := ' TRANSITION   COUNT   AVER-US  COUNT/SEC        MAX-US';
      clp$put_display (display_control, s, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      s := ' ';
      clp$put_display (display_control, s, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      interval_in_seconds := $real(user_copy_of_data.time)/1000000.0;
      FOR from_state := LOWERVALUE (jmt$ijl_swap_status) TO UPPERVALUE (jmt$ijl_swap_status) DO
        FOR to_state := LOWERVALUE (jmt$ijl_swap_status) TO UPPERVALUE (jmt$ijl_swap_status) DO
          IF user_copy_of_data.swap_stats [from_state] [to_state].count <> 0 THEN
            s := ' ';
            s (5, 2) := jsv$swap_status_id_array [from_state];
            s (10, 2) := jsv$swap_status_id_array [to_state];
            IF interval_in_seconds <> 0.0 THEN
                swap_rate := $real(user_copy_of_data.swap_stats [from_state] [to_state].count)
                              / interval_in_seconds;
              ELSE
                swap_rate := 0.0;
            IFEND;
            STRINGREP (s (12, 8), len, user_copy_of_data.swap_stats [from_state] [to_state].count);
            STRINGREP (s (20, 10), len, user_copy_of_data.swap_stats [from_state] [to_state].total_time DIV
                  user_copy_of_data.swap_stats [from_state] [to_state].count);
            STRINGREP (s (30, 11), len, swap_rate:11:1);
            STRINGREP (s (44, 11), len, user_copy_of_data.swap_stats [from_state] [to_state].maximum_time);
            clp$put_display (display_control, s, clc$trim, status);
            IF NOT status.normal THEN
              RETURN;
            IFEND;
          IFEND;
        FOREND;
      FOREND;


      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      s := ' Average swap file size:';
      IF user_copy_of_data.swap_file_page_count.swap_count > 0 THEN
        STRINGREP (s (26, 9), len, $REAL(user_copy_of_data.swap_file_page_count.page_count)/
              $REAL(user_copy_of_data.swap_file_page_count.swap_count):9:2);
      ELSE
        s (26, 1) := '0';
      IFEND;
      clp$put_display (display_control, s, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

    PROCEND format_swap_statistics;
?? EJECT, TITLE := '    PROCEDURE format_system_pf_data' ??

    PROCEDURE format_system_pf_data (
          user_copy_of_data: ost$i_page_fault_stats;
          user_copy_of_server_data: ost$i_page_fault_stats;
      VAR display_control: clt$display_control;
      VAR status: ost$status);

      VAR
        line: string (80),
        string_rep2: string (20),
        pf_sum,
        i,
        length: integer,
        time_interval_sec,
        pf_rate: real,
        queue_id: [STATIC, READ, oss$job_paged_literal] array [1 .. 19] of string (28) :=
{            1 } ['   available queue          ',
{            2  } '   available modified queue ',
{            3  } '   valid in page table      ',
{            4  } '   no memory                ',
{            5  } '   low on memory            ',
{            6  } '   locked                   ',
{            7  } '   on disk                  ',
{            8  } '   page table full          ',
{            9  } '   io temporary reject      ',
{           10  } '   new page assigned        ',
{           11  } '   beyond file limit        ',
{           12  } '   beyond end of segment    ',
{           13  } '   no extend permission     ',
{           14  } '   volume unavailable       ',
{           15  } '   found on server          ',
{           16  } '   alloc required on server ',
{           17  } '   server terminated        ',
{           18  } '   job work required        ',
{           19  } '   runaway write            '];

      line := ' ';
      line(4,15) := 'Page Fault Type';
      line(34,16) := 'Page Fault Count';
      line(54,18) := 'Page Faults/Second';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := '  ';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;


      time_interval_sec := $real(user_copy_of_data.time) / 1000000.0;
      pf_sum := 0;
      FOR i := LOWERBOUND (queue_id) TO UPPERBOUND (queue_id) DO
        line (1, * ) := '     ';
        pf_sum := pf_sum + user_copy_of_data.pf_stats [i];
        IF time_interval_sec <> 0.0 THEN
            pf_rate := $real(user_copy_of_data.pf_stats [i]) / time_interval_sec;
          ELSE
            pf_rate := 0.0;
        IFEND;
        STRINGREP (line,length,
                        ' ',queue_id [i],
                        ' ',user_copy_of_data.pf_stats [i]:20,
                        ' ',pf_rate:20:1);
        clp$put_display (display_control, line (1, 80), clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

      FOREND;

      line := ' ';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      IF time_interval_sec <> 0.0 THEN
          pf_rate := $real(pf_sum) / time_interval_sec;
        ELSE
          pf_rate := 0.0;
      IFEND;
      STRINGREP (line,length,
                      ' ','   Total Page Faults        ',
                      ' ',pf_sum:20,
                      ' ',pf_rate:20:1);
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      line(22, 18) := 'SERVER PAGE_FAULTS';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      line(4,15) := 'Page Fault Type';
      line(34,16) := 'Page Fault Count';
      line(54,18) := 'Page Faults/Second';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := '  ';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;


      time_interval_sec := $real(user_copy_of_server_data.time) / 1000000.0;
      pf_sum := 0;
      FOR i := LOWERBOUND (queue_id) TO UPPERBOUND (queue_id) DO
        line (1, * ) := '     ';
        pf_sum := pf_sum + user_copy_of_server_data.pf_stats [i];
        IF time_interval_sec <> 0.0 THEN
            pf_rate := $real(user_copy_of_server_data.pf_stats [i]) / time_interval_sec;
          ELSE
            pf_rate := 0.0;
        IFEND;
        STRINGREP (line,length,
                        ' ',queue_id [i],
                        ' ',user_copy_of_server_data.pf_stats [i]:20,
                        ' ',pf_rate:20:1);
        clp$put_display (display_control, line (1, 80), clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

      FOREND;

      line := ' ';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      IF time_interval_sec <> 0.0 THEN
          pf_rate := $real(pf_sum) / time_interval_sec;
        ELSE
          pf_rate := 0.0;
      IFEND;
      STRINGREP (line,length,
                      ' ','   Total Server Page Faults ',
                      ' ',pf_sum:20,
                      ' ',pf_rate:20:1);
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

    PROCEND format_system_pf_data;


?? EJECT, TITLE := '    PROCEDURE format_system_paging_data ' ??

    PROCEDURE format_system_paging_data (
          user_copy_of_data: ost$paging_stats;
      VAR display_control: clt$display_control;
      VAR status: ost$status);

      VAR
        line: string (80),
        i,
        length: integer,
        time_interval_sec,
        ps_rate: real,
        ps_count: array [1..mmc$page_streaming_counters+1] of integer,
        ps_source_header1: [STATIC, READ, oss$job_paged_literal] string(40) :=
          '   PAGING STATISTICS, SOURCE OF PAGES ',
        ps_source_header2: [STATIC, READ, oss$job_paged_literal] string(42) :=
          'Number of pages acquired by each process',
        ps_source_header3: [STATIC, READ, oss$job_paged_literal] string(78) :=
{                      } '  Page Source           Nominal        Page         Advise          TOTALS',
        ps_source_header4: [STATIC, READ, oss$job_paged_literal] string(78) :=
{                      } '                      Page Fault    Streaming         IN          PAGES   /sec',
        total_pf: integer,
        total_ps: integer,
        total_ai: integer,
        source_title: [STATIC, READ, oss$job_paged_literal] array[1..5] of string(17):=
{              } ['Pages from disk  ',
{               } 'Pages reclaimed  ',
{               } 'Pages assigned   ',
{               } 'Pages from server',
{               } '   Process TOTALS'  ],
        ps_title:[STATIC, READ, oss$job_paged_literal] array[1..mmc$page_streaming_counters+1] of string(52):=
{              } ['   Page Streaming prestream mode initiated ',
{               } '   Page Streaming mode initiated   ',
{               } '   Prestream mode ended without initiating streaming',
{               } '   Page Streaming mode ended by random page faults',
{               } '   Pages read in page streaming prestream mode',
{               } '   Pages read in page streaming mode',
{               } '   Task slower than rate of page streaming',
{               } '   Page fault at lower address in same transfer unit',
{               } '   Pages freed behind ',
{               } '   Page Streaming mode continued after random fault'   ],
        ps_title2:[STATIC, READ, oss$job_paged_literal] array[1..2] of string(52):=
{              } ['   Average number of pages per prestream mode:',
{               } '   Average number of pages per page streaming mode:'   ];

      time_interval_sec := $real(user_copy_of_data.time) / 1000000.0;
      clp$new_display_page (display_control, status);
      line := ' ';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      line(22, 40) := ps_source_header1;
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := '  ';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      line(22,42) := ps_source_header2;
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line(2,79) := ps_source_header3;
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line(2,79) := ps_source_header4;
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      IF time_interval_sec <> 0.0 THEN
        ps_rate := $real(user_copy_of_data.p_stats.pf_pages.disk + user_copy_of_data.p_stats.ps_pages.disk +
              user_copy_of_data.p_stats.ai_pages.disk ) / time_interval_sec;
      ELSE
        ps_rate := 0.0;
      IFEND;
      STRINGREP (line,length, ' ',source_title [1],                             { Page from disk}
            '   ', user_copy_of_data.p_stats.pf_pages.disk:12,
            ' ', user_copy_of_data.p_stats.ps_pages.disk:12,
            ' ', user_copy_of_data.p_stats.ai_pages.disk:12,
            ' ', (user_copy_of_data.p_stats.pf_pages.disk + user_copy_of_data.p_stats.ps_pages.disk +
                 user_copy_of_data.p_stats.ai_pages.disk ):12,
            ' ',ps_rate:7:1);
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      IF time_interval_sec <> 0.0 THEN
        ps_rate := $real(user_copy_of_data.p_stats.pf_pages.reclaim +
              user_copy_of_data.p_stats.ps_pages.reclaim  +
              user_copy_of_data.p_stats.ai_pages.reclaim ) / time_interval_sec;
      ELSE
        ps_rate := 0.0;
      IFEND;
      STRINGREP (line,length, ' ',source_title [2],                             { Pages reclaimed}
            '   ', user_copy_of_data.p_stats.pf_pages.reclaim:12,
            ' ', user_copy_of_data.p_stats.ps_pages.reclaim:12,
            ' ', user_copy_of_data.p_stats.ai_pages.reclaim:12,
            ' ', (user_copy_of_data.p_stats.pf_pages.reclaim + user_copy_of_data.p_stats.ps_pages.reclaim +
                 user_copy_of_data.p_stats.ai_pages.reclaim ):12,
            ' ',ps_rate:7:1);
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      IF time_interval_sec <> 0.0 THEN
        ps_rate := $real(user_copy_of_data.p_stats.pf_pages.new +
              user_copy_of_data.p_stats.ps_pages.new  +
              user_copy_of_data.p_stats.ai_pages.new ) / time_interval_sec;
      ELSE
        ps_rate := 0.0;
      IFEND;
      STRINGREP (line,length, ' ',source_title [3],                             { Pages assigned}
            '   ', user_copy_of_data.p_stats.pf_pages.new:12,
            ' ', user_copy_of_data.p_stats.ps_pages.new:12,
            ' ', user_copy_of_data.p_stats.ai_pages.new:12,
            ' ', (user_copy_of_data.p_stats.pf_pages.new + user_copy_of_data.p_stats.ps_pages.new +
                 user_copy_of_data.p_stats.ai_pages.new ):12,
            ' ',ps_rate:7:1);
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      IF time_interval_sec <> 0.0 THEN
        ps_rate := $real(user_copy_of_data.p_stats.pf_pages.server +
              user_copy_of_data.p_stats.ps_pages.server +
              user_copy_of_data.p_stats.ai_pages.server ) / time_interval_sec;
      ELSE
        ps_rate := 0.0;
      IFEND;
      STRINGREP (line,length, ' ',source_title [4],                             { Pages from server}
            '   ', user_copy_of_data.p_stats.pf_pages.server:12,
            ' ', user_copy_of_data.p_stats.ps_pages.server:12,
            ' ', user_copy_of_data.p_stats.ai_pages.server:12,
            ' ', (user_copy_of_data.p_stats.pf_pages.server + user_copy_of_data.p_stats.ps_pages.server +
                 user_copy_of_data.p_stats.ai_pages.server ):12,
            ' ',ps_rate:7:1);
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := '  ';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      total_pf := user_copy_of_data.p_stats.pf_pages.disk + user_copy_of_data.p_stats.pf_pages.reclaim +
                  user_copy_of_data.p_stats.pf_pages.new + user_copy_of_data.p_stats.pf_pages.server;
      total_ps := user_copy_of_data.p_stats.ps_pages.disk + user_copy_of_data.p_stats.ps_pages.reclaim +
                  user_copy_of_data.p_stats.ps_pages.new + user_copy_of_data.p_stats.ps_pages.server;
      total_ai := user_copy_of_data.p_stats.ai_pages.disk + user_copy_of_data.p_stats.ai_pages.reclaim +
                  user_copy_of_data.p_stats.ai_pages.new + user_copy_of_data.p_stats.ai_pages.server;

      line := ' ';
      IF time_interval_sec <> 0.0 THEN
        ps_rate := $real(total_pf + total_ps + total_ai)  / time_interval_sec;
      ELSE
        ps_rate := 0.0;
      IFEND;
      STRINGREP (line,length, ' ',source_title [5], '   ',                               {   Process TOTALS}
            total_pf:12, ' ', total_ps:12, ' ', total_ai:12,  ' ',
            ( total_pf + total_ps + total_ai ):12,
            ' ',ps_rate:7:1);
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := '  ';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      line(22, 39) := 'PAGING STATISTICS, PAGE STREAMING DATA';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      line(4,15) := 'Page Streaming Counter';
      line(60,5) := 'Count';
      line(68,13) := 'Counts/Second';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := '  ';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      ps_count[1] := user_copy_of_data.p_stats.page_streaming.initiated +
                     user_copy_of_data.p_stats.page_streaming.prestream_only;
      ps_count[2] := user_copy_of_data.p_stats.page_streaming.initiated;
      ps_count[3] := user_copy_of_data.p_stats.page_streaming.prestream_only;
      ps_count[4] := user_copy_of_data.p_stats.page_streaming.terminated;
      ps_count[5] := user_copy_of_data.p_stats.page_streaming.pages_prestream;
      ps_count[6] := user_copy_of_data.p_stats.page_streaming.pages_streaming;
      ps_count[7] := user_copy_of_data.p_stats.page_streaming.task_slow;
      ps_count[8] := user_copy_of_data.p_stats.page_streaming.page_faults_tu;
      ps_count[9]:= user_copy_of_data.p_stats.page_streaming.pages_freed_behind;
      ps_count[10]:= user_copy_of_data.p_stats.page_streaming.random_faults;
      FOR i := LOWERBOUND (ps_count) TO UPPERBOUND (ps_count) DO
        line (1, * ) := '     ';
        IF time_interval_sec <> 0.0 THEN
          ps_rate := $real(ps_count [i]) / time_interval_sec;
        ELSE
          ps_rate := 0.0;
        IFEND;
        STRINGREP (line,length, ' ',ps_title [i],
                        ' ',ps_count [i]:12,
                        '  ',ps_rate:12:1);
        clp$put_display (display_control, line (1, 80), clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      FOREND;

      line := '  ';
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      IF ps_count[1] > 0 THEN
        ps_rate := $real(user_copy_of_data.p_stats.page_streaming.pages_prestream) / $real(ps_count[1]);
      ELSE
        ps_rate := 0.0;
      IFEND;
      STRINGREP (line,length, ' ',ps_title2[1], '  ',ps_rate:8:1);
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      line := '  ';
      IF ps_count[2] > 0 THEN
        ps_rate := $real(user_copy_of_data.p_stats.page_streaming.pages_streaming) / $real(ps_count[2]);
      ELSE
        ps_rate := 0.0;
      IFEND;
      STRINGREP (line,length, ' ',ps_title2[2], '  ',ps_rate:8:1);
      clp$put_display (display_control, line (1, 80), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

    PROCEND format_system_paging_data;


?? EJECT, TITLE := '    PROCEDURE format_system_mr_data' ??

    PROCEDURE format_system_mr_data (
          user_copy_of_data: ost$mtr_stats;
      VAR display_control: clt$display_control;
      VAR status: ost$status);

*copyc syc$monitor_request_codes

      VAR
        first_time: boolean,
        title_line: string (75),
        line: string (100),
        string_rep2: string (10),
        string_rep3: string (10),
        string_rep4: string (15),
        string_rep5: string (10),
        aver,
        mtr_cpu_sum,
        mtr_count_sum,
        sum: integer,
        percent,
        aver_real,
        interval_in_seconds,
        request_rate,
        sum_real: real,
        aver_time,
        length,
        i: integer,
        request_id: [STATIC, READ, oss$job_paged_literal] array [0 .. syc$rc_maximum_value] of string (20) :=
{ 0           } ['illegal_request     ',
{ 1            } 'cycle               ',
{ 2            } 'delay               ',
{ 3            } 'unused 03           ',
{ 4            } 'device_io           ',
{ 5            } 'advise_in           ',
{ 6            } 'advise_out          ',
{ 7            } 'advise_out_in       ',
{ 8            } 'initiate_task       ',
{ 9            } 'page_fault          ',
{10            } 'initiate_job        ',
{11            } 'exit_job            ',
{12            } 'free_pages          ',
{13            } 'write_modified_pages',
{14            } 'change_segment_table',
{15            } 'check_active_pps    ',
{16            } 'unused 16           ',
{17            } 'unused 17           ',
{18            } 'job_swapping_fns    ',
{19            } 'idle_resume_system  ',
{20            } 'mcr/ucr_fault       ',
{21            } 'system_error        ',
{22            } 'update_task_stats   ',
{23            } 'unused 23           ',
{24            } 'unused 24           ',
{25            } 'ready_task          ',
{26            } 'set_system_flag     ',
{27            } 'wait                ',
{28            } 'lock_ring_1_stack   ',
{29            } 'mtr_send_signal     ',
{30            } 'set_get_sgmnt_length',
{31            } 'read_write_io       ',
{32            } 'job_recovery        ',
{33            } 'ring_1_sgmnt_request',
{34            } 'task_exit           ',
{35            } 'unused 35           ',
{36            } 'update_xp_register  ',
{37            } 'segment_request     ',
{38            } 'lock_pages          ',
{39            } 'unlock_pages        ',
{40            } 'fetch_unwritten_pgs ',
{41            } 'allocate_front_end  ',
{42            } 'deallocate_front_end',
{43            } 'apply_mat_changes   ',
{44            } 'tape_io             ',
{45            } 'translate_byte_addr ',
{46            } 'config_mgmt_request ',
{47            } 'manage_system_tasks ',
{48            } 'lock_unlock_segment ',
{49            } 'issue_dft_request   ',
{50            } 'wait_io_completion  ',
{51            } 'switch_task         ',
{52            } 'short_warning       ',
{53            } 'monitor_sys_status  ',
{54            } 'process_io          ',
{55            } 'display_request     ',
{56            } 'process_scd_block   ',
{57            } 'keypoint_recorder   ',
{58            } 'periodic_call       ',
{59            } 'process_due         ',
{60            } 'unused 60           ',
{61            } 'monitor_swap_reqs   ',
{62            } 'monitor_mode_ei     ',
{63            } 'unused 63           ',
{64            } 'io_subsys_processor ',
{65            } 'access_logging_data ',
{66            } 'process_dft_entry   ',
{67            } 'job_scheduler_req   ',
{68            } 'fetch_offset_mod_pgs',
{69            } 'assign pages        ',
{70            } 'conditional free    ',
{71            } 'rhfam queue I/O data',
{72            } 'unused 72           ',
{73            } 'file server request ',
{74            } 'move pages          ',
{75            } 'assign contiguous   ',
{76            } 'reallocate file     ',
{77            } 'ring_1_server_seg_rq',
{78            } 'mntr_cpu_self_state ',
{79            } 'stats facility req  ',
{80            } 'sys deadstart status',
{81            } 'service class stats ',
{82            } 'unused request_82   ',
{83            } 'unused request_83   ',
{84            } 'unused request_84   ',
{85            } 'unused request_85   ',
{86            } 'quick sweep         ',
{86            } 'ready_task_list     '];

   sum := 0;
   aver := 0;
   percent := 0.0;
   mtr_cpu_sum := 0;
   mtr_count_sum := 0;
      line (1, * ) := '    ';
      line (10, 7) := 'Request';
      line (27, 5) := 'Count';
      line (36, 7) := 'Aver_us';
      line (51, 6) := 'Max_us';
      line (64,6) := 'Pct_us';
      line (73,7) := 'Cnt/Sec';


      IF display_control.page_width > 80 THEN
         line (90, 8) := 'Total_us';
         clp$put_display (display_control, line (1, 100), clc$trim, status);
         IF NOT status.normal THEN
            RETURN;
         IFEND;
      ELSE
         clp$put_display (display_control, line (1, 80), clc$trim, status);
         IF NOT status.normal THEN
            RETURN;
         IFEND;
      IFEND;

      line (1, * ) := '    ';
      clp$put_display (display_control, line (1, 58), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

  FOR i := LOWERBOUND (request_id) TO UPPERBOUND (request_id) DO
    IF user_copy_of_data.mtr_reqs [i].count <> 0 THEN
      mtr_cpu_sum := mtr_cpu_sum + user_copy_of_data.mtr_reqs [i].total_cpu_time;
      mtr_count_sum := mtr_count_sum + user_copy_of_data.mtr_reqs [i].count;
    IFEND;
  FOREND;

  interval_in_seconds := $real(user_copy_of_data.time)/1000000.0;
  FOR i := LOWERBOUND (request_id) TO UPPERBOUND (request_id) DO
    IF user_copy_of_data.mtr_reqs [i].count <> 0 THEN
      line (1, * ) := '    ';
      line (2, 20) := request_id [i];
      STRINGREP (string_rep2, length, user_copy_of_data.mtr_reqs [i].count);
      line ((32 - length), length) := string_rep2;

      aver_time := user_copy_of_data.mtr_reqs [i].total_cpu_time DIV user_copy_of_data.mtr_reqs [i].count;
      STRINGREP (string_rep3, length, aver_time);
      line ((43 - length), length) := string_rep3;

      STRINGREP (string_rep4, length, user_copy_of_data.mtr_reqs [i].max_time);
      line ((59 - length), length) := string_rep4;

      IF mtr_cpu_sum <> 0 THEN
          percent := 100.0 * $real(user_copy_of_data.mtr_reqs [i].total_cpu_time) / $real(mtr_cpu_sum);
        ELSE
          percent := 0.0;
      IFEND;
      STRINGREP(string_rep5, length, percent:10:2);
      line((70 - length), length) := string_rep5;

      string_rep2 := ' ';
      IF interval_in_seconds <> 0.0 THEN
          request_rate := $real(user_copy_of_data.mtr_reqs [i].count)/interval_in_seconds;
        ELSE
          request_rate := 0.0;
      IFEND;
      STRINGREP (string_rep2, length, request_rate:10:1);
      line ((80 - length), length) := string_rep2;

      IF display_control.page_width > 80 THEN
         string_rep4 := '  ';
         STRINGREP (string_rep4, length, user_copy_of_data.mtr_reqs [i].total_cpu_time);
         line ((96 - length), length) := string_rep4;

         clp$put_display (display_control, line (1, 100), clc$trim, status);
         IF NOT status.normal THEN
            RETURN;
         IFEND;
       ELSE
         clp$put_display (display_control, line (1, 80), clc$trim, status);
         IF NOT status.normal THEN
            RETURN;
         IFEND;
       IFEND;
    IFEND;
  FOREND;

  line := '  ';
  line(2,5) := 'Total';
  string_rep2 := ' ';
  STRINGREP (string_rep2, length, mtr_count_sum);
  line ((32 - length), length) := string_rep2;

  string_rep2 := ' ';
  IF interval_in_seconds <> 0.0 THEN
      request_rate := $real(mtr_count_sum)/interval_in_seconds;
    ELSE
      request_rate := 0.0;
  IFEND;
  STRINGREP (string_rep2, length, request_rate:10:1);
  line ((80 - length), length) := string_rep2;

  IF display_control.page_width > 80 THEN
     string_rep4 := '  ';
     STRINGREP(string_rep4, length, mtr_cpu_sum);
     line((96 - length), length) := string_rep4;

     clp$put_display (display_control, line (1, 100), clc$trim, status);
     IF NOT status.normal THEN
        RETURN;
     IFEND;
  ELSE
     clp$put_display (display_control, line (1, 80), clc$trim, status);
     IF NOT status.normal THEN
        RETURN;
     IFEND;
  IFEND;


    PROCEND format_system_mr_data;

?? EJECT, TITLE := '    PROCEDURE format_system_as_data' ??

    PROCEDURE format_system_as_data (
          user_copy_of_data: ost$aging_stats;
      VAR display_control: clt$display_control;
      VAR status: ost$status);

      VAR
        length: integer,
        line: string (75),
        queue: mmt$page_frame_queue_id,
        string_rep2: string (20);

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.force_aggressive_aging);
      line ((22 - length), length) := string_rep2;
      line (24, 25) := '   force_aggressive_aging';
      clp$put_display (display_control, line (1, 48), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.aggressive_age_shared_queue);
      line ((22 - length), length) := string_rep2;
      line (24, 30) := '   aggressive_age_shared_queue';
      clp$put_display (display_control, line (1, 53), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.aggressive_age_job_queues);
      line ((22 - length), length) := string_rep2;
      line (24, 28) := '   aggressive_age_job_queues';
      clp$put_display (display_control, line (1, 51), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.aggressive_aging_failed);
      line ((22 - length), length) := string_rep2;
      line (24, 26) := '   aggressive_aging_failed';
      clp$put_display (display_control, line (1, 49), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.age_cp_bound_job);
      line ((22 - length), length) := string_rep2;
      line (24, 19) := '   age_cp_bound_job';
      clp$put_display (display_control, line (1, 42), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.remove_unmodified_page_from_ws);
      line ((22 - length), length) := string_rep2;
      line (24, 33) := '   remove_unmodified_page_from_ws';
      clp$put_display (display_control, line (1, 56), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.remove_modified_page_from_ws);
      line ((22 - length), length) := string_rep2;
      line (24, 31) := '   remove_modified_page_from_ws';
      clp$put_display (display_control, line (1, 54), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.page_written_to_disk);
      line ((22 - length), length) := string_rep2;
      line (24, 23) := '   page_written_to_disk';
      clp$put_display (display_control, line (1, 46), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.multiple_pages_written_to_disk);
      line ((22 - length), length) := string_rep2;
      line (24, 33) := '   multiple_pages_written_to_disk';
      clp$put_display (display_control, line (1, 56), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.calls_to_age_jws);
      line ((22 - length), length) := string_rep2;
      line (24, 19) := '   calls_to_age_jws';
      clp$put_display (display_control, line (1, 42), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.age_exceeds_aif);
      line ((22 - length), length) := string_rep2;
      line (24, 18) := '   age_exceeds_aif';
      clp$put_display (display_control, line (1, 41), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.age_exceeds_aic);
      line ((22 - length), length) := string_rep2;
      line (24, 18) := '   age_exceeds_aic';
      clp$put_display (display_control, line (1, 41), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.age_unused_page_in_shared_queue);
      line ((22 - length), length) := string_rep2;
      line (24, 34) := '   age_unused_page_in_shared_queue';
      clp$put_display (display_control, line (1, 57), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      FOR queue := mmc$pq_shared_first TO mmc$pq_shared_last_sys DO
        line (1, * ) := '     ';
        STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.age_sys_shared_queue [queue]);
        line ((22 - length), length) := string_rep2;
        line (24, 22) := '   age_sys_shared_queue';

        CASE queue OF
        = mmc$pq_shared_task_service =
          line (48, 20) := ' Task Service';
        = mmc$pq_shared_pf_execute =
          line (48, 20) := ' Executable File';
        = mmc$pq_shared_pf_non_execute =
          line (48, 20) := ' Non Executable File';
        = mmc$pq_shared_device_file =
          line (48, 20) := ' Device File';
        = mmc$pq_shared_file_server =
          line (48, 20) := ' File Server';
        = mmc$pq_shared_other =
          line (48, 20) := ' Other';
        ELSE
        CASEND;

        clp$put_display (display_control, line (1, 67), clc$trim, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;
      FOREND;

      line (1, * ) := '   ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.write_aged_out_page);
      line ((22 - length), length) := string_rep2;
      line (24, 22) := '   write_aged_out_page';
      clp$put_display (display_control, line (1, 45), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '   ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.write_forced_out_page);
      line ((22 - length), length) := string_rep2;
      line (24, 24) := '   write_forced_out_page';
      clp$put_display (display_control, line (1, 47), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '   ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.write_pt_full_page);
      line ((22 - length), length) := string_rep2;
      line (24, 21) := '   write_pt_full_page';
      clp$put_display (display_control, line (1, 44), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '   ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.write_avail_mod_page);
      line ((22 - length), length) := string_rep2;
      line (24, 23) := '   write_avail_mod_page';
      clp$put_display (display_control, line (1, 46), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '   ';
      STRINGREP (string_rep2, length, user_copy_of_data.aging_stats.write_page_failed);
      line ((22 - length), length) := string_rep2;
      line (24, 20) := '   write_page_failed';
      clp$put_display (display_control, line (1, 43), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;


    PROCEND format_system_as_data;

?? EJECT, TITLE := '    PROCEDURE format_job_data' ??

    PROCEDURE format_job_data (
          user_copy_of_data: ost$job_stats;
      VAR display_control: clt$display_control;
      VAR status: ost$status);

      VAR
        line: string (75),
        temp1,
        temp2,
        length1,
        length2,
        length: integer,
        string_rep1,
        string_rep2,
        string_rep3,
        string_rep4,
        string_rep5,
        string_rep6,
        string_rep7,
        string_rep8,
        string_rep9: string (15);

      line (1, * ) := '     ';
      line (16, 40) := '000000     time spent in job mode (secs)';
      temp1 := user_copy_of_data.job_data.cp_time.time_spent_in_job_mode DIV 1000000;
      STRINGREP (string_rep1, length1, temp1);
      temp2 := user_copy_of_data.job_data.cp_time.time_spent_in_job_mode MOD 1000000;
      STRINGREP (string_rep2, length2, temp2);
      line ((15 - length1), length1) := string_rep1;
      line ((23 - length2), (length2 - 1)) := string_rep2 (2, (length2 - 1));
      line (15, 1) := '.';
      clp$put_display (display_control, line (1, 56), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '     ';
      line (16, 40) := '000000     time spent in mtr mode (secs)';
      temp1 := user_copy_of_data.job_data.cp_time.time_spent_in_mtr_mode DIV 1000000;
      STRINGREP (string_rep3, length1, temp1);
      temp2 := user_copy_of_data.job_data.cp_time.time_spent_in_mtr_mode MOD 1000000;
      STRINGREP (string_rep4, length2, temp2);
      line ((15 - length1), length1) := string_rep3;
      line ((23 - length2), (length2 - 1)) := string_rep4 (2, (length2 - 1));
      line (15, 1) := '.';
      clp$put_display (display_control, line (1, 56), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '    ';
      STRINGREP (string_rep5, length, user_copy_of_data.job_data.paging_statistics.page_in_count);
      line ((22 - length), length) := string_rep5;
      line (24, 38) := '   page in count(pages read from disk)';
      clp$put_display (display_control, line (1, 61), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;


      line (1, * ) := '    ';
      STRINGREP (string_rep6, length, user_copy_of_data.job_data.paging_statistics.
            pages_reclaimed_from_queue);
      line ((22 - length), length) := string_rep6;
      line (24, 37) := '   pages reclaimed from queue ';
      clp$put_display (display_control, line (1, 60), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '    ';
      STRINGREP (string_rep7, length, user_copy_of_data.job_data.paging_statistics.new_pages_assigned);
      line ((22 - length), length) := string_rep7;
      line (24, 29) := '   new pages assigned ';
      clp$put_display (display_control, line (1, 52), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '    ';
      STRINGREP (string_rep5, length, user_copy_of_data.job_data.paging_statistics.pages_from_server);
      line ((22 - length), length) := string_rep5;
      line (24, 28) := '   pages read in from server';
      clp$put_display (display_control, line (1, 51), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '    ';
      STRINGREP (string_rep5, length, user_copy_of_data.job_data.paging_statistics.page_fault_count);
      line ((22 - length), length) := string_rep5;
      line (24, 30) := '   total number of page faults';
      clp$put_display (display_control, line (1, 53), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      STRINGREP (line, length, user_copy_of_data.job_data.paging_statistics.working_set_max_used:21,
                       '     maximum working set actually used (pages)');
      clp$put_display (display_control, line (1, length), clc$no_trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '    ';
      STRINGREP (string_rep8, length, user_copy_of_data.job_data.working_set_size);
      line ((22 - length), length) := string_rep8;
      line (24, 27) := '   working set size (pages)';
      clp$put_display (display_control, line (1, 50), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;


      line (1, * ) := '    ';
      STRINGREP (string_rep9, length, user_copy_of_data.job_data.ready_task_count);
      line ((22 - length), length) := string_rep9;
      line (24, 19) := '   ready task count';
      clp$put_display (display_control, line (1, 42), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

    PROCEND format_job_data;

?? EJECT, TITLE := '    PROCEDURE format_jm_mm_statistics' ??

    PROCEDURE format_jm_mm_statistics (
          user_copy_of_data: ost$jm_mm_stats;
      VAR display_control: clt$display_control;
      VAR status: ost$status);

      VAR
        bytes: integer,
        byte_sum: integer,
        bytes_per_page: ost$page_size,
        job_info_returned: boolean,
        length: integer,
        line: string (75),
        local_copy: ost$jm_mm_stats,
        page_sum: integer,
        pages: integer,
        queue_id: mmt$page_frame_queue_id,
        site_queues_active: 0 ..255,
        string_rep: string (20);

      VAR
        queues: [STATIC, READ, oss$job_paged_literal] array [mmt$page_frame_queue_id] OF
              string (25) := [
{             } 'Free Queue',
{             } 'Available Queue',
{             } 'Available Modified Queue',
{             } 'Wired Queue',
{             } 'Task Service Shared Queue',
{             } 'Executable File Shared Q.',
{             } 'Non-Executable File S. Q.',
{             } 'Device File Shared Queue',
{             } 'File Server Shared Queue',
{             } 'Other System Shared Queue',
{             } 'Site_01 Shared Queue',
{             } 'Site_02 Shared Queue',
{             } 'Site_03 Shared Queue',
{             } 'Site_04 Shared Queue',
{             } 'Site_05 Shared Queue',
{             } 'Site_06 Shared Queue',
{             } 'Site_07 Shared Queue',
{             } 'Site_08 Shared Queue',
{             } 'Site_09 Shared Queue',
{             } 'Site_10 Shared Queue',
{             } 'Site_11 Shared Queue',
{             } 'Site_12 Shared Queue',
{             } 'Site_13 Shared Queue',
{             } 'Site_14 Shared Queue',
{             } 'Site_15 Shared Queue',
{             } 'Site_16 Shared Queue',
{             } 'Site_17 Shared Queue',
{             } 'Site_18 Shared Queue',
{             } 'Site_19 Shared Queue',
{             } 'Site_20 Shared Queue',
{             } 'Site_21 Shared Queue',
{             } 'Site_22 Shared Queue',
{             } 'Site_23 Shared Queue',
{             } 'Site_24 Shared Queue',
{             } 'Site_25 Shared Queue',
{             } 'Shared IO Error Queue',
{             } 'Swapped IO Error Queue',
{             } 'Flawed Queue',
{             } 'Job Fixed Queue',
{             } 'Job IO Error Queue',
{             } 'Job Working Set Queue'];

      bytes_per_page := 512 * (128 - #read_register(osc$pr_page_size_mask));
      status.normal := TRUE;
      local_copy := user_copy_of_data;
      line (1, * ) := '   ';
      line (2, 35) := 'Size of Memory Manager Page Queues:';
      clp$put_display (display_control, line (1, 36), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := ' ';
      line(5,10) := 'Page Queue';
      line(40,10) := 'Page Count';
      line(60,10) := 'Byte Count';
      clp$put_display (display_control, line (1, 75), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      page_sum := 0;
      site_queues_active := local_copy.jm_mm_stats.page_q_counts.site_defined_queues_active;

    /queue_loop/
      FOR queue_id := LOWERBOUND (queues) TO UPPERBOUND (queues) DO
        line (1, * ) := '   ';
        pages := local_copy.jm_mm_stats.page_q_counts.q_counts [queue_id];
        IF (queue_id >= mmc$pq_shared_first_site) AND
              (queue_id > mmc$pq_shared_last_sys + site_queues_active) AND
              (queue_id <= mmc$pq_shared_last_site) THEN
          CYCLE /queue_loop/;
        IFEND;
        bytes := bytes_per_page * pages;
        page_sum := page_sum + pages;
        STRINGREP (string_rep, length, pages);
        line ((50 - length), length) := string_rep;
        STRINGREP (string_rep, length, bytes);
        line ((70 - length), length) := string_rep;
        line (2, 25) := queues [queue_id];
        clp$put_display (display_control, line (1, 75), clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      FOREND /queue_loop/;

      line (1, * ) := ' Swap Resident Queue';
      page_sum := page_sum + local_copy.jm_mm_stats.page_q_counts.swap_resident_count;
      STRINGREP (string_rep, length, local_copy.jm_mm_stats.page_q_counts.swap_resident_count);
      line ((50 - length), length) := string_rep;
      bytes := bytes_per_page * local_copy.jm_mm_stats.page_q_counts.swap_resident_count;
      STRINGREP (string_rep, length, bytes);
      line ((70 - length), length) := string_rep;
      clp$put_display (display_control, line (1, 75), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      line (1, * ) := ' Long Wait Queue';
      page_sum := page_sum + local_copy.jm_mm_stats.page_q_counts.long_wait_count;
      STRINGREP (string_rep, length, local_copy.jm_mm_stats.page_q_counts.long_wait_count);
      line ((50 - length), length) := string_rep;
      bytes := bytes_per_page * local_copy.jm_mm_stats.page_q_counts.long_wait_count;
      STRINGREP (string_rep, length, bytes);
      line ((70 - length), length) := string_rep;
      clp$put_display (display_control, line (1, 75), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line := '  ';
      STRINGREP (string_rep, length, page_sum);
      line ((50 - length), length) := string_rep;
      byte_sum := page_sum * bytes_per_page;
      STRINGREP (string_rep, length, byte_sum);
      line ((70 - length), length) := string_rep;
      line (2, 14) := '   Totals     ';
      clp$put_display (display_control, line (1, 75), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := ' Subtotal of the System Shared Queues';
      pages := 0;
      FOR j := mmc$pq_shared_first  TO  mmc$pq_shared_last_sys  DO
        pages := pages + local_copy.jm_mm_stats.page_q_counts.q_counts [j];
      FOREND;
      bytes := bytes_per_page * pages;
      STRINGREP (string_rep, length, pages);
      line ((50 - length), length) := string_rep;
      STRINGREP (string_rep, length, bytes);
      line ((70 - length), length) := string_rep;
      clp$put_display (display_control, line (1, 75), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      IF site_queues_active <> 0 THEN
        line (1, * ) := ' Subtotal of the Site Defined Shared Queues';
        pages := 0;
        FOR j := mmc$pq_shared_first_site TO mmc$pq_shared_first_site +
              site_queues_active - 1 DO
          pages := pages + local_copy.jm_mm_stats.page_q_counts.q_counts [j];
        FOREND;
        bytes := bytes_per_page * pages;
        STRINGREP (string_rep, length, pages);
        line ((50 - length), length) := string_rep;
        STRINGREP (string_rep, length, bytes);
        line ((70 - length), length) := string_rep;
        clp$put_display (display_control, line (1, 75), clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      IFEND;


      job_info_returned := (local_copy.jm_mm_stats.total_system_class > 0) OR (local_copy.jm_mm_stats.
            total_interactive_jobs > 0) OR (local_copy.jm_mm_stats.total_non_interactive_jobs > 0);

      IF job_info_returned THEN
        line (1, * ) := '   ';
        line (2, 34) := 'Jobs in the System (by Job Mode): ';
        clp$put_display (display_control, line (1, 35), clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF local_copy.jm_mm_stats.total_system_class > 0 THEN
          line (1, * ) := '   ';
          STRINGREP (string_rep, length, local_copy.jm_mm_stats.total_system_class);
          line ((22 - length), length) := string_rep;
          line (24, 6) := 'System';
          clp$put_display (display_control, line (1, 30), clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        IFEND;

        IF local_copy.jm_mm_stats.total_interactive_jobs > 0 THEN
          line (1, * ) := '   ';
          STRINGREP (string_rep, length, local_copy.jm_mm_stats.total_interactive_jobs);
          line ((22 - length), length) := string_rep;
          line (24, 11) := 'Interactive';
          clp$put_display (display_control, line (1, 35), clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        IFEND;

        IF local_copy.jm_mm_stats.total_non_interactive_jobs > 0 THEN
          line (1, * ) := '   ';
          STRINGREP (string_rep, length, local_copy.jm_mm_stats.total_non_interactive_jobs);
          line ((22 - length), length) := string_rep;
          line (24, 15) := 'Non Interactive';
          clp$put_display (display_control, line (1, 39), clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        IFEND;


        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      IFEND;

      line (1, * ) := '   ';
      line (2, 22) := 'Number of Active Jobs:';
      STRINGREP (string_rep, length, local_copy.jm_mm_stats.total_active_jobs);
      line (26, length) := string_rep;
      clp$put_display (display_control, line (1, (26 + length)), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '   ';
      STRINGREP (string_rep, length, local_copy.jm_mm_stats.total_swapped_jobs);
      line (31, length) := string_rep;
      line (2, 27) := 'Number of Jobs Swapped Out:';
      clp$put_display (display_control, line (1, (31 + length)), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '   ';
      line (2, 32) := 'Number of Ready/Executing Tasks:';
      STRINGREP (string_rep, length, local_copy.jm_mm_stats.total_ready_tasks);
      line (36, length) := string_rep;
      clp$put_display (display_control, line (1, (37 + length)), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      line (1, * ) := '   ';
      line (2, 34) := 'Number of Ready But Swapped Tasks:';
      STRINGREP (string_rep, length, local_copy.jm_mm_stats.total_ready_but_swapped_tasks);
      line (38, length) := string_rep;
      clp$put_display (display_control, line (1, (38 + length)), clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

    PROCEND format_jm_mm_statistics;

?? EJECT, TITLE := '    PROCEDURE format_cpu_statistics' ??

    PROCEDURE format_cpu_statistics (
          user_copy_of_data: ost$cpu_stats;
      VAR display_control: clt$display_control;
      VAR status: ost$status);

      VAR
        average: integer,
        cpu_count: integer,
        dp: jmt$dispatching_priority,
        i: integer,
        job_mode_cp_sum : integer,
        job_mode_percentage_sum: real,
        length: integer,
        mtr_mode_cp_sum : integer,
        mtr_mode_percentage_sum: real,
        percentage: real,
        percentage2: real,
        percentage3: real,
        percentage_divisor: real,
        s: string (65),
        string_rep2: string (20),
        string_rep3: string (6),
        priority_id: [STATIC, READ, oss$job_paged_literal] array
              [jmc$min_dispatching_priority .. jmc$max_dispatching_priority] of string (3) :=
{ 2            } ['P1 ',
{ 3             } 'P2 ',
{ 4             } 'P3 ',
{ 5             } 'P4 ',
{ 6             } 'P5 ',
{ 7             } 'P6 ',
{ 8             } 'P7 ',
{ 9             } 'P8 ',
{10             } 'P9 ',
{11             } 'P10',
{12             } 'P11',
{13             } 'P12',
{14             } 'P13',
{15             } 'P14'];


{ Display statistics for each dispatching priority.

      s (1, * ) := '  ';
      s (1, 60) := ' DISPATCHING     PERCENT CPU           MICROSECONDS CPU TIME';

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

      s (1, * ) := '  ';
      s (1, 60) := '  PRIORITY       JOB     MTR              JOB            MTR';

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

      cpu_count := 0;
      FOR i := 0 TO user_copy_of_data.cpu_stats.cpu_count DO
        IF user_copy_of_data.cpu_stats.processor_defined [i] THEN
          cpu_count := cpu_count + 1;
        IFEND;
      FOREND;

      percentage_divisor := $real(user_copy_of_data.time * cpu_count);

      job_mode_cp_sum := 0;
      job_mode_percentage_sum := 0.0;
      mtr_mode_cp_sum := 0;
      mtr_mode_percentage_sum := 0.0;

      FOR dp := jmc$max_dispatching_priority DOWNTO jmc$min_dispatching_priority DO
        s (1, *) := ' ';
        s (7, 3) := priority_id [dp];
        STRINGREP (string_rep2, length, user_copy_of_data.cpu_stats.cpu_execution_stats [dp].
              time_spent_in_job_mode);
        s ((47 - length), length) := string_rep2;
        IF percentage_divisor <> 0.0 THEN
          percentage := ($real(user_copy_of_data.cpu_stats.cpu_execution_stats [dp].time_spent_in_job_mode *
                100) ) / percentage_divisor  ;
        ELSE
          percentage := 0.0;
        IFEND;
        STRINGREP (s(15,7), length, percentage:6:1, '%');
        job_mode_cp_sum := job_mode_cp_sum + user_copy_of_data.cpu_stats.cpu_execution_stats [dp].
              time_spent_in_job_mode;
        job_mode_percentage_sum := job_mode_percentage_sum + percentage;

        STRINGREP (string_rep2, length, user_copy_of_data.cpu_stats.cpu_execution_stats [dp].
              time_spent_in_mtr_mode);
        s ((62 - length), length) := string_rep2;
        IF percentage_divisor <> 0.0 THEN
          percentage := ($real(user_copy_of_data.cpu_stats.cpu_execution_stats [dp].time_spent_in_mtr_mode *
                100) )  /  percentage_divisor;
        ELSE
          percentage := 0.0;
        IFEND;
        STRINGREP (s(23,7), length, percentage:6:1, '%');
        mtr_mode_cp_sum := mtr_mode_cp_sum + user_copy_of_data.cpu_stats.cpu_execution_stats [dp].
              time_spent_in_mtr_mode;
        mtr_mode_percentage_sum := mtr_mode_percentage_sum + percentage;

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

      FOREND;

      s (1, * ) := '  ';
      clp$put_display (display_control, s, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      s(3,5) := 'TOTAL';
      STRINGREP (s(15,7), length, job_mode_percentage_sum:6:1,'%');
      STRINGREP (s(23,7), length, mtr_mode_percentage_sum:6:1,'%');
      STRINGREP (s(32,15), length, job_mode_cp_sum:15);
      STRINGREP (s(47,15), length, mtr_mode_cp_sum:15);

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

{ Display IDLE statistics.

      s (1, * ) := '  ';
      clp$put_display (display_control, s, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      s (1, * ) := '  ';
      s (1, 61) := '  CPU IDLE       WITH  WITHOUT           WITH         WITHOUT';

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

      s (1, * ) := '  ';
      s (1, 61) := '                  IO     IO               IO             IO  ';

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

      percentage_divisor := $real(user_copy_of_data.time) ;

      FOR i := 0 TO user_copy_of_data.cpu_stats.cpu_count DO
        IF user_copy_of_data.cpu_stats.processor_defined [i] THEN

          s (1, *) := ' ';
          STRINGREP (s (6, 2), length, i);
          STRINGREP (string_rep2, length, user_copy_of_data.cpu_stats.idle_stats [i].idle_io_active);
          s ((47 - length), length) := string_rep2;
          IF percentage_divisor <> 0.0 THEN
            percentage := ($real(user_copy_of_data.cpu_stats.idle_stats [i].idle_io_active * 100)  /
                  percentage_divisor);
          ELSE
            percentage := 0.0;
          IFEND;
          STRINGREP (s(15,7), length, percentage:6:1, '%');

          STRINGREP (string_rep2, length, user_copy_of_data.cpu_stats.idle_stats [i].idle_no_io_active);
          s ((62 - length), length) := string_rep2;
          IF percentage_divisor  <> 0.0 THEN
            percentage := ($real(user_copy_of_data.cpu_stats.idle_stats [i].idle_no_io_active * 100)  /
                  percentage_divisor);
          ELSE
            percentage := 0.0;
          IFEND;
          STRINGREP (s(23,7), length, percentage:6:1, '%');

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

{ Display NOS statistics.

      IF user_copy_of_data.cpu_stats.nos_stats.nos_on THEN
        s (1, * ) := '  ';
        clp$new_display_line (display_control, 3, status);    { skip 3 lines to space NOS data from idle data
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        s := '  NOS state CPU time as a percentage ';
        clp$put_display (display_control, s, clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        s := '    of the Dual-State CPU                   MICROSECONDS CPU TIME';
        clp$put_display (display_control, s, clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF percentage_divisor <> 0.0 THEN
          percentage := ($real(user_copy_of_data.cpu_stats.nos_stats.nos_time_ve_idle * 100) ) /
                percentage_divisor;
          percentage2 := ($real((user_copy_of_data.cpu_stats.nos_stats.nos_time -
                user_copy_of_data.cpu_stats.nos_stats.nos_time_ve_idle) * 100) ) / percentage_divisor;
          percentage3 := ($real(user_copy_of_data.cpu_stats.nos_stats.nos_time * 100) ) / percentage_divisor;
          IF percentage3 > 100.0  THEN
            percentage3 := 100.0  { ensure we do not print something dumb
          IFEND;
          IF percentage2 > 100.0  THEN
            percentage2 := 100.0  { ensure we do not print something dumb
          IFEND;
          IF percentage  > 100.0  THEN
            percentage  := 100.0  { ensure we do not print something dumb
          IFEND;
        ELSE
          percentage := 0.0;
          percentage2:= 0.0;
          percentage3:= 0.0;
        IFEND;
        s := ' ';
        STRINGREP (s,length, '  While NOS/VE idle     ',
                     '  ', percentage:6:1, '%   ',
                     '       ', user_copy_of_data.cpu_stats.nos_stats.nos_time_ve_idle:16);
        clp$put_display (display_control, s, clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        STRINGREP (s,length, '  While NOS/VE NOT idle ',
                     '  ', percentage2:6:1, '%   ',
                     '       ', (user_copy_of_data.cpu_stats.nos_stats.nos_time -
                     user_copy_of_data.cpu_stats.nos_stats.nos_time_ve_idle):16);
        clp$put_display (display_control, s, clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        STRINGREP (s,length, '  Total NOS time        ',
                     '  ', percentage3:6:1, '%   ',
                     '       ', user_copy_of_data.cpu_stats.nos_stats.nos_time:16);
        clp$put_display (display_control, s, clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

      IFEND;

      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

    PROCEND format_cpu_statistics;

?? EJECT, TITLE := '    PROCEDURE format_pio_stats' ??

  PROCEDURE format_pio_stats
    (    user_pp_stats_p: ^ost$disk_pp_stats;
         user_unit_stats_p: ^ost$disk_unit_stats;
         pp_count: integer;
         unit_count: integer;
     VAR display_control: clt$display_control;
     VAR status: ost$status);


    VAR
      length: integer,
      line: string (132),
      local_status: ost$status,
      time_interval: real,
      time_interval_sec: real;

?? EJECT, NEWTITLE := '        PROCEDURE report_path_and_pp_data' ??

    PROCEDURE report_path_and_pp_data;

      TYPE
        path_data_record = record
          line_1: string (132),
          line_2: string (132),
          line_3: string (132),
        recend,

        pp_data_record = record
          line_1: string (132),
          line_2: string (132),
        recend;

      VAR
        active_pp_count: integer,
        active_path_count: integer,
        channel_name: string (5),
        iou_name: string (4),

        path_avg_byte_count_per_req_sum: integer,
        path_avg_response_time_sum: real,
        path_data_p: ^path_data_record,
        path_data_seq_p: ^SEQ ( * ),
        path_id_data: string (26),
        path_intermediate_errors_sum: integer,
        path_read_byte_count_sum: integer,
        path_recovered_errors_sum: integer,
        path_total_byte_count_sum: integer,
        path_total_reads_sum: integer,
        path_total_requests_sum: integer,
        path_total_writes_sum: integer,
        path_unrecovered_errors_sum: integer,
        path_wrt_and_pre_byte_count_sum: integer,

        pp_avg_data_transfer_sum: real,
        pp_avg_q_size_sum: real,
        pp_avg_response_time_sum: real,
        pp_avg_seek_and_latency_sum: real,
        pp_avg_wait_in_q_sum: real,
        pp_data_p: ^pp_data_record,
        pp_data_seq_p: ^SEQ ( * ),
        pp_id_data: string (11),
        pp_index: integer,
        pp_str_req_count_read_sum: integer,
        pp_str_req_count_total_sum: integer,
        pp_str_req_count_write_sum: integer,
        pp_str_req_failed_read_sum: integer,
        pp_str_req_failed_total_sum: integer,
        pp_str_req_failed_write_sum: integer,
        pp_streamed_success_sum: real,
        pp_time_per_request_sum: real,
        pp_total_requests: integer,
        pp_total_requests_sum: integer,
        pp_total_response_time: integer,
        pp_utilization_sum: real,

        port_name: string (1),
        port_index: integer,
        temp_string: string (4);

?? EJECT, NEWTITLE := '            PROCEDURE initialize_pp_sums' ??

      PROCEDURE initialize_pp_sums;

        pp_avg_data_transfer_sum := 0.0;
        pp_avg_q_size_sum := 0.0;
        pp_avg_response_time_sum := 0.0;
        pp_avg_seek_and_latency_sum := 0.0;
        pp_avg_wait_in_q_sum := 0.0;
        pp_streamed_success_sum := 0.0;
        pp_str_req_count_read_sum := 0;
        pp_str_req_count_write_sum := 0;
        pp_str_req_count_total_sum := 0;
        pp_str_req_failed_read_sum := 0;
        pp_str_req_failed_write_sum := 0;
        pp_str_req_failed_total_sum := 0;
        pp_time_per_request_sum := 0.0;
        pp_total_requests_sum := 0;
        pp_utilization_sum := 0.0;

      PROCEND initialize_pp_sums;
?? OLDTITLE ??

?? EJECT, NEWTITLE := '            PROCEDURE initialize_path_sums' ??

      PROCEDURE initialize_path_sums;

        path_avg_byte_count_per_req_sum := 0;
        path_avg_response_time_sum := 0.0;
        path_read_byte_count_sum := 0;
        path_intermediate_errors_sum := 0;
        path_recovered_errors_sum := 0;
        path_total_byte_count_sum := 0;
        path_total_reads_sum := 0;
        path_total_requests_sum := 0;
        path_total_writes_sum := 0;
        path_unrecovered_errors_sum := 0;
        path_wrt_and_pre_byte_count_sum := 0;

      PROCEND initialize_path_sums;
?? OLDTITLE ??

?? EJECT, NEWTITLE := '            PROCEDURE format_path_data' ??

      PROCEDURE format_path_data;

        VAR
          controller_name: string (5),
          equip_index: integer,
          path_avg_byte_count_per_req: integer,
          path_avg_response_time: real,
          path_read_byte_count: integer,
          path_total_byte_count: integer,
          path_total_requests: integer,
          path_usage_record: iot$path_usage,
          path_wrt_and_preset_byte_count: integer;


?? EJECT, NEWTITLE := '                PROCEDURE increment_path_sums' ??

        PROCEDURE increment_path_sums;

          path_total_reads_sum := path_total_reads_sum + path_usage_record.read_requests;
          path_total_writes_sum := path_total_writes_sum + path_usage_record.write_requests;
          path_total_requests_sum := path_total_requests_sum + path_total_requests;
          path_avg_response_time_sum := path_avg_response_time_sum + path_avg_response_time;
          path_read_byte_count_sum := path_read_byte_count_sum + path_read_byte_count;
          path_wrt_and_pre_byte_count_sum := path_wrt_and_pre_byte_count_sum + path_wrt_and_preset_byte_count;
          path_total_byte_count_sum := path_total_byte_count_sum + path_total_byte_count;
          path_avg_byte_count_per_req_sum := path_avg_byte_count_per_req_sum + path_avg_byte_count_per_req;
          path_recovered_errors_sum := path_recovered_errors_sum + path_usage_record.recovered_errors;
          path_unrecovered_errors_sum := path_unrecovered_errors_sum + path_usage_record.unrecovered_errors;
          path_intermediate_errors_sum := path_intermediate_errors_sum +
                path_usage_record.intermediate_errors;

        PROCEND increment_path_sums;
?? OLDTITLE ??


?? EJECT ??

      /equip_loop/
        FOR equip_index := 0 TO 7 DO
          path_usage_record := user_pp_stats_p^.disk_pp_stats [pp_index].path_usage [port_index]
                [equip_index];
          IF path_usage_record.path_used THEN
            NEXT path_data_p IN path_data_seq_p;
            path_data_p^.line_1 := ' ';
            path_data_p^.line_2 := ' ';
            path_data_p^.line_3 := ' ';

            active_path_count := active_path_count + 1;

            CASE path_usage_record.path_type OF
            = cmc$ms7154_x =
              controller_name := '7154';
            = cmc$ms7155_1, cmc$ms7155_1x =
              controller_name := '7155';
            = cmc$ms7165_2x =
              controller_name := '7165';
            = cmc$ms7255_1_1, cmc$ms7255_1_2 =
              controller_name := '7255';
            = cmc$mscm3_ct =
              controller_name := 'CM3';
            = cmc$mshydra_ct =
              controller_name := 'HYDRA';
            = cmc$ms5831_x =
              controller_name := '5831';
            = cmc$msntdc_1 =
              controller_name := 'NTDC';
            = cmc$msntdc_2 =
              controller_name := 'NTD2';
            ELSE
              controller_name := '    ';
            CASEND;

            path_total_requests := path_usage_record.read_requests + path_usage_record.write_requests;
            path_read_byte_count := path_usage_record.read_maus * path_usage_record.bytes_per_mau;
            path_wrt_and_preset_byte_count := path_usage_record.written_and_preset_maus *
                  path_usage_record.bytes_per_mau;
            path_total_byte_count := path_read_byte_count + path_wrt_and_preset_byte_count;

            IF path_total_requests <> 0 THEN
              path_avg_response_time := $REAL (path_usage_record.total_request_qtime) /
                    $REAL (path_total_requests) / 1000.0;
              path_avg_byte_count_per_req := path_total_byte_count DIV path_total_requests;
            ELSE
              path_avg_response_time := 0.0;
              path_avg_byte_count_per_req := 0;
            IFEND;

            pp_total_requests := pp_total_requests + path_total_requests;
            pp_total_response_time := pp_total_response_time + path_usage_record.total_request_qtime;

            STRINGREP (path_id_data, length, iou_name: 4, '  ', channel_name: 5, port_name: 1, '  ',
                  controller_name: 5, '  ', equip_index: 5);

            STRINGREP (path_data_p^.line_1, length, '  ', path_id_data, '  ',
                  path_usage_record.read_requests: 15, '  ', path_usage_record.write_requests: 15, '  ',
                  path_total_requests: 15, '  ', path_avg_response_time: 10: 2);

            STRINGREP (path_data_p^.line_2, length, '  ', path_id_data, '  ', path_read_byte_count: 15, '  ',
                  path_wrt_and_preset_byte_count: 15, '  ', path_total_byte_count: 15, '  ',
                  path_avg_byte_count_per_req: 15);

            STRINGREP (path_data_p^.line_3, length, '  ', path_id_data, '  ',
                  path_usage_record.recovered_errors: 15, '  ', path_usage_record.intermediate_errors: 15,
                  '  ', path_usage_record.unrecovered_errors: 15);

            increment_path_sums;

          IFEND;
        FOREND /equip_loop/;
      PROCEND format_path_data;
?? OLDTITLE ??

?? EJECT, NEWTITLE := '            PROCEDURE format_pp_data' ??

      PROCEDURE format_pp_data;

        VAR
          pp_avg_data_transfer: real,
          pp_avg_q_size: real,
          pp_avg_response_time: real,
          pp_avg_seek_and_latency: real,
          pp_avg_wait_in_q: real,
          pp_busy_total: real,
          pp_str_req_count_total: integer,
          pp_str_req_failed_total: integer,
          pp_streamed_success: real,
          pp_time_per_request: real,
          pp_total_seeks: integer,
          pp_utilization: real;

?? EJECT, NEWTITLE := '                PROCEDURE increment_pp_sums' ??

        PROCEDURE increment_pp_sums;

          pp_utilization_sum := pp_utilization_sum + pp_utilization;
          pp_total_requests_sum := pp_total_requests_sum + pp_total_requests;
          pp_avg_response_time_sum := pp_avg_response_time_sum + pp_avg_response_time;
          pp_avg_seek_and_latency_sum := pp_avg_seek_and_latency_sum + pp_avg_seek_and_latency;
          pp_avg_data_transfer_sum := pp_avg_data_transfer_sum + pp_avg_data_transfer;
          pp_time_per_request_sum := pp_time_per_request_sum + pp_time_per_request;
          pp_avg_q_size_sum := pp_avg_q_size_sum + pp_avg_q_size;
          pp_avg_wait_in_q_sum := pp_avg_wait_in_q_sum + pp_avg_wait_in_q;
          pp_str_req_count_read_sum := pp_str_req_count_read_sum +
                user_pp_stats_p^.disk_pp_stats [pp_index].streamed_req_count_read;
          pp_str_req_count_write_sum := pp_str_req_count_write_sum + user_pp_stats_p^.
                disk_pp_stats [pp_index].streamed_req_count_write;
          pp_str_req_count_total_sum := pp_str_req_count_total_sum + pp_str_req_count_total;
          pp_str_req_failed_read_sum := pp_str_req_failed_read_sum + user_pp_stats_p^.
                disk_pp_stats [pp_index].streamed_req_failed_count_read;
          pp_str_req_failed_write_sum := pp_str_req_failed_write_sum + user_pp_stats_p^.
                disk_pp_stats [pp_index].streamed_req_failed_count_write;
          pp_str_req_failed_total_sum := pp_str_req_failed_total_sum + pp_str_req_failed_total;
          pp_streamed_success_sum := pp_streamed_success_sum + pp_streamed_success;

        PROCEND increment_pp_sums;
?? OLDTITLE ??

?? EJECT ??
        NEXT pp_data_p IN pp_data_seq_p;
        pp_data_p^.line_1 := ' ';
        pp_data_p^.line_2 := ' ';

        active_pp_count := active_pp_count + 1;

        pp_busy_total := $REAL (user_pp_stats_p^.disk_pp_stats [pp_index].seek_and_latency_time +
              user_pp_stats_p^.disk_pp_stats [pp_index].computed_data_transfer_time);
        IF time_interval <> 0.0 THEN
          pp_utilization := 100.0 * pp_busy_total / time_interval;
        ELSE
          pp_utilization := 0.0;
        IFEND;

        IF pp_total_requests <> 0 THEN
          pp_avg_response_time := $REAL(pp_total_response_time) / $REAL(pp_total_requests) / 1000.0;
          pp_time_per_request := pp_busy_total / $REAL (pp_total_requests) / 1000.0;
          pp_avg_data_transfer :=
                $REAL(user_pp_stats_p^.disk_pp_stats [pp_index].computed_data_transfer_time) /
                $REAL(pp_total_requests) / 1000.0;
          pp_avg_wait_in_q := ($REAL(pp_total_response_time) - pp_busy_total) /
                $REAL(pp_total_requests) / 1000.0;
        IFEND;

        IF pp_busy_total <> 0.0 THEN
          pp_avg_q_size := ($REAL (pp_total_response_time) / pp_busy_total);
        ELSE
          pp_avg_q_size := 0.0;
        IFEND;

        pp_str_req_count_total := user_pp_stats_p^.disk_pp_stats [pp_index].streamed_req_count_read +
              user_pp_stats_p^.disk_pp_stats [pp_index].streamed_req_count_write;
        pp_str_req_failed_total := user_pp_stats_p^.disk_pp_stats [pp_index].streamed_req_failed_count_read +
              user_pp_stats_p^.disk_pp_stats [pp_index].streamed_req_failed_count_write;

        IF (pp_str_req_count_total + pp_str_req_failed_total) <> 0 THEN
          pp_streamed_success := $REAL (pp_str_req_count_total) /
                $REAL (pp_str_req_count_total + pp_str_req_failed_total) * 100.0;
        ELSE
          pp_streamed_success := 0.0;
        IFEND;

        pp_total_seeks := pp_total_requests - pp_str_req_count_total;
        IF pp_total_seeks <> 0 THEN
          pp_avg_seek_and_latency := $REAL (user_pp_stats_p^.disk_pp_stats [pp_index].seek_and_latency_time) /
                $REAL (pp_total_seeks) / 1000.0;
        ELSE
          pp_avg_seek_and_latency := 0.0;
        IFEND;

        STRINGREP (pp_id_data, length, iou_name: 4, '  ', channel_name: 5);

        STRINGREP (pp_data_p^.line_1, length, '  ', pp_id_data, '  ', pp_utilization: 7: 1, '  ',
              pp_total_requests: 15, '  ', pp_avg_q_size: 10: 2, '  ',  pp_avg_response_time: 10:2, '  ',
              pp_avg_wait_in_q: 10: 2, '  ',  pp_time_per_request: 10: 2, '  ',
              pp_avg_seek_and_latency: 10: 2, '  ', pp_avg_data_transfer: 10: 2);

        STRINGREP (pp_data_p^.line_2, length, '  ', pp_id_data, '  ', user_pp_stats_p^.
              disk_pp_stats [pp_index].streamed_req_count_read: 15, '  ', user_pp_stats_p^.
              disk_pp_stats [pp_index].streamed_req_count_write: 15, '  ', pp_str_req_count_total: 15, '  ',
              user_pp_stats_p^.disk_pp_stats [pp_index].streamed_req_failed_count_read: 15, '  ',
              user_pp_stats_p^.disk_pp_stats [pp_index].streamed_req_failed_count_write: 15, '  ',
              pp_str_req_failed_total: 15, '  ', pp_streamed_success: 7: 1);

        increment_pp_sums;

      PROCEND format_pp_data;
?? OLDTITLE ??

?? EJECT, NEWTITLE := '            PROCEDURE output_path_data' ??

      PROCEDURE output_path_data;

        VAR
          dashes: string (40),
          path_read_bytes_per_read_req: integer,
          path_total_bytes_per_total_req: integer,
          path_wrt_pr_bytes_per_wrt_req: integer;


        dashes (1, 40) := '--------------------------------------';

        clp$new_display_line (display_control, 3, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        clp$put_display (display_control, '  PATH STATISTICS', clc$trim, status);

{Output Block 1 of Path Statistics

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', 'IOU': 4, '  ', ' CH': 6, '  ', 'Cntrl': 5, '  ', 'Equip': 5, '  ',
              '   Path Read': 15, '  ', '  Path Write': 15, '  ', '  Total Path': 15, '  ', ' Average': 10);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', 'Name': 4, '  ', ' Name': 6, '  ', ' Type': 5, '  ', ' No.': 5, '  ',
              '   Requests': 15, '  ', '   Requests': 15, '  ', '   Requests': 15, '  ', 'Resp Time': 10);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 4): 4, '  ', dashes (1, 6): 6, '  ', dashes (1, 5): 5, '  ',
              dashes (1, 5): 5, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 10): 10);

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

        RESET path_data_seq_p;

        FOR i := 1 TO active_path_count DO
          NEXT path_data_p IN path_data_seq_p;
          clp$put_display (display_control, path_data_p^.line_1, clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        FOREND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 4): 4, '  ', dashes (1, 6): 6, '  ', dashes (1, 5): 5, '  ',
              dashes (1, 5): 5, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 10): 10);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' sum': #SIZE (path_id_data), '  ', path_total_reads_sum: 15, '  ',
              path_total_writes_sum: 15, '  ', path_total_requests_sum: 15, '  ', '': 10);

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

        IF time_interval_sec <> 0.0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/sec': #SIZE (path_id_data), '  ',
                $REAL (path_total_reads_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (path_total_writes_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (path_total_requests_sum) / time_interval_sec: 15: 2, '  ', '': 10);

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

        IF path_total_requests_sum <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/total req': #SIZE (path_id_data),
                '  ', $REAL (path_total_reads_sum) / $REAL (path_total_requests_sum): 15: 2,
                '  ', $REAL (path_total_writes_sum) / $REAL (path_total_requests_sum): 15: 2,
                '  ', $REAL (path_total_requests_sum) / $REAL (path_total_requests_sum): 15: 2, '  ', '': 10);

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

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF active_path_count <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', ' avg': #SIZE (path_id_data), '  ',
                path_total_reads_sum DIV active_path_count: 15, '  ',
                path_total_writes_sum DIV active_path_count: 15, '  ',
                path_total_requests_sum DIV active_path_count: 15, '  ',
                $REAL (path_avg_response_time_sum) / $REAL (active_path_count): 10: 2);

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

          IF time_interval_sec <> 0.0 THEN
            line (1, * ) := '  ';
            STRINGREP (line, length, '  ', '/sec': #SIZE (path_id_data), '  ',
                  $REAL (path_total_reads_sum) / $REAL (active_path_count) / time_interval_sec: 15: 2, '  ',
                  $REAL (path_total_writes_sum) / $REAL (active_path_count) / time_interval_sec: 15: 2, '  ',
                  $REAL (path_total_requests_sum) / $REAL (active_path_count) / time_interval_sec: 15: 2);

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


{Output Block 2 of Path Statistics

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', 'IOU': 4, '  ', ' CH': 6, '  ', 'Cntrl': 5, '  ', 'Equip': 5, '  ',
              '     Read': 15, '  ', 'Write Byte_Cnt': 15, '  ', '  Total Path': 15, '  ',
              'Avg Byte_Count ': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', 'Name': 4, '  ', ' Name': 6, '  ', ' Type': 5, '  ', ' No.': 5, '  ',
              '  Byte_Count': 15, '  ', 'Data and Preset': 15, '  ', '  Byte_Count': 15, '  ',
              '  per Request': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 4): 4, '  ', dashes (1, 6): 6, '  ', dashes (1, 5): 5, '  ',
              dashes (1, 5): 5, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15);

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

        RESET path_data_seq_p;

        FOR i := 1 TO active_path_count DO
          NEXT path_data_p IN path_data_seq_p;
          clp$put_display (display_control, path_data_p^.line_2, clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        FOREND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 4): 4, '  ', dashes (1, 6): 6, '  ', dashes (1, 5): 5, '  ',
              dashes (1, 5): 5, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' sum': #SIZE (path_id_data), '  ', path_read_byte_count_sum: 15, '  ',
              path_wrt_and_pre_byte_count_sum: 15, '  ', path_total_byte_count_sum: 15, '  ', '': 15);

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

        IF time_interval_sec <> 0.0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/sec': #SIZE (path_id_data),
                '  ', $INTEGER ($REAL (path_read_byte_count_sum) / time_interval_sec):
                15: 2, '  ', $INTEGER ($REAL (path_wrt_and_pre_byte_count_sum) / time_interval_sec): 15: 2,
                '  ', $INTEGER ($REAL (path_total_byte_count_sum) / time_interval_sec): 15: 2, '  ', '': 15);

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

        IF path_total_requests_sum <> 0 THEN
          path_total_bytes_per_total_req := path_total_byte_count_sum DIV path_total_requests_sum;
          IF path_total_reads_sum <> 0 THEN
            path_read_bytes_per_read_req := path_read_byte_count_sum DIV path_total_reads_sum;
          ELSE
            path_read_bytes_per_read_req := 0;
          IFEND;

          IF path_total_writes_sum <> 0 THEN
            path_wrt_pr_bytes_per_wrt_req := path_wrt_and_pre_byte_count_sum DIV path_total_writes_sum;
          ELSE
            path_wrt_pr_bytes_per_wrt_req := 0;
          IFEND;

          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/req type': #SIZE (path_id_data), '  ',
                path_read_bytes_per_read_req: 15, '  ', path_wrt_pr_bytes_per_wrt_req: 15, '  ',
                path_total_bytes_per_total_req: 15, '  ', '': 15);

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

        IF path_total_byte_count_sum <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', ' pct': #SIZE (path_id_data),
                '  ', $REAL (path_read_byte_count_sum) / $REAL (path_total_byte_count_sum) * 100.0: 15: 2,
                '  ', $REAL (path_wrt_and_pre_byte_count_sum) / $REAL (path_total_byte_count_sum) *
                100.0: 15: 2, '  ', $REAL (path_total_byte_count_sum) / $REAL (path_total_byte_count_sum) *
                100.0: 15: 2, '  ', '': 15);

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

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF active_path_count <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', ' avg': #SIZE (path_id_data), '  ',
                path_read_byte_count_sum DIV active_path_count: 15, '  ',
                path_wrt_and_pre_byte_count_sum DIV active_path_count: 15, '  ',
                path_total_byte_count_sum DIV active_path_count: 15, '  ',
                path_avg_byte_count_per_req_sum DIV active_path_count: 15, '  ', '': 15);

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

          IF time_interval_sec <> 0.0 THEN
            line (1, * ) := '  ';
            STRINGREP (line, length, '  ', '/sec': #SIZE (path_id_data),
                  '  ', $INTEGER ($REAL (path_read_byte_count_sum DIV active_path_count) /
                  time_interval_sec): 15: 2, '  ', $INTEGER ($REAL (path_wrt_and_pre_byte_count_sum DIV
                  active_path_count) / time_interval_sec): 15: 2, '  ',
                  $INTEGER ($REAL (path_total_byte_count_sum DIV active_path_count) /
                  time_interval_sec): 15: 2, '  ', '': 15);

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

{Output Block 3 of Path Statisitcs

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', 'IOU': 4, '  ', ' CH': 6, '  ', 'Cntrl': 5, '  ', 'Equip': 5, '  ',
              '   Recovered': 15, '  ', '  Intermediate': 15, '  ', '  Unrecovered': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', 'Name': 4, '  ', ' Name': 6, '  ', ' Type': 5, '  ', ' No.': 5, '  ',
              '     Errors': 15, '  ', '     Errors': 15, '  ', '     Errors': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 4): 4, '  ', dashes (1, 6): 6, '  ', dashes (1, 5): 5, '  ',
              dashes (1, 5): 5, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15);

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

        RESET path_data_seq_p;

        FOR i := 1 TO active_path_count DO
          NEXT path_data_p IN path_data_seq_p;
          clp$put_display (display_control, path_data_p^.line_3, clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        FOREND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 4): 4, '  ', dashes (1, 6): 6, '  ', dashes (1, 5): 5, '  ',
              dashes (1, 5): 5, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' sum': #SIZE (path_id_data), '  ', path_recovered_errors_sum: 15,
              '  ', path_intermediate_errors_sum: 15, '  ', path_unrecovered_errors_sum: 15);

        clp$put_display (display_control, line, clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      PROCEND output_path_data;
?? OLDTITLE ??

?? EJECT, NEWTITLE := '            PROCEDURE output_pp_data' ??

      PROCEDURE output_pp_data;

        VAR
          dashes: string (40),
          pp_fail_str_reads_per_read_req: real,
          pp_fail_str_reqs_per_total_req: real,
          pp_fail_str_wrts_per_wrt_req: real,
          pp_str_reads_per_read_req: real,
          pp_str_reqs_per_total_req: real,
          pp_str_wrts_per_wrt_req: real;


        dashes (1, 40) := '--------------------------------------';

        clp$new_display_line (display_control, 3, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        clp$put_display (display_control, '  PP and CHANNEL STATISTICS', clc$trim, status);

{Output Block 1 of PP Statistics

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', 'IOU': 4, '  ', ' CH': 5, '  ', ' PP': 7, '  ', '     Total': 15, '  ',
              ' Average': 10, '  ',' Average': 10, '  ',' Average': 10, '  ', ' Time per': 10, '  ',
              ' Average': 10, '  ',' Average': 10);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', 'Name': 4, '  ', ' Name': 5, '  ', ' Util': 7, '  ',
              '    Requests': 15, '  ', '  Q Size': 10, '  ', 'Resp Time':10, '  ', 'Wait in Q':10, '  ',
              ' Request': 10, '  ','Seek & Lat': 10, '  ', 'Data XFer':10);

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


        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 4): 4, '  ', dashes (1, 5): 5, '  ', dashes (1, 7): 7, '  ',
              dashes (1, 15): 15, '  ', dashes (1, 10): 10, '  ', dashes (1, 10): 10, '  ', dashes (1,
              10): 10, '  ', dashes (1, 10): 10,'  ', dashes (1, 10): 10,'  ', dashes (1, 10): 10);

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

        RESET pp_data_seq_p;

        FOR i := 1 TO active_pp_count DO
          NEXT pp_data_p IN pp_data_seq_p;
          clp$put_display (display_control, pp_data_p^.line_1, clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        FOREND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 4): 4, '  ', dashes (1, 5): 5, '  ', dashes (1, 7): 7, '  ',
              dashes (1, 15): 15, '  ', dashes (1, 10): 10, '  ', dashes (1, 10): 10, '  ', dashes (1,
              10): 10, '  ', dashes (1, 10): 10,'  ', dashes (1, 10): 10,'  ', dashes (1, 10): 10);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' sum': #SIZE (pp_id_data), '  ', '': 7, '  ',
              pp_total_requests_sum: 15, '  ', pp_avg_q_size_sum: 10: 2);

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

        IF time_interval_sec <> 0.0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/sec': #SIZE (pp_id_data),
                '  ', '': 7, '  ', $REAL (pp_total_requests_sum) / time_interval_sec: 15: 2);

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

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF active_pp_count <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', ' avg': #SIZE (pp_id_data),
                '  ', pp_utilization_sum / $REAL (active_pp_count): 7: 1, '  ',
                pp_total_requests_sum DIV active_pp_count: 15, '  ',
                pp_avg_q_size_sum / $REAL (active_pp_count): 10: 2, '  ',
                pp_avg_response_time_sum / $REAL (active_pp_count): 10: 2, '  ',
                pp_avg_wait_in_q_sum / $REAL (active_pp_count): 10: 2, '  ',
                pp_time_per_request_sum / $REAL (active_pp_count): 10: 2, '  ',
                pp_avg_seek_and_latency_sum / $REAL (active_pp_count): 10: 2, '  ',
                pp_avg_data_transfer_sum / $REAL (active_pp_count): 10: 2);

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

          IF time_interval_sec <> 0.0 THEN
            line (1, * ) := '  ';
            STRINGREP (line, length, '  ', '/sec': #SIZE (pp_id_data),
                  '  ', '': 7, '  ', $REAL (pp_total_requests_sum DIV active_pp_count) /
                  time_interval_sec: 15: 2);

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

{Output Block 2 of PP Statistics

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', 'IOU': 4, '  ', ' CH': 5, '  ', ' Read Requests': 15, '  ',
              'Write Requests': 15, '  ', 'Total Requests': 15, '  ', ' Read Req that': 15, '  ',
              'Write Req that': 15, '  ', 'Total Req that': 15, '  ', 'Stream': 7);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', 'Name': 4, '  ', ' Name': 5, '  ', ' that Streamed': 15, '  ',
              'that Streamed': 15, '  ', 'that Streamed': 15, '  ', ' Failed to Str': 15, '  ',
              'Failed to Str': 15, '  ', 'Failed to Str': 15, '  ', 'Success': 7);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 4): 4, '  ', dashes (1, 5): 5, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 7): 7);

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

        RESET pp_data_seq_p;

        FOR i := 1 TO active_pp_count DO
          NEXT pp_data_p IN pp_data_seq_p;
          clp$put_display (display_control, pp_data_p^.line_2, clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        FOREND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 4): 4, '  ', dashes (1, 5): 5, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 7): 7);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' sum': #SIZE (pp_id_data), '  ', pp_str_req_count_read_sum: 15, '  ',
              pp_str_req_count_write_sum: 15, '  ', pp_str_req_count_total_sum: 15, '  ',
              pp_str_req_failed_read_sum: 15, '  ', pp_str_req_failed_write_sum: 15, '  ',
              pp_str_req_failed_total_sum: 15, '  ', '': 7);

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

        IF time_interval_sec <> 0.0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/sec': #SIZE (pp_id_data), '  ',
                $REAL (pp_str_req_count_read_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (pp_str_req_count_write_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (pp_str_req_count_total_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (pp_str_req_failed_read_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (pp_str_req_failed_write_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (pp_str_req_failed_total_sum) / time_interval_sec: 15: 2, '  ', '': 7);

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

        IF pp_total_requests_sum <> 0 THEN
          pp_str_reqs_per_total_req := $REAL (pp_str_req_count_total_sum) / $REAL (pp_total_requests_sum);
          pp_fail_str_reqs_per_total_req := $REAL (pp_str_req_failed_total_sum) /
                $REAL (pp_total_requests_sum);

          IF path_total_reads_sum <> 0 THEN
            pp_str_reads_per_read_req := $REAL (pp_str_req_count_read_sum) / $REAL (path_total_reads_sum);
            pp_fail_str_reads_per_read_req := $REAL (pp_str_req_failed_read_sum) /
                  $REAL (path_total_reads_sum);
          ELSE
            pp_str_reads_per_read_req := 0.0;
            pp_fail_str_reads_per_read_req := 0.0;
          IFEND;

          IF path_total_writes_sum <> 0 THEN
            pp_str_wrts_per_wrt_req := $REAL (pp_str_req_count_write_sum) / $REAL (path_total_writes_sum);
            pp_fail_str_wrts_per_wrt_req := $REAL (pp_str_req_failed_write_sum) /
                  $REAL (path_total_writes_sum);
          ELSE
            pp_str_wrts_per_wrt_req := 0.0;
            pp_fail_str_wrts_per_wrt_req := 0.0;
          IFEND;

          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/req type': #SIZE (pp_id_data), '  ',
                pp_str_reads_per_read_req: 15: 2, '  ', pp_str_wrts_per_wrt_req: 15: 2, '  ',
                pp_str_reqs_per_total_req: 15: 2, '  ', pp_fail_str_reads_per_read_req: 15: 2, '  ',
                pp_fail_str_wrts_per_wrt_req: 15: 2, '  ', pp_fail_str_reqs_per_total_req: 15: 2);

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

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF active_pp_count <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', ' avg': #SIZE (pp_id_data), '  ',
                pp_str_req_count_read_sum DIV active_pp_count: 15, '  ',
                pp_str_req_count_write_sum DIV active_pp_count: 15, '  ',
                pp_str_req_count_total_sum DIV active_pp_count: 15, '  ',
                pp_str_req_failed_read_sum DIV active_pp_count: 15, '  ',
                pp_str_req_failed_write_sum DIV active_pp_count: 15, '  ',
                pp_str_req_failed_total_sum DIV active_pp_count: 15, '  ',
                $REAL (pp_streamed_success_sum) / $REAL (active_pp_count): 7: 1);

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

          IF time_interval_sec <> 0.0 THEN
            line (1, * ) := '  ';
            STRINGREP (line, length, '  ', '/sec': #SIZE (pp_id_data),
                  '  ', $REAL (pp_str_req_count_read_sum DIV active_pp_count) / time_interval_sec: 15: 2,
                  '  ', $REAL (pp_str_req_count_write_sum DIV active_pp_count) / time_interval_sec: 15: 2,
                  '  ', $REAL (pp_str_req_count_total_sum DIV active_pp_count) / time_interval_sec: 15: 2,
                  '  ', $REAL (pp_str_req_failed_read_sum DIV active_pp_count) / time_interval_sec: 15: 2,
                  '  ', $REAL (pp_str_req_failed_write_sum DIV active_pp_count) / time_interval_sec: 15: 2,
                  '  ', $REAL (pp_str_req_failed_total_sum DIV active_pp_count) / time_interval_sec: 15: 2,
                  '  ', '': 7);

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

      PROCEND output_pp_data;
?? OLDTITLE ??

?? EJECT ??
      PUSH pp_data_seq_p: [[REP pp_count OF pp_data_record]];
      PUSH path_data_seq_p: [[REP pp_count * 2 * 8 OF path_data_record]];
      active_pp_count := 0;
      active_path_count := 0;

      initialize_pp_sums;
      initialize_path_sums;

    /pp_loop/
      FOR pp_index := 1 TO pp_count DO
        iou_name := 'IOU0';
        IF user_pp_stats_p^.disk_pp_stats [pp_index].iou_number = 1 THEN
          iou_name := 'IOU1';
        IFEND;

        clp$convert_integer_to_rjstring (user_pp_stats_p^.disk_pp_stats [pp_index].channel.number, 10, FALSE,
              '0', channel_name, local_status);
        IF NOT local_status.normal THEN
          channel_name := '     ';
        IFEND;
        IF user_pp_stats_p^.disk_pp_stats [pp_index].channel.concurrent THEN
          channel_name (1, 3) := 'CCH';
        ELSE
          channel_name (1, 3) := ' CH';
        IFEND;

{ pp_total_requests and pp_total_response_time is calculated for each pp
{ by summing the appropriate values for each path on the pp

        pp_total_requests := 0;
        pp_total_response_time := 0;

      /port_loop/
        FOR port_index := 0 TO 1 DO
          IF user_pp_stats_p^.disk_pp_stats [pp_index].channel.concurrent THEN
            IF user_pp_stats_p^.disk_pp_stats [pp_index].channel.port = cmc$unspecified_port THEN
              port_name := ' ';
            ELSE
              IF port_index = 0 THEN
                port_name := 'A';
              ELSE
                port_name := 'B';
              IFEND;
            IFEND;
          ELSE
            port_name := ' ';
          IFEND;

          format_path_data;

        FOREND /port_loop/;
        IF pp_total_requests > 0 THEN

          format_pp_data;

        IFEND;
      FOREND /pp_loop/;
      output_pp_data;
      output_path_data;

    PROCEND report_path_and_pp_data;
?? OLDTITLE ??

?? EJECT, NEWTITLE := '        PROCEDURE report_unit_data' ??

    PROCEDURE report_unit_data;

      TYPE
        unit_data_record = record
          line_1: string (132),
          line_2: string (132),
          line_3: string (132),
          line_4: string (132),
          line_5: string (132),
          line_6: string (132),
        recend;


      VAR
        active_unit_count: integer,
        unit_avg_byte_count_per_req: integer,
        unit_avg_byte_count_per_req_sum: integer,
        unit_data_p: ^unit_data_record,
        unit_data_seq_p: ^SEQ ( * ),
        unit_id_data: string (15),
        unit_intermediate_errors_sum: integer,
        unit_qtime_per_read_req: real,
        unit_qtime_per_read_req_sum: real,
        unit_qtime_per_swap_in_req: real,
        unit_qtime_per_swap_in_req_sum: real,
        unit_qtime_per_swap_out_req: real,
        unit_qtime_per_swap_out_req_sum: real,
        unit_qtime_per_total_req: real,
        unit_qtime_per_total_req_sum: real,
        unit_qtime_per_write_req: real,
        unit_qtime_per_write_req_sum: real,
        unit_read_bytes_sum: integer,
        unit_read_requests_sum: integer,
        unit_recovered_errors_sum: integer,
        unit_req_caus_skipped_cyl_sum: integer,
        unit_str_req_count_read_sum: integer,
        unit_str_req_count_total_sum: integer,
        unit_str_req_count_write_sum: integer,
        unit_str_req_failed_read_sum: integer,
        unit_str_req_failed_total_sum: integer,
        unit_str_req_failed_write_sum: integer,
        unit_streamed_success_sum: real,
        unit_swap_in_bytes_sum: integer,
        unit_swap_in_requests_sum: integer,
        unit_swap_out_data_bytes_sum: integer,
        unit_swap_out_data_pr_bytes_sum: integer,
        unit_swap_out_requests_sum: integer,
        unit_total_bytes_sum: integer,
        unit_total_cyl_skipped_sum: integer,
        unit_total_input_bytes_sum: integer,
        unit_total_input_requests_sum: integer,
        unit_total_output_bytes_sum: integer,
        unit_total_output_requests_sum: integer,
        unit_total_requests_sum: integer,
        unit_total_seeks_sum: integer,
        unit_unrecovered_errors_sum: integer,
        unit_write_data_bytes_sum: integer,
        unit_write_data_pr_bytes_sum: integer,
        unit_write_requests_sum: integer;

?? EJECT, NEWTITLE := '            PROCEDURE initialize_unit_sums' ??

      PROCEDURE initialize_unit_sums;

        unit_avg_byte_count_per_req_sum := 0;
        unit_qtime_per_read_req_sum := 0.0;
        unit_qtime_per_swap_in_req_sum := 0.0;
        unit_qtime_per_swap_out_req_sum := 0.0;
        unit_qtime_per_total_req_sum := 0.0;
        unit_qtime_per_write_req_sum := 0.0;
        unit_read_requests_sum := 0;
        unit_write_requests_sum := 0;
        unit_swap_in_requests_sum := 0;
        unit_swap_out_requests_sum := 0;
        unit_total_requests_sum := 0;
        unit_write_data_bytes_sum := 0;
        unit_write_data_pr_bytes_sum := 0;
        unit_swap_out_data_bytes_sum := 0;
        unit_swap_out_data_pr_bytes_sum := 0;
        unit_total_output_bytes_sum := 0;
        unit_read_bytes_sum := 0;
        unit_swap_in_bytes_sum := 0;
        unit_total_input_bytes_sum := 0;
        unit_total_bytes_sum := 0;
        unit_str_req_count_read_sum := 0;
        unit_str_req_count_write_sum := 0;
        unit_str_req_count_total_sum := 0;
        unit_str_req_failed_read_sum := 0;
        unit_str_req_failed_write_sum := 0;
        unit_str_req_failed_total_sum := 0;
        unit_total_seeks_sum := 0;
        unit_req_caus_skipped_cyl_sum := 0;
        unit_total_cyl_skipped_sum := 0;
        unit_recovered_errors_sum := 0;
        unit_intermediate_errors_sum := 0;
        unit_unrecovered_errors_sum := 0;
        unit_streamed_success_sum := 0.0;
        unit_total_output_requests_sum := 0;
        unit_total_input_requests_sum := 0;

      PROCEND initialize_unit_sums;
?? OLDTITLE ??

?? EJECT, NEWTITLE := '            PROCEDURE format_unit_data' ??

      PROCEDURE format_unit_data;

        VAR
          unit_index: integer,
          unit_seeks: integer,
          unit_str_req_count_total: integer,
          unit_str_req_failed_total: integer,
          unit_streamed_success: real,
          unit_total_bytes: integer,
          unit_total_input_bytes: integer,
          unit_total_output_bytes: integer,
          unit_total_qtime: integer,
          unit_total_requests: integer,
          unit_type: string (7);


?? EJECT, NEWTITLE := '                PROCEDURE increment_unit_sums' ??

        PROCEDURE increment_unit_sums;

          unit_read_requests_sum := unit_read_requests_sum +
                user_unit_stats_p^.disk_unit_stats [unit_index].read_requests;
          unit_write_requests_sum := unit_write_requests_sum + user_unit_stats_p^.
                disk_unit_stats [unit_index].write_requests;
          unit_swap_in_requests_sum := unit_swap_in_requests_sum + user_unit_stats_p^.
                disk_unit_stats [unit_index].swap_in_requests;
          unit_swap_out_requests_sum := unit_swap_out_requests_sum + user_unit_stats_p^.
                disk_unit_stats [unit_index].swap_out_requests;
          unit_total_requests_sum := unit_total_requests_sum + unit_total_requests;
          unit_write_data_bytes_sum := unit_write_data_bytes_sum +
                (user_unit_stats_p^.disk_unit_stats [unit_index].write_data_mau_count *
                user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau);
          unit_write_data_pr_bytes_sum := unit_write_data_pr_bytes_sum +
                (user_unit_stats_p^.disk_unit_stats [unit_index].write_data_and_preset_maus *
                user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau);
          unit_swap_out_data_bytes_sum := unit_swap_out_data_bytes_sum +
                (user_unit_stats_p^.disk_unit_stats [unit_index].swap_out_data_mau_count *
                user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau);
          unit_swap_out_data_pr_bytes_sum := unit_swap_out_data_pr_bytes_sum +
                (user_unit_stats_p^.disk_unit_stats [unit_index].swap_out_data_and_preset_maus *
                user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau);
          unit_total_output_bytes_sum := unit_total_output_bytes_sum + unit_total_output_bytes;
          unit_read_bytes_sum := unit_read_bytes_sum + (user_unit_stats_p^.disk_unit_stats [unit_index].
                read_mau_count * user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau);
          unit_swap_in_bytes_sum := unit_swap_in_bytes_sum +
                (user_unit_stats_p^.disk_unit_stats [unit_index].swap_in_mau_count *
                user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau);
          unit_total_input_bytes_sum := unit_total_input_bytes_sum + unit_total_input_bytes;
          unit_total_bytes_sum := unit_total_bytes_sum + unit_total_bytes;
          unit_avg_byte_count_per_req_sum := unit_avg_byte_count_per_req_sum + unit_avg_byte_count_per_req;
          unit_qtime_per_read_req_sum := unit_qtime_per_read_req_sum + unit_qtime_per_read_req;
          unit_qtime_per_write_req_sum := unit_qtime_per_write_req_sum + unit_qtime_per_write_req;
          unit_qtime_per_swap_in_req_sum := unit_qtime_per_swap_in_req_sum + unit_qtime_per_swap_in_req;
          unit_qtime_per_swap_out_req_sum := unit_qtime_per_swap_out_req_sum + unit_qtime_per_swap_out_req;
          unit_qtime_per_total_req_sum := unit_qtime_per_total_req_sum + unit_qtime_per_total_req;
          unit_str_req_count_read_sum := unit_str_req_count_read_sum + user_unit_stats_p^.
                disk_unit_stats [unit_index].streamed_req_count_read;
          unit_str_req_count_write_sum := unit_str_req_count_write_sum + user_unit_stats_p^.
                disk_unit_stats [unit_index].streamed_req_count_write;
          unit_str_req_count_total_sum := unit_str_req_count_total_sum + unit_str_req_count_total;
          unit_str_req_failed_read_sum := unit_str_req_failed_read_sum + user_unit_stats_p^.
                disk_unit_stats [unit_index].streamed_req_failed_count_read;
          unit_str_req_failed_write_sum := unit_str_req_failed_write_sum +
                user_unit_stats_p^.disk_unit_stats [unit_index].streamed_req_failed_count_write;
          unit_str_req_failed_total_sum := unit_str_req_failed_total_sum + unit_str_req_failed_total;
          unit_streamed_success_sum := unit_streamed_success_sum + unit_streamed_success;
          unit_total_seeks_sum := unit_total_seeks_sum + (unit_total_requests - unit_str_req_count_total);
          unit_req_caus_skipped_cyl_sum := unit_req_caus_skipped_cyl_sum +
                user_unit_stats_p^.disk_unit_stats [unit_index].requests_causing_skipped_cyl;
          unit_total_cyl_skipped_sum := unit_total_cyl_skipped_sum + user_unit_stats_p^.
                disk_unit_stats [unit_index].total_cylinders_skipped;
          unit_recovered_errors_sum := unit_recovered_errors_sum + user_unit_stats_p^.
                disk_unit_stats [unit_index].recovered_errors;
          unit_intermediate_errors_sum := unit_intermediate_errors_sum + user_unit_stats_p^.
                disk_unit_stats [unit_index].intermediate_errors;
          unit_unrecovered_errors_sum := unit_unrecovered_errors_sum + user_unit_stats_p^.
                disk_unit_stats [unit_index].unrecovered_errors;

        PROCEND increment_unit_sums;
?? OLDTITLE ??

?? EJECT ??

      /unit_loop/
        FOR unit_index := 1 TO unit_count DO
          IF user_unit_stats_p^.disk_unit_stats [unit_index].unit_used THEN
            NEXT unit_data_p IN unit_data_seq_p;
            unit_data_p^.line_1 := ' ';
            unit_data_p^.line_2 := ' ';
            unit_data_p^.line_3 := ' ';
            unit_data_p^.line_4 := ' ';
            unit_data_p^.line_5 := ' ';
            unit_data_p^.line_6 := ' ';

            active_unit_count := active_unit_count + 1;

            CASE user_unit_stats_p^.disk_unit_stats [unit_index].unit_type OF
            = ioc$dt_ms844_4x =
              unit_type := '  844';
            = ioc$dt_ms885_1x, ioc$dt_ms885_42 =
              unit_type := '  885';
            = ioc$dt_ms834_2 =
              unit_type := '  834';
            = ioc$dt_msfsd_2 =
              unit_type := '  836';
            = ioc$dt_ms895_2 =
              unit_type := '  895';
            = ioc$dt_mshydra =
              unit_type := '  887';
            = ioc$dt_ms9836_1 =
              unit_type := ' 9836';
            = ioc$dt_msxmd_3 =
              unit_type := ' 9853';
            = ioc$dt_ms5832_1 =
              unit_type := '5832_1';
            = ioc$dt_ms5832_2 =
              unit_type := '5832_2';
            = ioc$dt_ms5833_1 =
              unit_type := '5833_1';
            = ioc$dt_ms5833_1p =
              unit_type := '5833_1P';
            = ioc$dt_ms5833_2 =
              unit_type := '5833_2';
            = ioc$dt_ms5833_3p =
              unit_type := '5833_3P';
            = ioc$dt_ms5833_4 =
              unit_type := '5833_4';
            = ioc$dt_ms5837_1 =
              unit_type := '5837_1';
            = ioc$dt_ms5837_1p =
              unit_type := '5837_1P';
            = ioc$dt_ms5837_2 =
              unit_type := '5837_2';
            = ioc$dt_ms5837_3p =
              unit_type := '5837_3P';
            = ioc$dt_ms5837_4 =
              unit_type := '5837_4';
            = ioc$dt_ms5838_1 =
              unit_type := '5838_1';
            = ioc$dt_ms5838_1p =
              unit_type := '5838_1P';
            = ioc$dt_ms5838_2 =
              unit_type := '5838_2';
            = ioc$dt_ms5838_3p =
              unit_type := '5838_3P';
            = ioc$dt_ms5838_4 =
              unit_type := '5838_4';
            = ioc$dt_ms47444_1 =
              unit_type := '47444_1';
            = ioc$dt_ms47444_1p =
              unit_type := '47444_1P';
            = ioc$dt_ms47444_2 =
              unit_type := '47444_2';
            = ioc$dt_ms47444_3p =
              unit_type := '47444_3P';
            = ioc$dt_ms47444_4 =
              unit_type := '47444_4';
            = ioc$dt_msntdd_1 =
              unit_type := 'NTDD_1';
            = ioc$dt_msntdd_2 =
              unit_type := 'NTDD_2';
            = ioc$dt_msntdd_3 =
              unit_type := 'NTDD_3';
            = ioc$dt_msntdd_4 =
              unit_type := 'NTDD_4';
            = ioc$dt_msntdd_5 =
              unit_type := 'NTDD_5';
            = ioc$dt_msntdd_6 =
              unit_type := 'NTDD_6';
            ELSE
              unit_type := '    ';
            CASEND;

            STRINGREP (unit_id_data, length, user_unit_stats_p^.disk_unit_stats [unit_index].recorded_vsn: 6,
                  '  ', unit_type: 7);

            unit_total_requests := user_unit_stats_p^.disk_unit_stats [unit_index].read_requests +
                  user_unit_stats_p^.disk_unit_stats [unit_index].write_requests +
                  user_unit_stats_p^.disk_unit_stats [unit_index].swap_in_requests +
                  user_unit_stats_p^.disk_unit_stats [unit_index].swap_out_requests;

            unit_total_output_bytes := (user_unit_stats_p^.disk_unit_stats [unit_index].
                  write_data_and_preset_maus + user_unit_stats_p^.disk_unit_stats [unit_index].
                  swap_out_data_and_preset_maus) * user_unit_stats_p^.disk_unit_stats [unit_index].
                  bytes_per_mau;

            unit_total_input_bytes := (user_unit_stats_p^.disk_unit_stats [unit_index].read_mau_count +
                  user_unit_stats_p^.disk_unit_stats [unit_index].swap_in_mau_count) *
                  user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau;

            unit_total_bytes := unit_total_output_bytes + unit_total_input_bytes;

            IF unit_total_requests <> 0 THEN
              unit_avg_byte_count_per_req := unit_total_bytes DIV unit_total_requests;
            ELSE
              unit_avg_byte_count_per_req := 0;
            IFEND;

            unit_total_qtime := user_unit_stats_p^.disk_unit_stats [unit_index].read_qtime +
                  user_unit_stats_p^.disk_unit_stats [unit_index].write_qtime +
                  user_unit_stats_p^.disk_unit_stats [unit_index].swap_in_qtime +
                  user_unit_stats_p^.disk_unit_stats [unit_index].swap_out_qtime;

            IF user_unit_stats_p^.disk_unit_stats [unit_index].read_requests <> 0 THEN
              unit_qtime_per_read_req := $REAL (user_unit_stats_p^.disk_unit_stats [unit_index].read_qtime) /
                    $REAL (user_unit_stats_p^.disk_unit_stats [unit_index].read_requests) / 1000.0;
            ELSE
              unit_qtime_per_read_req := 0.0;
            IFEND;

            IF user_unit_stats_p^.disk_unit_stats [unit_index].write_requests <> 0 THEN
              unit_qtime_per_write_req := $REAL (user_unit_stats_p^.disk_unit_stats [unit_index].
                    write_qtime) / $REAL (user_unit_stats_p^.disk_unit_stats [unit_index].write_requests) /
                    1000.0;
            ELSE
              unit_qtime_per_write_req := 0.0;
            IFEND;

            IF user_unit_stats_p^.disk_unit_stats [unit_index].swap_in_requests <> 0 THEN
              unit_qtime_per_swap_in_req := $REAL (user_unit_stats_p^.disk_unit_stats [unit_index].
                    swap_in_qtime) / $REAL (user_unit_stats_p^.disk_unit_stats [unit_index].
                    swap_in_requests) / 1000.0;
            ELSE
              unit_qtime_per_swap_in_req := 0.0;
            IFEND;

            IF user_unit_stats_p^.disk_unit_stats [unit_index].swap_out_requests <> 0 THEN
              unit_qtime_per_swap_out_req := $REAL (user_unit_stats_p^.disk_unit_stats [unit_index].
                    swap_out_qtime) / $REAL (user_unit_stats_p^.disk_unit_stats [unit_index].
                    swap_out_requests) / 1000.0;
            ELSE
              unit_qtime_per_swap_out_req := 0.0;
            IFEND;

            IF unit_total_requests <> 0 THEN
              unit_qtime_per_total_req := $REAL (unit_total_qtime) / $REAL (unit_total_requests) / 1000.0;
            ELSE
              unit_qtime_per_total_req := 0.0;
            IFEND;

            unit_str_req_count_total := user_unit_stats_p^.disk_unit_stats [unit_index].
                  streamed_req_count_read + user_unit_stats_p^.disk_unit_stats [unit_index].
                  streamed_req_count_write;

            unit_str_req_failed_total := user_unit_stats_p^.disk_unit_stats [unit_index].
                  streamed_req_failed_count_read + user_unit_stats_p^.disk_unit_stats [unit_index].
                  streamed_req_failed_count_write;

            IF (unit_str_req_count_total + unit_str_req_failed_total) <> 0 THEN
              unit_streamed_success := $REAL (unit_str_req_count_total) /
                    $REAL (unit_str_req_count_total + unit_str_req_failed_total) * 100.0;
            ELSE
              unit_streamed_success := 0.0;
            IFEND;

            unit_seeks := unit_total_requests - unit_str_req_count_total;

            STRINGREP (unit_data_p^.line_1, length, '  ', unit_id_data, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].read_requests: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].write_requests: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].swap_in_requests: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].swap_out_requests: 15, '  ',
                  unit_total_requests: 15);


            STRINGREP (unit_data_p^.line_2, length, '  ', unit_id_data, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].write_data_mau_count *
                  user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].write_data_and_preset_maus *
                  user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].swap_out_data_mau_count *
                  user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].swap_out_data_and_preset_maus *
                  user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau: 15, '  ',
                  unit_total_output_bytes: 15);


            STRINGREP (unit_data_p^.line_3, length, '  ', unit_id_data, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].read_mau_count *
                  user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].swap_in_mau_count *
                  user_unit_stats_p^.disk_unit_stats [unit_index].bytes_per_mau: 15, '  ',
                  unit_total_input_bytes: 15, '  ', unit_total_bytes: 15, '  ',
                  unit_avg_byte_count_per_req: 15);


            STRINGREP (unit_data_p^.line_4, length, '  ', unit_id_data, '  ', unit_qtime_per_read_req: 15: 2,
                  '  ', unit_qtime_per_write_req: 15: 2, '  ', unit_qtime_per_swap_in_req: 15: 2, '  ',
                  unit_qtime_per_swap_out_req: 15: 2, '  ', unit_qtime_per_total_req: 15: 2);

            STRINGREP (unit_data_p^.line_5, length, '  ', unit_id_data, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].streamed_req_count_read: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].streamed_req_count_write: 15, '  ',
                  unit_str_req_count_total: 15, '  ', user_unit_stats_p^.disk_unit_stats [unit_index].
                  streamed_req_failed_count_read: 15, '  ', user_unit_stats_p^.disk_unit_stats [unit_index].
                  streamed_req_failed_count_write: 15, '  ', unit_str_req_failed_total: 15, '  ',
                  unit_streamed_success: 7: 1);


            STRINGREP (unit_data_p^.line_6, length, '  ', unit_id_data, '  ',
                  unit_total_requests - unit_str_req_count_total: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].requests_causing_skipped_cyl: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].total_cylinders_skipped: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].recovered_errors: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].intermediate_errors: 15, '  ',
                  user_unit_stats_p^.disk_unit_stats [unit_index].unrecovered_errors: 15);


            increment_unit_sums;

          IFEND;
        FOREND /unit_loop/;
      PROCEND format_unit_data;
?? OLDTITLE ??

?? EJECT, NEWTITLE := '            PROCEDURE output_unit_data' ??

      PROCEDURE output_unit_data;

        VAR
          dashes: string (40),
          unit_input_bytes_per_input_req: integer,
          unit_read_bytes_per_read: integer,
          unit_read_qtime_per_read: integer,
          unit_si_bytes_per_si: integer,
          unit_si_qtime_per_si: integer,
          unit_so_data_bytes_per_so: integer,
          unit_so_data_pr_bytes_per_so: integer,
          unit_so_qtime_per_so: integer,
          unit_str_reads_per_read: real,
          unit_str_reads_fail_per_read: real,
          unit_str_req_count_read_pct: real,
          unit_str_req_count_write_pct: real,
          unit_str_req_count_total_pct: real,
          unit_str_req_failed_read_pct: real,
          unit_str_req_failed_write_pct: real,
          unit_str_req_failed_total_pct: real,
          unit_str_tot_fail_per_tot_req: real,
          unit_str_tot_per_tot_req: real,
          unit_str_writes_fail_per_write: real,
          unit_str_writes_per_write: real,
          unit_tot_bytes_per_tot_req: integer,
          unit_tot_out_bytes_per_tot_out: integer,
          unit_tot_qtime_per_tot_req: integer,
          unit_write_data_bytes_per_write: integer,
          unit_write_qtime_per_write: integer,
          unit_wrt_data_pr_bytes_per_wrt: integer;

        dashes (1, 40) := '--------------------------------------';

        clp$new_display_line (display_control, 3, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        clp$put_display (display_control, '  UNIT STATISTICS', clc$trim, status);

{Output Block 1 of Unit Statistics

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' Unit': 6, '  ', ' Unit': 7, '  ', ' Read Requests': 15, '  ',
              'Write Requests': 15, '  ', '    Swapin': 15, '  ', '    Swapout': 15, '  ', '     Total': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', '  VSN': 6, '  ', ' Type': 7, '  ', ' (w/o Swapin)': 15, '  ',
              ' (w/o Swapout)': 15, '  ', '   Requests': 15, '  ', '   Requests': 15, '  ',
              '   Requests': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15);

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

        RESET unit_data_seq_p;

        FOR i := 1 TO active_unit_count DO
          NEXT unit_data_p IN unit_data_seq_p;
          clp$put_display (display_control, unit_data_p^.line_1, clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        FOREND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' sum': #SIZE (unit_id_data), '  ', unit_read_requests_sum: 15, '  ',
              unit_write_requests_sum: 15, '  ', unit_swap_in_requests_sum: 15, '  ',
              unit_swap_out_requests_sum: 15, '  ', unit_total_requests_sum: 15);

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

        IF time_interval_sec <> 0.0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/sec': #SIZE (unit_id_data), '  ',
                $REAL (unit_read_requests_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (unit_write_requests_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (unit_swap_in_requests_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (unit_swap_out_requests_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (unit_total_requests_sum) / time_interval_sec: 15: 2);

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

        IF unit_total_requests_sum <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/total req': #SIZE (unit_id_data),
                '  ', $REAL (unit_read_requests_sum) / $REAL (unit_total_requests_sum): 15: 2,
                '  ', $REAL (unit_write_requests_sum) / $REAL (unit_total_requests_sum): 15: 2,
                '  ', $REAL (unit_swap_in_requests_sum) / $REAL (unit_total_requests_sum): 15: 2, '  ',
                $REAL (unit_swap_out_requests_sum) / $REAL (unit_total_requests_sum): 15: 2,
                '  ', $REAL ($REAL (unit_total_requests_sum)) / $REAL (unit_total_requests_sum): 15: 2);

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

        IF unit_total_seeks_sum <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/sk': #SIZE (unit_id_data), '  ', '': 15, '  ', '': 15, '  ',
                '': 15, '  ', '': 15, '  ', $REAL (unit_total_requests_sum) / $REAL (unit_total_seeks_sum):
                15: 2);

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

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF active_unit_count <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', ' avg': #SIZE (unit_id_data), '  ',
                unit_read_requests_sum DIV active_unit_count: 15, '  ',
                unit_write_requests_sum DIV active_unit_count: 15, '  ',
                unit_swap_in_requests_sum DIV active_unit_count: 15, '  ',
                unit_swap_out_requests_sum DIV active_unit_count: 15, '  ',
                unit_total_requests_sum DIV active_unit_count: 15);

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

          IF time_interval_sec <> 0.0 THEN
            line (1, * ) := '  ';
            STRINGREP (line, length, '  ', '/sec': #SIZE (unit_id_data),
                  '  ', $REAL (unit_read_requests_sum DIV active_unit_count) / time_interval_sec: 15: 2, '  ',
                  $REAL (unit_write_requests_sum DIV active_unit_count) / time_interval_sec: 15: 2, '  ',
                  $REAL (unit_swap_in_requests_sum DIV active_unit_count) / time_interval_sec: 15: 2, '  ',
                  $REAL (unit_swap_out_requests_sum DIV active_unit_count) / time_interval_sec: 15: 2, '  ',
                  $REAL (unit_total_requests_sum DIV active_unit_count) / time_interval_sec: 15: 2);

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

{Output Block 2 of Unit Statistics

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' Unit': 6, '  ', ' Unit': 7, '  ', 'Write w/o Swap': 15, '  ',
              'Write w/o Swap': 15, '  ', '    Swapout': 15, '  ', '    Swapout': 15, '  ',
              '  Total Write': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', '  VSN': 6, '  ', ' Type': 7, '  ', 'Byt_Cnt (Data)': 15, '  ',
              'Byt_Cnt (D&PR)': 15, '  ', 'Byt_Cnt (Data)': 15, '  ', 'Byt_Cnt (D&PR)': 15, '  ',
              'Byt_Cnt (D&PR)': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15);

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

        RESET unit_data_seq_p;

        FOR i := 1 TO active_unit_count DO
          NEXT unit_data_p IN unit_data_seq_p;
          clp$put_display (display_control, unit_data_p^.line_2, clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        FOREND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' sum': #SIZE (unit_id_data), '  ', unit_write_data_bytes_sum: 15,
              '  ', unit_write_data_pr_bytes_sum: 15, '  ', unit_swap_out_data_bytes_sum: 15, '  ',
              unit_swap_out_data_pr_bytes_sum: 15, '  ', unit_total_output_bytes_sum: 15);

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

        IF time_interval_sec <> 0.0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/sec': #SIZE (unit_id_data),
                '  ', $INTEGER ($REAL (unit_write_data_bytes_sum) / time_interval_sec): 15: 2, '  ',
                $INTEGER ($REAL (unit_write_data_pr_bytes_sum) / time_interval_sec):
                15: 2, '  ', $INTEGER ($REAL (unit_swap_out_data_bytes_sum) / time_interval_sec): 15: 2, '  ',
                $INTEGER ($REAL (unit_swap_out_data_pr_bytes_sum) / time_interval_sec): 15: 2, '  ',
                $INTEGER ($REAL (unit_total_output_bytes_sum) / time_interval_sec): 15: 2);

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

        unit_total_output_requests_sum := unit_write_requests_sum + unit_swap_out_requests_sum;
        IF unit_total_output_requests_sum <> 0 THEN
          unit_tot_out_bytes_per_tot_out := unit_total_output_bytes_sum DIV unit_total_output_requests_sum;

          IF unit_swap_out_requests_sum <> 0 THEN
            unit_so_data_bytes_per_so := unit_swap_out_data_bytes_sum DIV unit_swap_out_requests_sum;
            unit_so_data_pr_bytes_per_so := unit_swap_out_data_pr_bytes_sum DIV unit_swap_out_requests_sum;
          ELSE
            unit_so_data_bytes_per_so := 0;
            unit_so_data_pr_bytes_per_so := 0;
          IFEND;

          IF unit_write_requests_sum <> 0 THEN
            unit_write_data_bytes_per_write := unit_write_data_bytes_sum DIV unit_write_requests_sum;
            unit_wrt_data_pr_bytes_per_wrt := unit_write_data_pr_bytes_sum DIV unit_write_requests_sum;
          ELSE
            unit_write_data_bytes_per_write := 0;
            unit_wrt_data_pr_bytes_per_wrt := 0;
          IFEND;

          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/req type': #SIZE (unit_id_data), '  ',
                unit_write_data_bytes_per_write: 15, '  ', unit_wrt_data_pr_bytes_per_wrt: 15, '  ',
                unit_so_data_bytes_per_so: 15, '  ', unit_so_data_pr_bytes_per_so: 15, '  ',
                unit_tot_out_bytes_per_tot_out: 15);

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


        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF active_unit_count <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', ' avg': #SIZE (unit_id_data), '  ',
                unit_write_data_bytes_sum DIV active_unit_count: 15, '  ',
                unit_write_data_pr_bytes_sum DIV active_unit_count: 15, '  ',
                unit_swap_out_data_bytes_sum DIV active_unit_count: 15, '  ',
                unit_swap_out_data_pr_bytes_sum DIV active_unit_count: 15, '  ',
                unit_total_output_bytes_sum DIV active_unit_count: 15);

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

          IF time_interval_sec <> 0.0 THEN
            line (1, * ) := '  ';
            STRINGREP (line, length, '  ', '/sec': #SIZE (unit_id_data),
                  '  ', $INTEGER ($REAL (unit_write_data_bytes_sum DIV active_unit_count) /
                  time_interval_sec): 15, '  ', $INTEGER ($REAL (unit_write_data_pr_bytes_sum DIV
                  active_unit_count) / time_interval_sec): 15, '  ',
                  $INTEGER ($REAL (unit_swap_out_data_bytes_sum DIV active_unit_count) /
                  time_interval_sec): 15, '  ', $INTEGER ($REAL (unit_swap_out_data_pr_bytes_sum DIV
                  active_unit_count) / time_interval_sec): 15, '  ',
                  $INTEGER ($REAL (unit_total_output_bytes_sum DIV active_unit_count) /
                  time_interval_sec): 15);

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

{Output Block 3 of Unit Statistics

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' Unit': 6, '  ', ' Unit': 7, '  ', ' Read w/o Swap': 15, '  ',
              '    Swapin': 15, '  ', '  Total Read': 15, '  ', '  Total Unit': 15, '  ',
              'Avg Byte_Count': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', '  VSN': 6, '  ', ' Type': 7, '  ', '  Byte_Count': 15, '  ',
              '  Byte_Count': 15, '  ', '  Byte_Count': 15, '  ', '  Byte_Count': 15, '  ',
              '  per Request': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15);

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

        RESET unit_data_seq_p;

        FOR i := 1 TO active_unit_count DO
          NEXT unit_data_p IN unit_data_seq_p;
          clp$put_display (display_control, unit_data_p^.line_3, clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        FOREND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' sum': #SIZE (unit_id_data), '  ', unit_read_bytes_sum: 15, '  ',
              unit_swap_in_bytes_sum: 15, '  ', unit_total_input_bytes_sum: 15, '  ',
              unit_total_bytes_sum: 15);

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

        IF time_interval_sec <> 0.0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/sec': #SIZE (unit_id_data),
                '  ', $INTEGER ($REAL (unit_read_bytes_sum) / time_interval_sec): 15, '  ',
                $INTEGER ($REAL (unit_swap_in_bytes_sum) / time_interval_sec): 15, '  ',
                $INTEGER ($REAL (unit_total_input_bytes_sum) / time_interval_sec): 15, '  ',
                $INTEGER ($REAL (unit_total_bytes_sum) / time_interval_sec): 15);

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

        IF unit_total_requests_sum <> 0 THEN
          unit_tot_bytes_per_tot_req := unit_total_bytes_sum DIV unit_total_requests_sum;
          unit_total_input_requests_sum := unit_read_requests_sum + unit_swap_in_requests_sum;
          IF unit_total_input_requests_sum <> 0 THEN
            unit_input_bytes_per_input_req := unit_total_input_bytes_sum DIV unit_total_input_requests_sum;
            IF unit_swap_in_requests_sum <> 0 THEN
              unit_si_bytes_per_si := unit_swap_in_bytes_sum DIV unit_swap_in_requests_sum;
            ELSE
              unit_si_bytes_per_si := 0;
            IFEND;
            IF unit_read_requests_sum <> 0 THEN
              unit_read_bytes_per_read := unit_read_bytes_sum DIV unit_read_requests_sum;
            ELSE
              unit_read_bytes_per_read := 0;
            IFEND;
          ELSE
            unit_si_bytes_per_si := 0;
            unit_read_bytes_per_read := 0;
            unit_input_bytes_per_input_req := 0;
          IFEND;

          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/req type': #SIZE (unit_id_data), '  ',
                unit_read_bytes_per_read: 15, '  ', unit_si_bytes_per_si: 15, '  ',
                unit_input_bytes_per_input_req: 15, '  ', unit_tot_bytes_per_tot_req: 15);

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

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF active_unit_count <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', ' avg': #SIZE (unit_id_data), '  ',
                unit_read_bytes_sum DIV active_unit_count: 15, '  ',
                unit_swap_in_bytes_sum DIV active_unit_count: 15, '  ',
                unit_total_input_bytes_sum DIV active_unit_count: 15, '  ',
                unit_total_bytes_sum DIV active_unit_count: 15, '  ',
                unit_avg_byte_count_per_req_sum DIV active_unit_count: 15);

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

          IF time_interval_sec <> 0.0 THEN
            line (1, * ) := '  ';
            STRINGREP (line, length, '  ', '/sec': #SIZE (unit_id_data),
                  '  ', $INTEGER ($REAL (unit_read_bytes_sum DIV active_unit_count) / time_interval_sec): 15,
                  '  ', $INTEGER ($REAL (unit_swap_in_bytes_sum DIV active_unit_count) /
                  time_interval_sec): 15, '  ', $INTEGER ($REAL (unit_total_input_bytes_sum DIV
                  active_unit_count) / time_interval_sec): 15, '  ',
                  $INTEGER ($REAL (unit_total_bytes_sum DIV active_unit_count) / time_interval_sec): 15);

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

{Output Block 4 of Unit Statistics

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' Unit': 6, '  ', ' Unit': 7, '  ', ' Read w/o Swap': 15, '  ',
              'Write w/o Swap': 15, '  ', '    Swapin': 15, '  ', '    Swapout': 15, '  ',
              '  Total Unit': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', '  VSN': 6, '  ', ' Type': 7, '  ', ' Avg Resp Time': 15, '  ',
              ' Avg Resp Time': 15, '  ',' Avg Resp Time': 15, '  ',' Avg Resp Time': 15, '  ',
              ' Avg Resp Time': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15);

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

        RESET unit_data_seq_p;

        FOR i := 1 TO active_unit_count DO
          NEXT unit_data_p IN unit_data_seq_p;
          clp$put_display (display_control, unit_data_p^.line_4, clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        FOREND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15);

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

        IF active_unit_count <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', ' avg': #SIZE (unit_id_data), '  ',
                unit_qtime_per_read_req_sum / $REAL (active_unit_count): 15: 2, '  ',
                unit_qtime_per_write_req_sum / $REAL (active_unit_count): 15: 2, '  ',
                unit_qtime_per_swap_in_req_sum / $REAL (active_unit_count): 15: 2, '  ',
                unit_qtime_per_swap_out_req_sum / $REAL (active_unit_count): 15: 2, '  ',
                unit_qtime_per_total_req_sum / $REAL (active_unit_count): 15: 2);

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

{Output Block 5 of Unit Statistics

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' Unit': 6, '  ', ' Unit': 7, '  ', ' Read Requests': 15, '  ',
              'Write Requests': 15, '  ', 'Total Requests': 15, '  ', ' Read Req that': 15, '  ',
              'Write Req that': 15, '  ', 'Total Req that': 15, '  ', 'Stream': 7);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', '  VSN': 6, '  ', ' Type': 7, '  ', ' that Streamed': 15, '  ',
              ' that Streamed': 15, '  ', ' that Streamed': 15, '  ', ' Failed to Str': 15, '  ',
              ' Failed to Str': 15, '  ', ' Failed to Str': 15, '  ', 'Success': 7);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 7): 7);

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

        RESET unit_data_seq_p;

        FOR i := 1 TO active_unit_count DO
          NEXT unit_data_p IN unit_data_seq_p;
          clp$put_display (display_control, unit_data_p^.line_5, clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        FOREND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 7): 7);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' sum': #SIZE (unit_id_data), '  ', unit_str_req_count_read_sum: 15,
              '  ', unit_str_req_count_write_sum: 15, '  ', unit_str_req_count_total_sum: 15, '  ',
              unit_str_req_failed_read_sum: 15, '  ', unit_str_req_failed_write_sum: 15, '  ',
              unit_str_req_failed_total_sum: 15);

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

        IF time_interval_sec <> 0.0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/sec': #SIZE (unit_id_data),
                '  ', $REAL (unit_str_req_count_read_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (unit_str_req_count_write_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (unit_str_req_count_total_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (unit_str_req_failed_read_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (unit_str_req_failed_write_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (unit_str_req_failed_total_sum) / time_interval_sec: 15: 2);

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

        IF unit_total_requests_sum <> 0 THEN

          unit_str_tot_per_tot_req := $REAL (unit_str_req_count_total_sum) / $REAL (unit_total_requests_sum);
          unit_str_tot_fail_per_tot_req := $REAL (unit_str_req_failed_total_sum) /
                $REAL (unit_total_requests_sum);

          IF unit_total_input_requests_sum <> 0 THEN
            unit_str_reads_per_read := $REAL (unit_str_req_count_read_sum) /
                  $REAL (unit_total_input_requests_sum);
            unit_str_reads_fail_per_read := $REAL (unit_str_req_failed_read_sum) /
                  $REAL (unit_total_input_requests_sum);
          ELSE
            unit_str_reads_per_read := 0.0;
            unit_str_reads_fail_per_read := 0.0;
          IFEND;

          IF unit_total_output_requests_sum <> 0 THEN
            unit_str_writes_per_write := $REAL (unit_str_req_count_write_sum) /
                  $REAL (unit_total_output_requests_sum);
            unit_str_writes_fail_per_write := $REAL (unit_str_req_failed_write_sum) /
                  $REAL (unit_total_output_requests_sum);
          ELSE
            unit_str_writes_per_write := 0.0;
            unit_str_writes_fail_per_write := 0.0;
          IFEND;

          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/req type': #SIZE (unit_id_data), '  ',
                unit_str_reads_per_read: 15: 2, '  ', unit_str_writes_per_write: 15: 2, '  ',
                unit_str_tot_per_tot_req: 15: 2, '  ', unit_str_reads_fail_per_read: 15: 2, '  ',
                unit_str_writes_fail_per_write: 15: 2, '  ', unit_str_tot_fail_per_tot_req: 15: 2);

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

        IF unit_total_requests_sum <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/total req': #SIZE (unit_id_data),
                '  ', $REAL (unit_str_req_count_read_sum) / $REAL (unit_total_requests_sum): 15: 2, '  ',
                $REAL (unit_str_req_count_write_sum) / $REAL (unit_total_requests_sum): 15: 2,
                '  ', $REAL (unit_str_req_count_total_sum) / $REAL (unit_total_requests_sum): 15: 2, '  ',
                $REAL (unit_str_req_failed_read_sum) / $REAL (unit_total_requests_sum): 15: 2,
                '  ', $REAL (unit_str_req_failed_write_sum) / $REAL (unit_total_requests_sum): 15: 2, '  ',
                $REAL (unit_str_req_failed_total_sum) / $REAL (unit_total_requests_sum): 15: 2);

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

        IF unit_str_req_count_total_sum <> 0 THEN
          unit_str_req_count_read_pct := $REAL (unit_str_req_count_read_sum) /
                $REAL (unit_str_req_count_total_sum) * 100.0;
          unit_str_req_count_write_pct := $REAL (unit_str_req_count_write_sum) /
                $REAL (unit_str_req_count_total_sum) * 100.0;
          unit_str_req_count_total_pct := $REAL (unit_str_req_count_total_sum) /
                $REAL (unit_str_req_count_total_sum) * 100.0;
        ELSE
          unit_str_req_count_read_pct := 0.0;
          unit_str_req_count_write_pct := 0.0;
          unit_str_req_count_total_pct := 0.0;
        IFEND;

        IF unit_str_req_failed_total_sum <> 0 THEN
          unit_str_req_failed_read_pct := $REAL (unit_str_req_failed_read_sum) /
                $REAL (unit_str_req_failed_total_sum) * 100.0;
          unit_str_req_failed_write_pct := $REAL (unit_str_req_failed_write_sum) /
                $REAL (unit_str_req_failed_total_sum) * 100.0;
          unit_str_req_failed_total_pct := $REAL (unit_str_req_failed_total_sum) /
                $REAL (unit_str_req_failed_total_sum) * 100.0;
        ELSE
          unit_str_req_failed_read_pct := 0.0;
          unit_str_req_failed_write_pct := 0.0;
          unit_str_req_failed_total_pct := 0.0;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' pct': #SIZE (unit_id_data), '  ', unit_str_req_count_read_pct: 15: 2,
              '  ', unit_str_req_count_write_pct: 15: 2, '  ', unit_str_req_count_total_pct: 15: 2, '  ',
              unit_str_req_failed_read_pct: 15: 2, '  ', unit_str_req_failed_write_pct: 15: 2, '  ',
              unit_str_req_failed_total_pct: 15: 2);

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

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF active_unit_count <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', ' avg': #SIZE (unit_id_data), '  ',
                unit_str_req_count_read_sum DIV active_unit_count: 15, '  ',
                unit_str_req_count_write_sum DIV active_unit_count: 15, '  ',
                unit_str_req_count_total_sum DIV active_unit_count: 15, '  ',
                unit_str_req_failed_read_sum DIV active_unit_count: 15, '  ',
                unit_str_req_failed_write_sum DIV active_unit_count: 15, '  ',
                unit_str_req_failed_total_sum DIV active_unit_count: 15, '  ',
                unit_streamed_success_sum / $REAL (active_unit_count): 7: 1);

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

          IF time_interval_sec <> 0.0 THEN
            line (1, * ) := '  ';
            STRINGREP (line, length, '  ', '/sec': #SIZE (unit_id_data),
                  '  ', $REAL (unit_str_req_count_read_sum DIV active_unit_count) / time_interval_sec: 15: 2,
                  '  ', $REAL (unit_str_req_count_write_sum DIV active_unit_count) / time_interval_sec: 15: 2,
                  '  ', $REAL (unit_str_req_count_total_sum DIV active_unit_count) / time_interval_sec: 15: 2,
                  '  ', $REAL (unit_str_req_failed_read_sum DIV active_unit_count) / time_interval_sec: 15: 2,
                  '  ', $REAL (unit_str_req_failed_write_sum DIV active_unit_count) /
                  time_interval_sec: 15: 2, '  ', $REAL (unit_str_req_failed_total_sum DIV
                  active_unit_count) / time_interval_sec: 15: 2);

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

{Output Block 6 of Unit Statistics

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' Unit': 6, '  ', ' Unit': 7, '  ', '     Total': 15, '  ',
              '  Req Causing': 15, '  ', '  Total Cyls': 15, '  ', '   Recovered': 15, '  ',
              ' Intermediate': 15, '  ', '  Unrecovered': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', '  VSN': 6, '  ', ' Type': 7, '  ', '     Seeks': 15, '  ',
              '  Skipped Cyls': 15, '  ', '    Skipped': 15, '  ', '     Errors': 15, '  ', '     Errors': 15,
              '  ', '     Errors': 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15, '  ', dashes (1, 15): 15);

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

        RESET unit_data_seq_p;

        FOR i := 1 TO active_unit_count DO
          NEXT unit_data_p IN unit_data_seq_p;
          clp$put_display (display_control, unit_data_p^.line_6, clc$trim, status);
          IF NOT status.normal THEN
            RETURN;
          IFEND;
        FOREND;

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', dashes (1, 6): 6, '  ', dashes (1, 7): 7, '  ', dashes (1, 15): 15,
              '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1, 15): 15, '  ', dashes (1,
              15): 15, '  ', dashes (1, 15): 15);

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

        line (1, * ) := '  ';
        STRINGREP (line, length, '  ', ' sum': #SIZE (unit_id_data), '  ', unit_total_seeks_sum: 15, '  ',
              unit_req_caus_skipped_cyl_sum: 15, '  ', unit_total_cyl_skipped_sum: 15, '  ',
              unit_recovered_errors_sum: 15, '  ', unit_intermediate_errors_sum: 15, '  ',
              unit_unrecovered_errors_sum: 15);

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

        IF time_interval_sec <> 0.0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/sec': #SIZE (unit_id_data), '  ',
                $REAL (unit_total_seeks_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (unit_req_caus_skipped_cyl_sum) / time_interval_sec: 15: 2, '  ',
                $REAL (unit_total_cyl_skipped_sum) / time_interval_sec: 15: 2);

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

        IF unit_total_requests_sum <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/total req': #SIZE (unit_id_data),
                '  ', $REAL (unit_total_seeks_sum) / $REAL (unit_total_requests_sum): 15: 2,
                '  ', $REAL (unit_req_caus_skipped_cyl_sum) / $REAL (unit_total_requests_sum): 15: 2, '  ',
                $REAL (unit_total_cyl_skipped_sum) / $REAL (unit_total_requests_sum): 15: 2);

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

        IF unit_total_seeks_sum <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', '/sk': #SIZE (unit_id_data), '  ', '': 15, '  ', '': 15, '  ',
                $REAL (unit_total_cyl_skipped_sum) / $REAL (unit_total_seeks_sum): 15: 2, '  ', '': 15, '  ',
                '': 15, '  ', '': 15);

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

        clp$new_display_line (display_control, 1, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;

        IF active_unit_count <> 0 THEN
          line (1, * ) := '  ';
          STRINGREP (line, length, '  ', ' avg': #SIZE (unit_id_data), '  ',
                unit_total_seeks_sum DIV active_unit_count: 15, '  ',
                unit_req_caus_skipped_cyl_sum DIV active_unit_count: 15, '  ',
                unit_total_cyl_skipped_sum DIV active_unit_count: 15, '  ', '': 15, '  ', '': 15, '  ',
                '': 15);

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

          IF time_interval_sec <> 0.0 THEN
            line (1, * ) := '  ';
            STRINGREP (line, length, '  ', '/sec': #SIZE (unit_id_data),
                  '  ', $REAL (unit_total_seeks_sum DIV active_unit_count) / time_interval_sec: 15: 2, '  ',
                  $REAL (unit_req_caus_skipped_cyl_sum DIV active_unit_count) / time_interval_sec: 15: 2,
                  '  ', $REAL (unit_total_cyl_skipped_sum DIV active_unit_count) / time_interval_sec: 15: 2,
                  '  ', '': 15, '  ', '': 15, '  ', '': 15, '  ');

            clp$put_display (display_control, line, clc$trim, status);
            IF NOT status.normal THEN
              RETURN;
            IFEND;
          IFEND;
        IFEND;
      PROCEND output_unit_data;
?? OLDTITLE ??

?? EJECT ??
      PUSH unit_data_seq_p: [[REP unit_count OF unit_data_record]];
      active_unit_count := 0;
      initialize_unit_sums;
      format_unit_data;
      output_unit_data;
    PROCEND report_unit_data;
?? OLDTITLE ??

?? EJECT ??
    time_interval := $REAL (user_pp_stats_p^.time);
    time_interval_sec := time_interval / 1000000.0;


    report_path_and_pp_data;
    report_unit_data;


  PROCEND format_pio_stats;

?? EJECT, TITLE := 'PROCEDURE format_scheduler_data' ??

    PROCEDURE format_scheduler_data (
          user_copy_of_data: ost$sched_stats;
      VAR display_control: clt$display_control;
      VAR status: ost$status);

      VAR
        line: string (75),
        string_rep: string (20),
        index: jmt$sched_statistic_elements,
        length: integer,
        statistic_id: [STATIC, READ, oss$job_paged_literal] array [jmt$sched_statistic_elements]
              of string (32) :=
{ 0            } ['  lower priority swap count     ',
{ 1             } '  thrashing in activate jobs    ',
{ 2             } '  queues emptied count          ',
{ 3             } '  none left--activation viol    ',
{ 4             } '  bad status on activate        ',
{ 5             } '  ready task event count        ',
{ 6             } '  advance swap event count      ',
{ 7             } '  job terminated event count    ',
{ 8             } '  idle system event count       ',
{ 9             } '  lower maxaj event count       ',
{10             } '  swap for memory request count ',
{11             } '  swapout candidate event count ',
{12             } '  system thrashing event count  ',
{13             } '  exit thrashing none to swap   ',
{14             } '  operator request event count  ',
{15             } '  activate event count          ',
{16             } '  memory available in lw q      ',
{17             } '  wait for memory               ',
{18             } '  memory wait-no preempt        ',
{19             } '  memory wait-activation viol   ',
{20             } '  wait for ajlo                 ',
{21             } '  wait for ajlo-no preempt      ',
{22             } '  wait for ajlo-no pre-attempt  ',
{23             } '  wait for ajlo-activation viol ',
{24             } '  short wait                    ',
{25             } '  long wait                     ',
{26             } '  restore job already in memory ',
{27             } '  called advance lw jobs        ',
{28             } '  large ws bad status on swapin ',
{29             } '  large ws job activated        ',
{30             } '  large ws mem avail in lw q    ',
{31             } '  large ws preempt for memory   ',
{32             } '  large ws relink no preempt    ',
{33             } '  large ws relink job too big   ',
{34             } '  age shared q bad status       ',
{35             } '  age shared q activated        ',
{36             } '  change dispatching controls   ',
{37             } '  recovery swapin io error      ',
{38             } '  subsystem lock priority change',
{39             } '  recovered jobs swapin         ',
{40             } '  bad status after age job      ',
{41             } '  activate after age job        '];


      status.normal := TRUE;

      FOR  index := LOWERBOUND (statistic_id) TO UPPERBOUND (statistic_id) DO
        line (1, * ) := ' ';
        line (2, 32) := statistic_id [index];
        STRINGREP (string_rep, length, user_copy_of_data.job_scheduler_statistics [index]);
        line (36, length) := string_rep;
        clp$put_display (display_control, line (1, (36 + length)), clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      FOREND;

      clp$new_display_line (display_control, 1, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

    PROCEND format_scheduler_data;

?? EJECT, TITLE := 'PROCEDURE format_swap_file_statistics' ??

   PROCEDURE format_swap_file_statistics
     (    user_copy_of_data: ost$swap_file_stats;
      VAR display_control: clt$display_control;
      VAR status: ost$status);

     VAR
       interval_in_seconds: real,
       length: integer,
       line: string (80),
       pages_per_swap: real,
       segnum: ost$segment;

     line := '  ';
     line := '   SEGMENT NUMBER     TOTAL PAGES      PAGES PER SWAP   ';
     clp$put_display (display_control, line, clc$trim, status);
     IF NOT status.normal THEN
       RETURN;
     IFEND;

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

     interval_in_seconds := $real(user_copy_of_data.time) / 1000000.0;
     IF user_copy_of_data.swap_file_stats.total_swaps > 0 THEN
       FOR segnum := 1 TO 40(16) DO
         line := '  ';
         STRINGREP (line (10, 6), length, segnum);
         STRINGREP (line (26, 10), length,
               user_copy_of_data.swap_file_stats.total_pages_per_segment [segnum]);
         pages_per_swap := $real (user_copy_of_data.swap_file_stats.
            total_pages_per_segment [segnum]) / $real (user_copy_of_data.swap_file_stats.total_swaps);
         STRINGREP (line (44, 10), length, pages_per_swap:6:2);
         clp$put_display (display_control, line (1, 80), clc$trim, status);
         IF NOT status.normal THEN
           RETURN;
         IFEND;
       FOREND;
     IFEND;

     line := '  ';
     clp$put_display (display_control, line, clc$trim, status);
     IF NOT status.normal THEN
       RETURN;
     IFEND;
     line (1, 25) := ' TOTAL NUMBER OF SWAPS ';
     STRINGREP (line (35, 10), length, user_copy_of_data.swap_file_stats.total_swaps);
     clp$put_display (display_control, line, clc$trim, status);
     IF NOT status.normal THEN
       RETURN;
     IFEND;

   PROCEND format_swap_file_statistics;
?? EJECT, OLDTITLE, TITLE := 'PROCEDURE display_data    { main procedure }' ??

{**************************}
{main proc of module}


    clp$scan_parameter_list (parameter_list, display_data_pdt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$get_value ('RESET_MAXIMUM_TIME', 1, 1, clc$low, value, status);
    IF status.normal THEN
      reset_maximum_time := value.bool.value;
      IF (reset_maximum_time) AND (NOT (avp$system_administrator() OR
            avp$configuration_administrator())) THEN
        osp$set_status_abnormal ('CL', sye$rmt_restricted_to_sys_job, ' ', status);
        RETURN;
      IFEND;
    ELSE
      reset_maximum_time := FALSE;
    IFEND;

    clp$get_value ('OUTPUT', 1, 1, clc$low, value, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    file_name := value.file;

    clp$get_value ('DISPLAY_FORMAT', 1, 1, clc$low, value, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    IF (value.name.value = 'INCREMENTAL') OR (value.name.value = 'I') THEN
      display_format := osc$incremental;
    ELSE
      display_format := osc$total;
    IFEND;

{********************************************************}
{establishes a set with the requested options in it}


    requested_options := $option_set [];
    clp$get_set_count ('DISPLAY_OPTION', count, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    FOR i := 1 TO count DO
      clp$get_value ('DISPLAY_OPTION', i, 1, clc$low, value, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      IF value.name.value = 'ALL' THEN
        requested_options := id_set;
      ELSE
        FOR j := 1 TO table_length DO
          IF table [j].name = value.name.value THEN
            requested_options := requested_options + $option_set [table [j].id];
          IFEND;
        FOREND;
      IFEND;
    FOREND ;

{**************************************************************************}
{passes the requested options to a proc that formats and outputs the data}

    display_control := clv$nil_display_control;
    #spoil (display_control);
    osp$establish_block_exit_hndlr (^abort_handler);

    clp$open_display (file_name, ^clp$new_page_procedure, display_control, status);
    IF NOT status.normal THEN
      osp$disestablish_cond_handler;
      RETURN;
    IFEND;
    clv$titles_built := FALSE;

  /display/
    FOR k := LOWERVALUE (ost$data_id) TO UPPERVALUE (ost$data_id) DO
      IF k IN requested_options THEN
        i := LOWERBOUND (table);
        WHILE table [i].id <> k DO
          i := i + 1;
        WHILEND;

        IF table [i].name = 'JOB_DATA' THEN
          clv$command_name := 'display_job_data';
        ELSE { system_job_data }
          clv$command_name := 'display_system_data';
        IFEND;

        format_data (table [i], display_format, display_control, status);
        IF NOT status.normal THEN
          EXIT /display/;
        IFEND;

        IF reset_maximum_time THEN
          CASE table [i].id of
          = osc$mtr_requests, osc$swap_statistics =
            osp$reset_maximum_time (table [i].id);
          ELSE
            ;
          CASEND;
        IFEND;

      IFEND;
    FOREND /display/;

    clp$close_display (display_control, status);

    osp$disestablish_cond_handler;

  PROCEND display_data;

MODEND clm$display_system_data;

