?? RIGHT := 110 ??
?? NEWTITLE := 'ofm$designer_screens_r3 - NOS/VE console display procedures.' ??
MODULE ofm$designer_screens_r3;
?? RIGHT := 110 ??

{   PURPOSE:
{     This module contains procedures that drive the operator displays.

{ Set the following variable TRUE to allow a version of this module to be
{ compiled that
{ can be used for timimg runs to measure performance.
{ Note: you also have to delete the NOCOMPILE statement at the end of the
{ module.
{     . compile with debug code
{     . install as job template
{     . Login to template
{     . Enter the following commands:
{         SOU
{         VED AJ
{         EXET SP=VEDTEST
{ The output shows the times to paint one screen full of IJ entries. The test
{ code can be modified
{ if other screens need to be tested.

  ?VAR
    debug: boolean := FALSE?;

?? PUSH (LISTEXT := ON) ??
*copyc oss$job_paged_literal
*copyc oss$task_shared
*copyc dpc$number_of_window_lines
*copyc jmc$null_ajl_ordinal
*copyc osc$multiprocessor_constants
*copyc ofd$type_definition
*copyc cle$work_area_overflow
*copyc ofe$ecc_designer_screens
*copyc clt$work_area
*copyc dpt$window_id
*copyc oft$designer_screens_types
*copyc oft$display_procedure
*copyc oft$operator_classes
*copyc oft$operator_message_descriptor
*copyc ost$cpu_idle_statistics
*copyc ost$name_reference
*copyc pmt$condition
?? POP ??
*copyc fip#addl_char
*copyc fip#addl_initialize
*copyc fip#addl_integer
*copyc fip#addl_string
*copyc fip#addl_trimmed_string
*copyc i#program_error
*copyc clp$close_display
*copyc clp$put_display
*copyc cmp$get_element_entry_via_lun
*copyc dmp$search_avt_by_lun
*copyc dmp$search_avt_by_rvsn
*copyc dpp$get_starting_line
*copyc dpp$put_next_line
*copyc jmp$get_ijle_p
*copyc jmp$idetermine_job_class_abbrev
*copyc jmp$idetermine_serv_class_abbre
*copyc mlp$output_floating_number
*copyc nlp$name_match
*copyc ofp$build_system_line
*copyc ofp$open_display
*copyc ofp$search_for_display_name
*copyc osp$append_status_parameter
*copyc osp$clear_job_signature_lock
*copyc osp$establish_condition_handler
*copyc osp$get_rvsn_by_lun
*copyc osp$initialize_signature_lock
*copyc osp$set_job_signature_lock
*copyc osp$set_status_abnormal
*copyc osp$set_status_condition
*copyc pmp$binary_to_ascii_fit
*copyc pmp$continue_to_cause
*copyc pmp$convert_binary_unique_name
*copyc pmp$get_date_time_at_timestamp
*copyc pmp$zero_out_table
*copyc i#move

{*debug code begin
*copyc pmp$log_ascii
{*debug code end


{  Global variables referenced by this module.

*copyc cmv$logical_unit_table
*copyc dmv$active_volume_table
*copyc iov$disk_pp_usage_p
*copyc iov$disk_unit_usage_p
*copyc jmv$ajl_p
*copyc jmv$ijl_p
*copyc jmv$kjlx_p
*copyc jmv$max_ajl_ordinal_in_use
*copyc jsv$swap_status_id_array
*copyc osv$lower_to_upper
*copyc osv$task_shared_heap
*copyc syv$nos_system_time
?? NEWTITLE := 'STATIC data defined by this module', EJECT ??

  VAR
    ofv$displays_initialized: [XDCL, #GATE, oss$task_shared] boolean := FALSE,

    v$default_ms_display_infos: [STATIC, oss$job_paged_literal, READ] oft$mass_storage_display_infos := [
{ OFC$VED_MS       } [
{   DISPLAY_OPTIONS  } [
{     DEFAULT          } TRUE,
{     VALUES           } $oft$msdi_display_option_values [ofc$msdi_classes_out_of_space,
{                    } ofc$msdi_crit_class_added_count]],
{   SOPT_OPTION      } [TRUE, ofc$msdi_avt],
{   SPACE_QUANTITY   } ofc$msdi_dau,
{   SPACE_SELECTION  } ofc$msdi_mat_dat],
{ OFC$VED_MSS      } [
{   DISPLAY_OPTIONS  } [
{     DEFAULT          } TRUE,
{     VALUES           } $oft$msdi_display_option_values [ofc$msdi_total]],
{   SOPT_OPTION      } [TRUE, ofc$msdi_avt],
{   SPACE_QUANTITY   } ofc$msdi_mbytes,
{   SPACE_SELECTION  } ofc$msdi_capacity_available],
{ OFC$VED_MSU      } [
{   DISPLAY_OPTIONS  } [
{     DEFAULT          } TRUE,
{     VALUES           } $oft$msdi_display_option_values []],
{   SOPT_OPTION      } [TRUE, ofc$msdi_avt],
{   SPACE_QUANTITY   } ofc$msdi_mbytes,
{   SPACE_SELECTION  } ofc$msdi_capacity_available]],

    ofv$mass_storage_display_infos: [XDCL, #GATE, oss$task_shared] oft$mass_storage_display_infos := [
{ OFC$VED_MS       } [
{   DISPLAY_OPTIONS  } [
{     DEFAULT          } TRUE,
{     VALUES           } $oft$msdi_display_option_values [ofc$msdi_classes_out_of_space,
{                    } ofc$msdi_crit_class_added_count]],
{   SOPT_OPTION      } [TRUE, ofc$msdi_avt],
{   SPACE_QUANTITY   } ofc$msdi_dau,
{   SPACE_SELECTION  } ofc$msdi_mat_dat],
{ OFC$VED_MSS      } [
{   DISPLAY_OPTIONS  } [
{     DEFAULT          } TRUE,
{     VALUES           } $oft$msdi_display_option_values [ofc$msdi_total]],
{   SOPT_OPTION      } [TRUE, ofc$msdi_avt],
{   SPACE_QUANTITY   } ofc$msdi_mbytes,
{   SPACE_SELECTION  } ofc$msdi_capacity_available],
{ OFC$VED_MSU      } [
{   DISPLAY_OPTIONS  } [
{     DEFAULT          } TRUE,
{     VALUES           } $oft$msdi_display_option_values []],
{   SOPT_OPTION      } [TRUE, ofc$msdi_avt],
{   SPACE_QUANTITY   } ofc$msdi_mbytes,
{   SPACE_SELECTION  } ofc$msdi_capacity_available]],

    display_lock: [oss$task_shared] ost$signature_lock,

    display_descriptions_p: [oss$task_shared] oft$display_descriptions_p := NIL,

    unit_display_descriptions_p: [oss$task_shared] ^oft$unit_stat_display_desc := NIL,

    job_mode_conversion: [STATIC, oss$job_paged_literal, READ] array [jmt$job_mode] of string (2) := ['B ',
          'I ', 'ID', 'IL', 'IS'];

  CONST
    c$max_negative_numer_size = 20,
    c$max_positive_numer_size = 19;

  VAR
    v$max_integer_sizes: [STATIC, oss$job_paged_literal, READ] array [boolean] of 0 .. 21 := [
{ false } c$max_positive_numer_size,
{ true  } c$max_negative_numer_size];


?? FMT (FORMAT := OFF) ??
  VAR
    max_field_values: [STATIC, oss$job_paged_literal, READ] array [0 .. 21] of array [boolean] of integer:= [
{  0 } [0,                                      0],
{  1 } [0,                                      0],
{  2 } [9,                                      0],
{  3 } [99,                                    -9],
{  4 } [999,                                  -99],
{  5 } [9999,                                -999],
{  6 } [99999,                              -9999],
{  7 } [999999,                            -99999],
{  8 } [9999999,                          -999999],
{  9 } [99999999,                        -9999999],
{ 10 } [999999999,                      -99999999],
{ 11 } [9999999999,                    -999999999],
{ 12 } [99999999999,                  -9999999999],
{ 13 } [999999999999,                -99999999999],
{ 14 } [9999999999999,              -999999999999],
{ 15 } [99999999999999,            -9999999999999],
{ 16 } [999999999999999,          -99999999999999],
{ 17 } [9999999999999999,        -999999999999999],
{ 18 } [99999999999999999,      -9999999999999999],
{ 19 } [999999999999999999,    -99999999999999999],
{ 20 } [9223372036854775807,  -999999999999999999],
{ 21 } [9223372036854775807, -9223372036854775807]]; {NOTE: we use $min_integer+1 (absolute value...)
?? FMT (FORMAT := ON) ??

  VAR
    entry_status_conversion: [STATIC, oss$job_paged_literal, READ] array [jmt$ijl_entry_status] of
          string (2) := ['  ', 'T ', 'NS', 'M ', 'SI', 'S ', 'OF', 'SF', 'JD', 'RT', 'SC'],

    swap_reasons_conversion: [STATIC, oss$job_paged_literal, READ] array [jmt$swapout_reasons] of
          string (2) := [' ', 'RO', 'RT', 'RP', 'RI', 'RW', 'RM', 'RD', '*R'];

  VAR
    v$boolean_string: [STATIC, oss$job_paged_literal, READ] array [boolean] of string (5) :=
          ['FALSE', 'TRUE'];


{Renaming of oft$us_field_sources to make the following table more readable.

  TYPE
    t$sources = oft$us_field_sources;

  VAR
    v$field_source: [STATIC, oss$job_paged_literal, READ] array [oft$us_unit_statistic_key] of
          oft$us_field_sources := [
{ OFC$US_FILL                    } $t$sources [],
{ OFC$US_AVRG_BYTE_COUNT_PER_REQ } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_BYTES_PER_MAU           } $t$sources [ofc$us_statistic_data],
{ OFC$US_CHANNEL                 } $t$sources [ofc$us_statistic_data],
{ OFC$US_CURRENT_CYLINDER        } $t$sources [ofc$us_statistic_data],
{ OFC$US_ELEMENT_NAME            } $t$sources [ofc$us_statistic_data],
{ OFC$US_EQUIPMENT               } $t$sources [ofc$us_statistic_data],
{ OFC$US_FORCE_FORMAT            } $t$sources [ofc$us_unit_interface_table],
{ OFC$US_INTERMEDIATE_ERRORS     } $t$sources [ofc$us_statistic_data],
{ OFC$US_IOU_NUMBER              } $t$sources [ofc$us_statistic_data],
{ OFC$US_LAST_REQUEST_GOOD       } $t$sources [ofc$us_statistic_data],
{ OFC$US_LOGICAL_UNIT_NUMBER     } $t$sources [],
{ OFC$US_OFF_LINE_DRIVE_NUMBER   } $t$sources [ofc$us_unit_interface_table],
{ OFC$US_PARITY_PROTECT_ENABLED  } $t$sources [ofc$us_unit_interface_table],
{ OFC$US_PARITY_PROTECTED_DEVICE } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_QTIME_PER_READ_REQUEST  } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_QTIME_PER_SWAP_IN_REQ   } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_QTIME_PER_SWAP_OUT_REQ  } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_QTIME_PER_TOTAL_REQUEST } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_QTIME_PER_WRITE_REQUEST } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_READ_MAU_COUNT          } $t$sources [ofc$us_statistic_data],
{ OFC$US_READ_QTIME              } $t$sources [ofc$us_statistic_data],
{ OFC$US_READ_REQUESTS           } $t$sources [ofc$us_statistic_data],
{ OFC$US_RECORDED_VSN            } $t$sources [ofc$us_vsn],
{ OFC$US_RECOVERED_ERRORS        } $t$sources [ofc$us_statistic_data],
{ OFC$US_REQUESTS_CAUSE_SKIP_CYL } $t$sources [ofc$us_statistic_data],
{ OFC$US_RESTORING_DRIVE         } $t$sources [ofc$us_unit_interface_table],
{ OFC$US_SEEKS                   } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_STREAM_REQ_ATTEMPT_TOTAL} $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_STREAM_REQ_COUNT_TOTAL  } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_STREAM_REQ_FAILED_TOTAL } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_STREAMED_SUCCESS        } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_STRM_REQ_COUNT_READ     } $t$sources [ofc$us_statistic_data],
{ OFC$US_STRM_REQ_COUNT_WRITE    } $t$sources [ofc$us_statistic_data],
{ OFC$US_STRM_REQ_FAIL_CNT_READ  } $t$sources [ofc$us_statistic_data],
{ OFC$US_STRM_REQ_FAIL_CNT_WRT   } $t$sources [ofc$us_statistic_data],
{ OFC$US_STRM_REQUEST_POSSIBLE   } $t$sources [ofc$us_statistic_data],
{ OFC$US_SWAP_IN_MAU_COUNT       } $t$sources [ofc$us_statistic_data],
{ OFC$US_SWAP_IN_QTIME           } $t$sources [ofc$us_statistic_data],
{ OFC$US_SWAP_IN_REQUESTS        } $t$sources [ofc$us_statistic_data],
{ OFC$US_SWAP_OUT_DATA_MAU_COUNT } $t$sources [ofc$us_statistic_data],
{ OFC$US_SWAP_OUT_DATAPRES_MAUS  } $t$sources [ofc$us_statistic_data],
{ OFC$US_SWAP_OUT_QTIME          } $t$sources [ofc$us_statistic_data],
{ OFC$US_SWAP_OUT_REQUESTS       } $t$sources [ofc$us_statistic_data],
{ OFC$US_TOTAL_BYTES             } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_TOTAL_CYLINDERS_SKIPPED } $t$sources [ofc$us_statistic_data],
{ OFC$US_TOTAL_ERRORS            } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_TOTAL_INPUT_BYTES       } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_TOTAL_OUTPUT_BYTES      } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_TOTAL_QTIME             } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_TOTAL_REQUESTS          } $t$sources [ofc$us_statistic_data, ofc$us_extended_statistic_data],
{ OFC$US_UNIT_CONFIGURED         } $t$sources [ofc$us_statistic_data],
{ OFC$US_UNIT_DISABLED           } $t$sources [ofc$us_unit_interface_table],
{ OFC$US_UNIT_TYPE               } $t$sources [ofc$us_product_identification],
{ OFC$US_UNIT_USED               } $t$sources [ofc$us_statistic_data],
{ OFC$US_UNRECOVERED_ERRORS      } $t$sources [ofc$us_statistic_data],
{ OFC$US_WRITE_DATA_MAU_COUNT    } $t$sources [ofc$us_statistic_data],
{ OFC$US_WRITE_DATAPRES_MAUS     } $t$sources [ofc$us_statistic_data],
{ OFC$US_WRITE_QTIME             } $t$sources [ofc$us_statistic_data],
{ OFC$US_WRITE_REQUESTS          } $t$sources [ofc$us_statistic_data],
{ OFC$US_CONFIGURED              } $t$sources [ofc$us_logical_unit_table],
{ OFC$US_ENTRY_INTERLOCK         } $t$sources [ofc$us_logical_unit_table],
{ OFC$US_ELEMENT_CAPABILITIES    } $t$sources [ofc$us_logical_unit_table],
{ OFC$US_LOGICAL_UNIT_STATUS     } $t$sources [ofc$us_logical_unit_table],
{ OFC$US_ELEMENT_ACCESS          } $t$sources [ofc$us_logical_unit_table],
{ OFC$US_QUEUE_COUNT             } $t$sources [ofc$us_unit_interface_table],
{ OFC$US_UNIT_SHARED             } $t$sources [ofc$us_unit_interface_table],
{ OFC$US_ALLOCATION_ALLOWED      } $t$sources [ofc$us_active_volume_table],
{ OFC$US_SPACE_LOW               } $t$sources [ofc$us_active_volume_table],
{ OFC$US_SPACE_GONE              } $t$sources [ofc$us_active_volume_table],
{ OFC$US_DISK_TABLE_STATUS       } $t$sources [ofc$us_active_volume_table],
{ OFC$US_CLASS                   } $t$sources [ofc$us_active_volume_table],
{ OFC$US_SCA_SWAP_FILE_ACTIVITY  } $t$sources [ofc$us_active_volume_table],
{ OFC$US_SCA_CRIT_FILE_ACTIVITY  } $t$sources [ofc$us_active_volume_table],
{ OFC$US_SCA_TEMP_FILE_ACTIVITY  } $t$sources [ofc$us_active_volume_table],
{ OFC$US_LOGGED_IN_FOR_RECOVERY  } $t$sources [ofc$us_active_volume_table],
{ OFC$US_INTERNAL_VSN            } $t$sources [ofc$us_active_volume_table],
{ OFC$US_MAINFRAME_ASSIGNED      } $t$sources [ofc$us_active_volume_table],
{ OFC$US_SET_NAME                } $t$sources [ofc$us_active_volume_table],
{ OFC$US_STATUS                  } $t$sources [ofc$us_active_volume_table],
{ OFC$US_VOLUME_OWNER            } $t$sources [ofc$us_active_volume_table],
{ OFC$US_CURRENT_POSITION_N_LOG  } $t$sources [ofc$us_active_volume_table],
{ OFC$US_ALLOCATED_LOG_SIZE      } $t$sources [ofc$us_active_volume_table],
{ OFC$US_DEVICE_LOG_ENTRY_COUNT  } $t$sources [ofc$us_active_volume_table],
{ OFC$US_VOLUME_UNAVAILABLE      } $t$sources [ofc$us_active_volume_table],
{ OFC$US_PREV_ALLOCATION_ALLOWED } $t$sources [ofc$us_active_volume_table],
{ OFC$US_LOGGING_PROCESS_DAMAGED } $t$sources [ofc$us_active_volume_table],
{ OFC$US_BYTES_PER_CYLINDER      } $t$sources [ofc$us_statistic_data], {ff
{ OFC$US_ALLOCATION_SIZE         } $t$sources [ofc$us_statistic_data],
{ OFC$US_TRANSFER_SIZE           } $t$sources [ofc$us_statistic_data],
{ OFC$US_NUMBER_DFL_ENTRIES      } $t$sources [ofc$us_statistic_data],
{ OFC$US_NUMBER_DIRECTORY_ENTRIES} $t$sources [ofc$us_statistic_data],
{ OFC$US_CYLINDERS_PER_DEVICE    } $t$sources [ofc$us_statistic_data],
{ OFC$US_MAUS_PER_CYLINDER       } $t$sources [ofc$us_statistic_data],
{ OFC$US_MAUS_PER_DAU            } $t$sources [ofc$us_statistic_data],
{ OFC$US_SECTORS_PER_MAU         } $t$sources [ofc$us_statistic_data],
{ OFC$US_SECTORS_PER_TRACK       } $t$sources [ofc$us_statistic_data],
{ OFC$US_CAPACITY                } $t$sources [ofc$us_statistic_data],
{ OFC$US_AVAILABLE_MAT_SPACE     } $t$sources [ofc$us_statistic_data],
{ OFC$US_AVAILABLE_DAT_SPACE     } $t$sources [ofc$us_statistic_data],
{ OFC$US_BYTES_PER_DAU           } $t$sources [ofc$us_statistic_data],
{ OFC$US_NO_SPACE                } $t$sources [ofc$us_statistic_data],
{ OFC$US_NO_FILE_ENTRIES         } $t$sources [ofc$us_statistic_data],
{ OFC$US_REMAINING_BYTES         } $t$sources [ofc$us_statistic_data]];

{NOTE:
{  DO NEWER MANUALLY EDIT THE FOLLOWING DEFINITION.
{
{  This definition is produced by OFM$BUILD_UNIT_STAT_FIELD_INFO

  TYPE
    t$field_kind = (c$boolean, c$integer, c$longreal, c$miscellaneous, c$real, c$text,
          c$to_be_determined {??}),
    t$field_info = record
      kind: t$field_kind,
      offset: 0 .. 0ffff(16),
      size: 0 .. 0ff(16),
    recend;

  VAR
    v$field_info: [STATIC, oss$job_paged_literal, READ] array [oft$us_unit_statistic_key] of t$field_info := [
{ OFC$US_FILL                    } [c$miscellaneous, 0, 0],
{ OFC$US_AVRG_BYTE_COUNT_PER_REQ } [c$integer, 240, 8],
{ OFC$US_BYTES_PER_MAU           } [c$integer, 202, 2],
{ OFC$US_CHANNEL                 } [c$miscellaneous, 192, 3],
{ OFC$US_CURRENT_CYLINDER        } [c$integer, 165, 2],
{ OFC$US_ELEMENT_NAME            } [c$text, 206, 31],
{ OFC$US_EQUIPMENT               } [c$integer, 195, 1],
{ OFC$US_FORCE_FORMAT            } [c$boolean, 416, 1],
{ OFC$US_INTERMEDIATE_ERRORS     } [c$integer, 167, 8],
{ OFC$US_IOU_NUMBER              } [c$integer, 191, 1],
{ OFC$US_LAST_REQUEST_GOOD       } [c$boolean, 237, 1],
{ OFC$US_LOGICAL_UNIT_NUMBER     } [c$integer, 0, 2],
{ OFC$US_OFF_LINE_DRIVE_NUMBER   } [c$miscellaneous, 418, 1],
{ OFC$US_PARITY_PROTECT_ENABLED  } [c$boolean, 415, 1],
{ OFC$US_PARITY_PROTECTED_DEVICE } [c$boolean, 248, 1],
{ OFC$US_QTIME_PER_READ_REQUEST  } [c$real, 249, 8],
{ OFC$US_QTIME_PER_SWAP_IN_REQ   } [c$real, 257, 8],
{ OFC$US_QTIME_PER_SWAP_OUT_REQ  } [c$real, 265, 8],
{ OFC$US_QTIME_PER_TOTAL_REQUEST } [c$real, 273, 8],
{ OFC$US_QTIME_PER_WRITE_REQUEST } [c$real, 281, 8],
{ OFC$US_READ_MAU_COUNT          } [c$integer, 20, 8],
{ OFC$US_READ_QTIME              } [c$integer, 12, 8],
{ OFC$US_READ_REQUESTS           } [c$integer, 4, 8],
{ OFC$US_RECORDED_VSN            } [c$text, 196, 6],
{ OFC$US_RECOVERED_ERRORS        } [c$integer, 175, 8],
{ OFC$US_REQUESTS_CAUSE_SKIP_CYL } [c$integer, 149, 8],
{ OFC$US_RESTORING_DRIVE         } [c$boolean, 417, 1],
{ OFC$US_SEEKS                   } [c$integer, 289, 8],
{ OFC$US_STREAM_REQ_ATTEMPT_TOTAL} [c$integer, 313, 8],
{ OFC$US_STREAM_REQ_COUNT_TOTAL  } [c$integer, 297, 8],
{ OFC$US_STREAM_REQ_FAILED_TOTAL } [c$integer, 305, 8],
{ OFC$US_STREAMED_SUCCESS        } [c$real, 321, 8],
{ OFC$US_STRM_REQ_COUNT_READ     } [c$integer, 117, 8],
{ OFC$US_STRM_REQ_COUNT_WRITE    } [c$integer, 133, 8],
{ OFC$US_STRM_REQ_FAIL_CNT_READ  } [c$integer, 125, 8],
{ OFC$US_STRM_REQ_FAIL_CNT_WRT   } [c$integer, 141, 8],
{ OFC$US_STRM_REQUEST_POSSIBLE   } [c$boolean, 116, 1],
{ OFC$US_SWAP_IN_MAU_COUNT       } [c$integer, 76, 8],
{ OFC$US_SWAP_IN_QTIME           } [c$integer, 68, 8],
{ OFC$US_SWAP_IN_REQUESTS        } [c$integer, 60, 8],
{ OFC$US_SWAP_OUT_DATA_MAU_COUNT } [c$integer, 100, 8],
{ OFC$US_SWAP_OUT_DATAPRES_MAUS  } [c$integer, 108, 8],
{ OFC$US_SWAP_OUT_QTIME          } [c$integer, 92, 8],
{ OFC$US_SWAP_OUT_REQUESTS       } [c$integer, 84, 8],
{ OFC$US_TOTAL_BYTES             } [c$integer, 329, 8],
{ OFC$US_TOTAL_CYLINDERS_SKIPPED } [c$integer, 157, 8],
{ OFC$US_TOTAL_ERRORS            } [c$integer, 337, 8],
{ OFC$US_TOTAL_INPUT_BYTES       } [c$integer, 345, 8],
{ OFC$US_TOTAL_OUTPUT_BYTES      } [c$integer, 353, 8],
{ OFC$US_TOTAL_QTIME             } [c$integer, 361, 8],
{ OFC$US_TOTAL_REQUESTS          } [c$integer, 369, 8],
{ OFC$US_UNIT_CONFIGURED         } [c$boolean, 238, 1],
{ OFC$US_UNIT_DISABLED           } [c$boolean, 414, 1],
{ OFC$US_UNIT_TYPE               } [c$miscellaneous, 377, 10],
{ OFC$US_UNIT_USED               } [c$boolean, 239, 1],
{ OFC$US_UNRECOVERED_ERRORS      } [c$integer, 183, 8],
{ OFC$US_WRITE_DATA_MAU_COUNT    } [c$integer, 44, 8],
{ OFC$US_WRITE_DATAPRES_MAUS     } [c$integer, 52, 8],
{ OFC$US_WRITE_QTIME             } [c$integer, 36, 8],
{ OFC$US_WRITE_REQUESTS          } [c$integer, 28, 8],
{ OFC$US_CONFIGURED              } [c$boolean, 389, 1],
{ OFC$US_ENTRY_INTERLOCK         } [c$boolean, 390, 1],
{ OFC$US_ELEMENT_CAPABILITIES    } [c$miscellaneous, 391, 1],
{ OFC$US_LOGICAL_UNIT_STATUS     } [c$miscellaneous, 392, 21],
{ OFC$US_ELEMENT_ACCESS          } [c$miscellaneous, 413, 1],
{ OFC$US_QUEUE_COUNT             } [c$integer, 419, 2],
{ OFC$US_UNIT_SHARED             } [c$boolean, 421, 1],
{ OFC$US_ALLOCATION_ALLOWED      } [c$boolean, 424, 1],
{ OFC$US_SPACE_LOW               } [c$boolean, 425, 1],
{ OFC$US_SPACE_GONE              } [c$boolean, 426, 1],
{ OFC$US_DISK_TABLE_STATUS       } [c$miscellaneous, 427, 1],
{ OFC$US_CLASS                   } [c$miscellaneous, 428, 4],
{ OFC$US_SCA_SWAP_FILE_ACTIVITY  } [c$integer, 432, 8],
{ OFC$US_SCA_CRIT_FILE_ACTIVITY  } [c$integer, 440, 8],
{ OFC$US_SCA_TEMP_FILE_ACTIVITY  } [c$integer, 448, 8],
{ OFC$US_LOGGED_IN_FOR_RECOVERY  } [c$boolean, 472, 1],
{ OFC$US_INTERNAL_VSN            } [c$miscellaneous, 473, 11],
{ OFC$US_MAINFRAME_ASSIGNED      } [c$miscellaneous, 484, 5],
{ OFC$US_SET_NAME                } [c$text, 489, 31],
{ OFC$US_STATUS                  } [c$miscellaneous, 520, 1],
{ OFC$US_VOLUME_OWNER            } [c$miscellaneous, 521, 62],
{ OFC$US_CURRENT_POSITION_N_LOG  } [c$integer, 583, 8],
{ OFC$US_ALLOCATED_LOG_SIZE      } [c$integer, 591, 8],
{ OFC$US_DEVICE_LOG_ENTRY_COUNT  } [c$integer, 599, 8],
{ OFC$US_VOLUME_UNAVAILABLE      } [c$boolean, 607, 1],
{ OFC$US_PREV_ALLOCATION_ALLOWED } [c$boolean, 608, 1],
{ OFC$US_LOGGING_PROCESS_DAMAGED } [c$boolean, 609, 1],
{ OFC$US_BYTES_PER_CYLINDER      } [c$to_be_determined, 610, 3],
{ OFC$US_ALLOCATION_SIZE         } [c$to_be_determined, 613, 3],
{ OFC$US_TRANSFER_SIZE           } [c$to_be_determined, 616, 3],
{ OFC$US_NUMBER_DFL_ENTRIES      } [c$to_be_determined, 619, 3],
{ OFC$US_NUMBER_DIRECTORY_ENTRIES} [c$to_be_determined, 622, 2],
{ OFC$US_CYLINDERS_PER_DEVICE    } [c$to_be_determined, 624, 2],
{ OFC$US_MAUS_PER_CYLINDER       } [c$to_be_determined, 626, 2],
{ OFC$US_MAUS_PER_DAU            } [c$to_be_determined, 628, 1],
{ OFC$US_SECTORS_PER_MAU         } [c$to_be_determined, 629, 1],
{ OFC$US_SECTORS_PER_TRACK       } [c$to_be_determined, 630, 1],
{ OFC$US_CAPACITY                } [c$to_be_determined, 631, 8],
{ OFC$US_AVAILABLE_MAT_SPACE     } [c$to_be_determined, 639, 8],
{ OFC$US_AVAILABLE_DAT_SPACE     } [c$to_be_determined, 647, 8],
{ OFC$US_BYTES_PER_DAU           } [c$to_be_determined, 655, 8],
{ OFC$US_NO_SPACE                } [c$boolean, 663, 1],
{ OFC$US_NO_FILE_ENTRIES         } [c$boolean, 664, 1],
{ OFC$US_REMAINING_BYTES         } [c$to_be_determined, 666, 8]];

{NOTE:
{  DO NEWER MANUALLY EDIT THE PREVIOUS DEFINITION.
{
{  This definition is produced by OFM$BUILD_UNIT_STAT_FIELD_INFO


  VAR
    v$nil_unit_statistic_data: [STATIC, oss$job_paged_literal, READ] oft$unit_statistic_data := [
{ TOTAL_DATA                     } [
{   LOGICAL_UNIT_NUMBER            } 0,
{   DEFINED_SOURCES                } $oft$us_field_sources [],
{   integer variant                } 0,
{   READ_REQUESTS                  } 0,
{   READ_QTIME                     } 0,
{   READ_MAU_COUNT                 } 0,
{   WRITE_REQUESTS                 } 0,
{   WRITE_QTIME                    } 0,
{   WRITE_DATA_MAU_COUNT           } 0,
{   WRITE_DATA_AND_PRESET_MAUS     } 0,
{   SWAP_IN_REQUESTS               } 0,
{   SWAP_IN_QTIME                  } 0,
{   SWAP_IN_MAU_COUNT              } 0,
{   SWAP_OUT_REQUESTS              } 0,
{   SWAP_OUT_QTIME                 } 0,
{   SWAP_OUT_DATA_MAU_COUNT        } 0,
{   SWAP_OUT_DATA_AND_PRESET_MAUS  } 0,
{   STREAMED_REQUEST_POSSIBLE      } FALSE,
{   STREAMED_REQ_COUNT_READ        } 0,
{   STREAMED_REQ_FAILED_COUNT_READ } 0,
{   STREAMED_REQ_COUNT_WRITE       } 0,
{   STREAMED_REQ_FAILED_COUNT_WRITE} 0,
{   REQUESTS_CAUSING_SKIPPED_CYL   } 0,
{   TOTAL_CYLINDERS_SKIPPED        } 0,
{   CURRENT_CYLINDER               } 0,
{   INTERMEDIATE_ERRORS            } 0,
{   RECOVERED_ERRORS               } 0,
{   UNRECOVERED_ERRORS             } 0,
{   IOU_NUMBER                     } 0,
{   CHANNEL                        } [
{     NUMBER                         } 0,
{     PORT                           } cmc$unspecified_port,
{     CONCURRENT                     } FALSE],
{   EQUIPMENT                      } 0,
{   RECORDED_VSN                   } '',
{   BYTES_PER_MAU                  } 512, {smallest possible value
{   UNIT_TYPE                      } 0,
{   ELEMENT_NAME                   } '',
{   LAST_REQUEST_GOOD              } FALSE,
{   UNIT_CONFIGURED                } FALSE,
{   UNIT_USED                      } FALSE,
{   AVERAGE_BYTE_COUNT_PER_REQUEST } 0,
{   PARITY_PROTECTED_DEVICE        } FALSE,
{   QTIME_PER_READ_REQUEST         } 0.0,
{   QTIME_PER_SWAP_IN_REQUEST      } 0.0,
{   QTIME_PER_SWAP_OUT_REQUEST     } 0.0,
{   QTIME_PER_TOTAL_REQUEST        } 0.0,
{   QTIME_PER_WRITE_REQUEST        } 0.0,
{   SEEKS                          } 0,
{   STREAM_REQ_ATTEMPT_TOTAL       } 0,
{   STREAM_REQ_COUNT_TOTAL         } 0,
{   STREAM_REQ_FAILED_TOTAL        } 0,
{   STREAMED_SUCCESS               } 0.0,
{   TOTAL_BYTES                    } 0,
{   TOTAL_ERRORS                   } 0,
{   TOTAL_INPUT_BYTES              } 0,
{   TOTAL_OUTPUT_BYTES             } 0,
{   TOTAL_QTIME                    } 0,
{   TOTAL_REQUESTS                 } 0,
{   PRODUCT_IDENTIFICATION         } [FALSE, ''],
{   LOGICAL_UNIT_TABLE_INDEX       } 0,
{   CONFIGURED                     } FALSE,
{   ENTRY_INTERLOCK                } FALSE,
{   ELEMENT_CAPABILITIES           } $cmt$element_capabilities [],
{   LOGICAL_UNIT_STATUS            } [FALSE],
{   ELEMENT_ACCESS                 } $cmt$element_access [],
{   UNIT_DISABLED                  } FALSE,
{   PARITY_PROTECTION_ENABLED      } FALSE,
{   FORCE_FORMAT                   } FALSE,
{   RESTORING_DRIVE                } FALSE,
{   OFF_LINE_DRIVE_NUMBER          } 0,
{   QUEUE_COUNT                    } 0,
{   UNIT_SHARED                    } FALSE,
{   ACTIVE_VOLUME_TABLE_INDEX      } 0,
{   ALLOCATION_ALLOWED             } FALSE,
{   SPACE_LOW                      } FALSE,
{   SPACE_GONE                     } FALSE,
{   DISK_TABLE_STATUS              } $dmt$ms_volume_table_status [],
{   CLASS                          } $dmt$class [],
{   SYSTEM_CLASS_ACTIVITY          } [REP 5 of 0],
{   LOGGED_IN_FOR_RECOVERY         } FALSE,
{   INTERNAL_VSN                   } * ,
{   MAINFRAME_ASSIGNED             } [0, 1],
{   SET_NAME                       } '',
{   STATUS                         } $dmt$ms_volume_system_status [],
{   VOLUME_OWNER                   } ['', ''],
{   CURRENT_POSITION_OFFSET_IN_LOG } 0,
{   ALLOCATED_LOG_SIZE             } 0,
{   DEVICE_LOG_ENTRY_COUNT         } 0,
{   VOLUME_UNAVAILABLE             } FALSE,
{   PREVIOUS_ALLOCATION_ALLOWED    } FALSE,
{   LOGGING_PROCESS_DAMAGED        } FALSE,
{   BYTES_PER_CYLINDER             } 0,
{   VOLUME_DEFAULT_ALLOCATION_SIZE } 0,
{   VOLUME_DEFAULT_TRANSFER_SIZE   } 0,
{   NUMBER_DFL_ENTRIES             } 0,
{   NUMBER_DIRECTORY_ENTRIES       } 0,
{   CYLINDERS_PER_DEVICE           } 0,
{   MAUS_PER_CYLINDER              } 0,
{   MAUS_PER_DAU                   } dmc$min_maus_per_dau,
{   SECTORS_PER_MAU                } 1,
{   SECTORS_PER_TRACK              } 4,
{   CAPACITY                       } 0,
{   AVAILABLE_MAT_SPACE            } 0,
{   AVAILABLE_DAT_SPACE            } 0,
{   BYTES_PER_DAU                  } 0,
{   NO_SPACE                       } FALSE,
{   NO_FILE_ENTRIES                } FALSE,
{   REMAINING_DISK_SPACE           } 0],
{ INCREMENTAL_DATA               } [
{   LOGICAL_UNIT_NUMBER            } 0,
{   DEFINED_SOURCES                } $oft$us_field_sources [],
{   integer variant                } 0,
{   READ_REQUESTS                  } 0,
{   READ_QTIME                     } 0,
{   READ_MAU_COUNT                 } 0,
{   WRITE_REQUESTS                 } 0,
{   WRITE_QTIME                    } 0,
{   WRITE_DATA_MAU_COUNT           } 0,
{   WRITE_DATA_AND_PRESET_MAUS     } 0,
{   SWAP_IN_REQUESTS               } 0,
{   SWAP_IN_QTIME                  } 0,
{   SWAP_IN_MAU_COUNT              } 0,
{   SWAP_OUT_REQUESTS              } 0,
{   SWAP_OUT_QTIME                 } 0,
{   SWAP_OUT_DATA_MAU_COUNT        } 0,
{   SWAP_OUT_DATA_AND_PRESET_MAUS  } 0,
{   STREAMED_REQUEST_POSSIBLE      } FALSE,
{   STREAMED_REQ_COUNT_READ        } 0,
{   STREAMED_REQ_FAILED_COUNT_READ } 0,
{   STREAMED_REQ_COUNT_WRITE       } 0,
{   STREAMED_REQ_FAILED_COUNT_WRITE} 0,
{   REQUESTS_CAUSING_SKIPPED_CYL   } 0,
{   TOTAL_CYLINDERS_SKIPPED        } 0,
{   CURRENT_CYLINDER               } 0,
{   INTERMEDIATE_ERRORS            } 0,
{   RECOVERED_ERRORS               } 0,
{   UNRECOVERED_ERRORS             } 0,
{   IOU_NUMBER                     } 0,
{   CHANNEL                        } [
{     NUMBER                         } 0,
{     PORT                           } cmc$unspecified_port,
{     CONCURRENT                     } FALSE],
{   EQUIPMENT                      } 0,
{   RECORDED_VSN                   } '',
{   BYTES_PER_MAU                  } 512, {smallest possible  value
{   UNIT_TYPE                      } 0,
{   ELEMENT_NAME                   } '',
{   LAST_REQUEST_GOOD              } FALSE,
{   UNIT_CONFIGURED                } FALSE,
{   UNIT_USED                      } FALSE,
{   AVERAGE_BYTE_COUNT_PER_REQUEST } 0,
{   PARITY_PROTECTED_DEVICE        } FALSE,
{   QTIME_PER_READ_REQUEST         } 0.0,
{   QTIME_PER_SWAP_IN_REQUEST      } 0.0,
{   QTIME_PER_SWAP_OUT_REQUEST     } 0.0,
{   QTIME_PER_TOTAL_REQUEST        } 0.0,
{   QTIME_PER_WRITE_REQUEST        } 0.0,
{   SEEKS                          } 0,
{   STREAM_REQ_ATTEMPT_TOTAL       } 0,
{   STREAM_REQ_COUNT_TOTAL         } 0,
{   STREAM_REQ_FAILED_TOTAL        } 0,
{   STREAMED_SUCCESS               } 0.0,
{   TOTAL_BYTES                    } 0,
{   TOTAL_ERRORS                   } 0,
{   TOTAL_INPUT_BYTES              } 0,
{   TOTAL_OUTPUT_BYTES             } 0,
{   TOTAL_QTIME                    } 0,
{   TOTAL_REQUESTS                 } 0,
{   PRODUCT_IDENTIFICATION         } [FALSE, ''],
{   LOGICAL_UNIT_TABLE_INDEX       } 0,
{   CONFIGURED                     } FALSE,
{   ENTRY_INTERLOCK                } FALSE,
{   ELEMENT_CAPABILITIES           } $cmt$element_capabilities [],
{   LOGICAL_UNIT_STATUS            } [FALSE],
{   ELEMENT_ACCESS                 } $cmt$element_access [],
{   UNIT_DISABLED                  } FALSE,
{   PARITY_PROTECTION_ENABLED      } FALSE,
{   FORCE_FORMAT                   } FALSE,
{   RESTORING_DRIVE                } FALSE,
{   OFF_LINE_DRIVE_NUMBER          } 0,
{   QUEUE_COUNT                    } 0,
{   UNIT_SHARED                    } FALSE,
{   ACTIVE_VOLUME_TABLE_INDEX      } 0,
{   ALLOCATION_ALLOWED             } FALSE,
{   SPACE_LOW                      } FALSE,
{   SPACE_GONE                     } FALSE,
{   DISK_TABLE_STATUS              } $dmt$ms_volume_table_status [],
{   CLASS                          } $dmt$class [],
{   SYSTEM_CLASS_ACTIVITY          } [REP 5 of 0],
{   LOGGED_IN_FOR_RECOVERY         } FALSE,
{   INTERNAL_VSN                   } * ,
{   MAINFRAME_ASSIGNED             } [0, 1],
{   SET_NAME                       } '',
{   STATUS                         } $dmt$ms_volume_system_status [],
{   VOLUME_OWNER                   } ['', ''],
{   CURRENT_POSITION_OFFSET_IN_LOG } 0,
{   ALLOCATED_LOG_SIZE             } 0,
{   DEVICE_LOG_ENTRY_COUNT         } 0,
{   VOLUME_UNAVAILABLE             } FALSE,
{   PREVIOUS_ALLOCATION_ALLOWED    } FALSE,
{   LOGGING_PROCESS_DAMAGED        } FALSE,
{   BYTES_PER_CYLINDER             } 0,
{   VOLUME_DEFAULT_ALLOCATION_SIZE } 0,
{   VOLUME_DEFAULT_TRANSFER_SIZE   } 0,
{   NUMBER_DFL_ENTRIES             } 0,
{   NUMBER_DIRECTORY_ENTRIES       } 0,
{   CYLINDERS_PER_DEVICE           } 0,
{   MAUS_PER_CYLINDER              } 0,
{   MAUS_PER_DAU                   } dmc$min_maus_per_dau,
{   SECTORS_PER_MAU                } 1,
{   SECTORS_PER_TRACK              } 4,
{   CAPACITY                       } 0,
{   AVAILABLE_MAT_SPACE            } 0,
{   AVAILABLE_DAT_SPACE            } 0,
{   BYTES_PER_DAU                  } 0,
{   NO_SPACE                       } FALSE,
{   NO_FILE_ENTRIES                } FALSE,
{   REMAINING_DISK_SPACE           } 0],
{ INCREMENTAL_DATA_DEFINED       } FALSE];

?? OLDTITLE ??
?? NEWTITLE := '[unsafe] F$DISK_UNIT_STATISTIC_SELECTED', EJECT ??

{ DESIGN:
{   DISK_UNIT_STATISTIC_SELECTORS_P  = NIL => TRUE
{   every DISK_UNIT_STATISTIC_SELECTORS_P is combined by OR
{   every oft$us_unit_stat_selection value is combined by AND

  FUNCTION [UNSAFE] f$disk_unit_statistic_selected
    (    disk_unit_statistic_selectors: oft$us_unit_stat_selections;
     VAR disk_unit_statistic: {input} oft$unit_statistic_data): boolean;

    VAR
      i: oft$us_or_selections_index,
      selected: boolean;

?? NEWTITLE := '[inline] F$BOOLEAN_SELECTED', EJECT ??

    FUNCTION [INLINE] f$boolean_selected
      (    boolean_selector: oft$us_boolean_selector;
           value: boolean): boolean;

      f$boolean_selected := value IN boolean_selector;

    FUNCEND f$boolean_selected;
?? OLDTITLE ??
?? NEWTITLE := '[inline] F$CHANNEL_SELECTED', EJECT ??

    FUNCTION [INLINE] f$channel_selected
      (    channel_selector: oft$us_channel_selector;
           value: cmt$physical_channel): boolean;

      f$channel_selected := f$integer_selected (channel_selector.number_selector, value.number)
{        } AND f$port_selected (channel_selector.port_selector, value.port)
{        } AND f$boolean_selected (channel_selector.concurrent_selector, value.concurrent);

    FUNCEND f$channel_selected;
?? OLDTITLE ??
?? NEWTITLE := '[inline, unsafe] F$DISK_UNIT_STAT_ENTRY_SELECTED', EJECT ??

    FUNCTION [INLINE, UNSAFE] f$disk_unit_stat_entry_selected
      (    disk_unit_statistic_selector: oft$us_unit_stat_selection;
       VAR disk_unit_statistic: {input} oft$unit_statistic_data): boolean;

      VAR
        data_p: ^oft$unit_statistic_data_item;

{It could be that the selector wants to check an attribute that is not available
{ex. active_volume_table for a down volume.
      IF v$field_source [disk_unit_statistic_selector.key] - disk_unit_statistic.total_data.
            defined_sources <> $oft$us_field_sources [] THEN
        f$disk_unit_stat_entry_selected := FALSE;
        RETURN; {----->
      IFEND;

      IF disk_unit_statistic_selector.incremental AND disk_unit_statistic.incremental_data_defined THEN
        data_p := ^disk_unit_statistic.incremental_data;
      ELSE
        data_p := ^disk_unit_statistic.total_data;
      IFEND;

      CASE disk_unit_statistic_selector.key OF
      = ofc$us_fill =
        f$disk_unit_stat_entry_selected := TRUE;

      = ofc$us_bytes_per_mau =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.bytes_per_mau_selector, data_p^.bytes_per_mau);

      = ofc$us_channel =
        f$disk_unit_stat_entry_selected := f$channel_selected
              (disk_unit_statistic_selector.channel_selector, data_p^.channel);

      = ofc$us_current_cylinder =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.current_cylinder_selector, data_p^.current_cylinder);

      = ofc$us_element_name =
        f$disk_unit_stat_entry_selected := f$name_selected (disk_unit_statistic_selector.
              element_name_selector, data_p^.element_name);

      = ofc$us_equipment =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.equipment_selector, data_p^.equipment);

      = ofc$us_force_format =
        f$disk_unit_stat_entry_selected := f$boolean_selected
              (disk_unit_statistic_selector.force_format_selector, data_p^.force_format);

      = ofc$us_intermediate_errors =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.intermediate_errors_selector, data_p^.intermediate_errors);

      = ofc$us_iou_number =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.iou_number_selector, data_p^.iou_number);

      = ofc$us_last_request_good =
        f$disk_unit_stat_entry_selected := f$boolean_selected
              (disk_unit_statistic_selector.last_request_good_selector, data_p^.last_request_good);

      = ofc$us_logical_unit_number =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.logical_unit_number_selector, data_p^.logical_unit_number);

      = ofc$us_off_line_drive_number =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.off_line_drive_number_selector, data_p^.off_line_drive_number);

      = ofc$us_parity_protect_enabled =
        f$disk_unit_stat_entry_selected := f$boolean_selected
              (disk_unit_statistic_selector.parity_protect_enabled_selector,
              data_p^.parity_protection_enabled);

      = ofc$us_parity_protected_device =
        f$disk_unit_stat_entry_selected := f$boolean_selected
              (disk_unit_statistic_selector.parity_protected_device_select, data_p^.parity_protected_device);

      = ofc$us_read_mau_count =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.read_mau_count_selector, data_p^.read_mau_count);

      = ofc$us_read_qtime =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.read_qtime_selector, data_p^.read_qtime);

      = ofc$us_read_requests =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.read_requests_selector, data_p^.read_requests);

      = ofc$us_recorded_vsn =
        f$disk_unit_stat_entry_selected := f$name_selected (disk_unit_statistic_selector.
              recorded_vsn_selector, data_p^.recorded_vsn);

      = ofc$us_recovered_errors =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.recovered_errors_selector, data_p^.recovered_errors);

      = ofc$us_requests_cause_skip_cyl =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.requests_cause_skip_cyl_select,
              data_p^.requests_causing_skipped_cyl);

      = ofc$us_restoring_drive =
        f$disk_unit_stat_entry_selected := f$boolean_selected
              (disk_unit_statistic_selector.restoring_drive_selector, data_p^.restoring_drive);

      = ofc$us_strm_req_count_read =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.strm_req_count_read_selector, data_p^.streamed_req_count_read);

      = ofc$us_strm_req_count_write =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.strm_req_count_write_selector, data_p^.streamed_req_count_write);

      = ofc$us_strm_req_fail_cnt_read =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.strm_req_fail_cnt_read_selector,
              data_p^.streamed_req_failed_count_read);

      = ofc$us_strm_req_fail_cnt_wrt =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.strm_req_fail_cnt_wrt_selector,
              data_p^.streamed_req_failed_count_write);

      = ofc$us_strm_request_possible =
        f$disk_unit_stat_entry_selected := f$boolean_selected
              (disk_unit_statistic_selector.strm_request_possible_selector,
              data_p^.streamed_request_possible);

      = ofc$us_swap_in_mau_count =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.swap_in_mau_count_selector, data_p^.swap_in_mau_count);

      = ofc$us_swap_in_qtime =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.swap_in_qtime_selector, data_p^.swap_in_qtime);

      = ofc$us_swap_in_requests =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.swap_in_requests_selector, data_p^.swap_in_requests);

      = ofc$us_swap_out_data_mau_count =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.swap_out_data_mau_count_select, data_p^.swap_out_data_mau_count);

      = ofc$us_swap_out_datapres_maus =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.swap_out_datapres_maus_selector,
              data_p^.swap_out_data_and_preset_maus);

      = ofc$us_swap_out_qtime =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.swap_out_qtime_selector, data_p^.swap_out_qtime);

      = ofc$us_swap_out_requests =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.swap_out_requests_selector, data_p^.swap_out_requests);

      = ofc$us_total_cylinders_skipped =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.total_cylinders_skipped_select, data_p^.total_cylinders_skipped);

      = ofc$us_total_errors =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.total_errors_selector, data_p^.total_errors);

      = ofc$us_unit_configured =
        f$disk_unit_stat_entry_selected := f$boolean_selected
              (disk_unit_statistic_selector.unit_configured_selector, data_p^.unit_configured);

      = ofc$us_unit_disabled =
        f$disk_unit_stat_entry_selected := f$boolean_selected
              (disk_unit_statistic_selector.unit_disabled_selector, data_p^.unit_disabled);

      = ofc$us_unit_type =
        f$disk_unit_stat_entry_selected := f$unit_type_selected
              (disk_unit_statistic_selector.unit_type_selector, data_p^.unit_type);

      = ofc$us_unit_used =
        f$disk_unit_stat_entry_selected := f$boolean_selected
              (disk_unit_statistic_selector.unit_used_selector, data_p^.unit_used);

      = ofc$us_unrecovered_errors =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.unrecovered_errors_selector, data_p^.unrecovered_errors);

      = ofc$us_write_data_mau_count =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.write_data_mau_count_selector, data_p^.write_data_mau_count);

      = ofc$us_write_datapres_maus =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.write_datapres_maus_selector, data_p^.write_data_and_preset_maus);

      = ofc$us_write_qtime =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.write_qtime_selector, data_p^.write_qtime);

      = ofc$us_write_requests =
        f$disk_unit_stat_entry_selected := f$integer_selected
              (disk_unit_statistic_selector.write_requests_selector, data_p^.write_requests);

      CASEND;

    FUNCEND f$disk_unit_stat_entry_selected;
?? OLDTITLE ??
?? NEWTITLE := '[inline] F$INTEGER_SELECTED', EJECT ??

    FUNCTION [INLINE] f$integer_selected
      (    integer_selector: oft$us_integer_selector;
           value: integer): boolean;

      f$integer_selected := (integer_selector.min_value <= value) AND (value <= integer_selector.max_value);

    FUNCEND f$integer_selected;
?? OLDTITLE ??
?? NEWTITLE := '[inline] F$NAME_SELECTED', EJECT ??

    FUNCTION [INLINE] f$name_selected
      (    name_selector: oft$us_name_selector;
           value: ost$name_reference): boolean;

      CASE name_selector.kind OF
      = ofc$us_name_value =
        f$name_selected := value = name_selector.value;

      = ofc$us_string_selector =
        f$name_selected := f$string_value_selected (name_selector.string_selector, value);

      CASEND;

    FUNCEND f$name_selected;
?? OLDTITLE ??
?? NEWTITLE := '[inline] F$PORT_SELECTED', EJECT ??

    FUNCTION [INLINE] f$port_selected
      (    port_selector: oft$us_port_selector,
           value: cmt$channel_port): boolean;

      f$port_selected := value IN port_selector;

    FUNCEND f$port_selected;
?? OLDTITLE ??
?? NEWTITLE := 'F$STRING_VALUE_SELECTED', EJECT ??

    FUNCTION f$string_value_selected
      (    string_selector: oft$us_string_selector;
           value: ost$name_reference): boolean;

      VAR
        str: ost$name;

      IF string_selector.upper_case THEN
        #TRANSLATE (osv$lower_to_upper, string_selector.value, str);
        f$string_value_selected := nlp$name_match (str, value);
      ELSE
        f$string_value_selected := nlp$name_match (string_selector.value, value);
      IFEND;

    FUNCEND f$string_value_selected;
?? OLDTITLE ??
?? NEWTITLE := '[inline] F$UNIT_TYPE_SELECTED', EJECT ??

    FUNCTION [INLINE] f$unit_type_selected
      (    unit_type_selector: oft$us_disk_unit_selector;
           value: iot$unit_type): boolean;

      f$unit_type_selected := (LOWERVALUE (oft$us_disk_unit) <= value)
{     } AND (value <= UPPERVALUE (oft$us_disk_unit))
{     } AND (value IN unit_type_selector);

    FUNCEND f$unit_type_selected;
?? OLDTITLE ??
?? NEWTITLE := '[inline, unsafe] F$DISK_UNIT_STAT_SELECTED', EJECT ??

    FUNCTION [INLINE, UNSAFE] f$disk_unit_stat_selected
      (    disk_unit_statistic_selectors: oft$us_or_unit_stat_selection;
       VAR disk_unit_statistic: {input} oft$unit_statistic_data): boolean;

      VAR
        i: oft$us_and_selections_index,
        selected: boolean;

      IF disk_unit_statistic_selectors.number_of_and_selections < 1 THEN
        f$disk_unit_stat_selected := TRUE;
        RETURN; {----->
      IFEND;

      selected := TRUE;
      FOR i := 1 TO disk_unit_statistic_selectors.number_of_and_selections DO
        selected := selected AND f$disk_unit_stat_entry_selected
              (disk_unit_statistic_selectors.and_selections [i], disk_unit_statistic);

        IF selected = FALSE THEN
          f$disk_unit_stat_selected := selected;
          RETURN; {----->
        IFEND;
      FOREND;

      f$disk_unit_stat_selected := selected;

    FUNCEND f$disk_unit_stat_selected;
?? EJECT ??
?? OLDTITLE ??
    IF disk_unit_statistic_selectors.number_of_or_selections < 1 THEN
      f$disk_unit_statistic_selected := TRUE;
      RETURN; {----->
    IFEND;

    selected := FALSE;

  /evaluate_or_selectors/
    FOR i := 1 TO disk_unit_statistic_selectors.number_of_or_selections DO
      selected := selected OR f$disk_unit_stat_selected (disk_unit_statistic_selectors.or_selections [i],
            disk_unit_statistic);
      IF selected THEN
        EXIT /evaluate_or_selectors/ {----->
      IFEND;
    FOREND /evaluate_or_selectors/;

    f$disk_unit_statistic_selected := selected;

  FUNCEND f$disk_unit_statistic_selected;
?? OLDTITLE ??
?? NEWTITLE := 'P$BUILD_EXTENDED_STATISTIC_DATA', EJECT ??

  PROCEDURE p$build_extended_statistic_data
    (VAR data: {input/output} oft$unit_statistic_data_item);

    IF NOT (ofc$us_statistic_data IN data.defined_sources) THEN
      RETURN; {----->
    IFEND;

    data.defined_sources := data.defined_sources + $oft$us_field_sources [ofc$us_extended_statistic_data];

    data.parity_protected_device := (data.unit_type = ioc$dt_ms5833_1p) OR
          (data.unit_type = ioc$dt_ms5838_1p) OR (data.unit_type = ioc$dt_ms47444_1p) OR
          (data.unit_type = ioc$dt_ms5837_1p) OR (data.unit_type = ioc$dt_ms5833_3p) OR
          (data.unit_type = ioc$dt_ms5838_3p) OR (data.unit_type = ioc$dt_ms47444_3p) OR
          (data.unit_type = ioc$dt_ms5837_3p);

    data.total_errors := data.recovered_errors + data.intermediate_errors + data.unrecovered_errors;
    data.total_requests := data.read_requests + data.write_requests + data.swap_in_requests +
          data.swap_out_requests;
    data.total_output_bytes := (data.write_data_and_preset_maus + data.swap_out_data_and_preset_maus) *
          data.bytes_per_mau;
    data.total_input_bytes := (data.read_mau_count + data.swap_in_mau_count) * data.bytes_per_mau;
    data.total_bytes := data.total_output_bytes + data.total_input_bytes;

    IF data.total_requests <> 0 THEN
      data.average_byte_count_per_request := data.total_bytes DIV data.total_requests;
    ELSE
      data.average_byte_count_per_request := 0;
    IFEND;

    data.total_qtime := data.read_qtime + data.write_qtime + data.swap_in_qtime + data.swap_out_qtime;

    IF data.read_requests <> 0 THEN
      data.qtime_per_read_request := $REAL (data.read_qtime) / $REAL (data.read_requests) / 1000.0
    ELSE
      data.qtime_per_read_request := 0.0;
    IFEND;

    IF data.write_requests <> 0 THEN
      data.qtime_per_write_request := $REAL (data.write_qtime) / $REAL (data.write_requests) / 1000.0
    ELSE
      data.qtime_per_write_request := 0.0;
    IFEND;

    IF data.swap_in_requests <> 0 THEN
      data.qtime_per_swap_in_request := $REAL (data.swap_in_qtime) / $REAL (data.swap_in_requests) / 1000.0
    ELSE
      data.qtime_per_swap_in_request := 0.0;
    IFEND;

    IF data.swap_out_requests <> 0 THEN
      data.qtime_per_swap_out_request := $REAL (data.swap_out_qtime) / $REAL (data.swap_out_requests) / 1000.0
    ELSE
      data.qtime_per_swap_out_request := 0.0;
    IFEND;

    IF data.total_requests <> 0 THEN
      data.qtime_per_total_request := $REAL (data.total_qtime) / $REAL (data.total_requests);
    ELSE
      data.qtime_per_total_request := 0.0;
    IFEND;

    data.stream_req_count_total := data.streamed_req_count_read + data.streamed_req_count_write;
    data.stream_req_failed_total := data.streamed_req_failed_count_read +
          data.streamed_req_failed_count_write;

    data.stream_req_attempt_total := data.stream_req_count_total + data.stream_req_failed_total;
    IF data.stream_req_attempt_total <> 0 THEN
      data.streamed_success := $REAL (data.stream_req_count_total) / $REAL (data.stream_req_attempt_total) /
            100.0;
    ELSE
      data.streamed_success := 0.0;
    IFEND;

    data.seeks := data.total_requests - data.stream_req_count_total;

  PROCEND p$build_extended_statistic_data;
?? OLDTITLE ??
?? NEWTITLE := 'P$GET_STATISTIC_SELECT_ATTRIB', EJECT ??

  PROCEDURE p$get_statistic_select_attrib
    (    disk_unit_statistic_selectors: oft$us_unit_stat_selections;
     VAR incremental_selection: boolean;
     VAR sources: oft$us_field_sources);

    VAR
      i: oft$us_or_selections_index,
      j: oft$us_and_selections_index;

    incremental_selection := FALSE;
    sources := $oft$us_field_sources [];

    FOR i := 1 TO disk_unit_statistic_selectors.number_of_or_selections DO
      FOR j := 1 TO disk_unit_statistic_selectors.or_selections [i].number_of_and_selections DO
        incremental_selection := incremental_selection OR disk_unit_statistic_selectors.or_selections [i].
              and_selections [j].incremental;
        sources := sources + v$field_source [disk_unit_statistic_selectors.or_selections [i].
              and_selections [j].key];
      FOREND;
    FOREND;

  PROCEND p$get_statistic_select_attrib;
?? OLDTITLE ??
?? NEWTITLE := 'BUILD_LINE', EJECT ??

  PROCEDURE build_line
    (    ijle_p: ^jmt$initiated_job_list_entry;
         ijl_number: integer;
         dd_p: oft$max_display_descriptions_p;
         ince_p: ^oft$save_incremental_data_entry;
         s: ^string (132));

    VAR
      ch: char,
      ch2: string (2),
      clock: ost$free_running_clock,
      cp_time: integer,
      dde_p: ^oft$field_description,
      field: oft$packed_field_attributes,
      field_index: 1 .. ofc$max_display_width,
      incremental_ok: boolean,
      info: record
        case boolean of
        = TRUE =
          p: ^oft$display_message_info,
        = FALSE =
          pva: ost$pva,
        casend,
      recend,
      int_index: 0 .. ofc$max_incremental_fields + 1,
      message_column,
      n: integer,
      string_index: 1 .. ofc$max_display_width + 1,
      string_indexr: 0 .. ofc$max_display_width + 1,
      swap_status: oft$field_selection,
      width: 1 .. ofc$max_display_width;

    string_index := 1;
    int_index := 0;
    incremental_ok := ince_p^.ssn_id = ijle_p^.system_supplied_name (12, 8);
    ince_p^.ssn_id := ijle_p^.system_supplied_name (12, 8);
    IF ijle_p^.swap_status <= jmc$iss_swapped_no_io THEN
      swap_status := ofc$fs_active;
    ELSE
      swap_status := ofc$fs_swapped;
    IFEND;
    clock := #FREE_RUNNING_CLOCK (0);

  /build_line_loop/
    FOR field_index := 1 TO dd_p^.header.field_count DO
      dde_p := ^dd_p^.fields [field_index];
      field := dde_p^.pack;
      width := field.width;

      IF (field.field_selection <> ofc$fs_unconditional) AND (field.field_selection <> swap_status) THEN
        IF field.non_selection_action = ofc$nsa_blank THEN
          string_index := string_index + width;
        IFEND;
        CYCLE /build_line_loop/; {----->
      IFEND;

      string_indexr := string_index + width - 1;
      CASE field.field_id OF
      = ofc$fi_active_io_pages =
        n := ijle_p^.active_io_page_count;
      = ofc$fi_active_io_requests =
        n := ijle_p^.active_io_requests;
      = ofc$fi_ajl_ordinal =
        n := ijle_p^.ajl_ordinal;
        IF (n = jmc$null_ajl_ordinal) OR (ijle_p <> jmv$ajl_p^ [n].ijle_p) THEN
          field.scale := 0;
        IFEND;
      = ofc$fi_cp_time_increment =

{       n := ijle_p^.statistics.cp_time.time_spent_in_mtr_mode +
{             ijle_p^.statistics.cp_time.time_spent_in_job_mode -
{             ijle_p^.cp_time_last_dc_reset;

      = ofc$fi_cp_time_job =
        n := ijle_p^.statistics.cp_time.time_spent_in_job_mode;
      = ofc$fi_cp_time_monitor =
        n := ijle_p^.statistics.cp_time.time_spent_in_mtr_mode;
      = ofc$fi_cp_time_total =
        n := ijle_p^.statistics.cp_time.time_spent_in_mtr_mode +
              ijle_p^.statistics.cp_time.time_spent_in_job_mode;
      = ofc$fi_dispatching_priority, ofc$fi_dispatching_priority_act =
        IF field.field_id = ofc$fi_dispatching_priority THEN
          n := ijle_p^.dispatching_control.dispatching_priority;
        ELSE
          n := ijle_p^.scheduling_dispatching_priority;
        IFEND;
        n := n - 1;
        s^ (string_index) := 'P';
        IF n >= 10 THEN
          s^ (string_index + 2) := $CHAR ((n MOD 10) + $INTEGER ('0'));
          n := n DIV 10;
        IFEND;
        s^ (string_index + 1) := $CHAR (n + $INTEGER ('0'));
      = ofc$fi_display_message =
        IF ijle_p^.display_message.display_message.size > 0 THEN
          n := 1;
          WHILE (ijle_p^.display_message.display_message.text (n) = ' ') AND
                (n < ijle_p^.display_message.display_message.size) DO
            n := n + 1;
          WHILEND;
          s^ (string_index, width) := ijle_p^.display_message.display_message.
                text (n, ijle_p^.display_message.display_message.size - n + 1);
          FOR message_column := string_index TO (string_index + width) DO
            CASE s^ (message_column) OF
            = $CHAR (0) .. $CHAR (31), $CHAR (127) =
              s^ (message_column) := '?';
            ELSE
              ;
            CASEND;
          FOREND;
        IFEND;
      = ofc$fi_fill =
        s^ (string_index, width) := dde_p^.field_title (1, width);
      = ofc$fi_guaranteed_service_rem =
        n := ijle_p^.job_scheduler_data.guaranteed_service_remaining;
        IF field.incremental THEN
          n := -n;
        IFEND;
      = ofc$fi_hung_task_in_job_flag =
        IF ijle_p^.hung_task_in_job THEN
          s^ (string_indexr) := '*';
        IFEND;
      = ofc$fi_ijl_ordinal =
        n := ijl_number;
      = ofc$fi_job_abort_disposition =
        IF ijle_p^.queue_file_information.job_abort_disposition = jmc$restart_on_abort THEN
          ch := 'R';
        ELSEIF ijle_p^.queue_file_information.job_abort_disposition = jmc$terminate_on_abort THEN
          ch := 'T';
        ELSE
          ch := ' ';
        IFEND;
        s^ (string_indexr) := ch;
      = ofc$fi_job_class =
        jmp$idetermine_job_class_abbrev (ijle_p^.job_scheduler_data.job_class, s^ (string_indexr - 1, 2));
      = ofc$fi_job_entry_status =
        IF ijle_p^.entry_status < jmc$ies_swapin_in_progress THEN
          ch := 'M';
        ELSEIF ijle_p^.entry_status = jmc$ies_swapin_in_progress THEN
          ch := 'I';
        ELSEIF ijle_p^.entry_status = jmc$ies_operator_force_out THEN
          ch := 'F';
        ELSE { entry_status = swapped }
          IF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_long_wait THEN
            ch := ' ';
          ELSEIF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_thrashing THEN
            ch := 'T';
          ELSEIF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_lower_priority THEN
            ch := 'P';
          ELSEIF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_idling_system_swapout THEN
            ch := 'L';
          ELSEIF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_idle_dispatching THEN
            ch := 'D';
          ELSE
            ch := 'U';
          IFEND;
        IFEND;
        s^ (string_indexr) := ch;
      = ofc$fi_job_status =
        IF ijle_p^.hung_task_in_job THEN
          ch2 := '*H';
        ELSEIF ijle_p^.job_damaged_during_recovery THEN
          ch2 := '*R';
        ELSEIF (ijle_p^.swap_status = jmc$iss_swapout_complete) OR
              (ijle_p^.swap_status = jmc$iss_swapped_io_complete) OR
              (ijle_p^.swap_status = jmc$iss_swapped_no_io) THEN
          ch2 := swap_reasons_conversion [ijle_p^.job_scheduler_data.swapout_reason];
        ELSE
          ch2 := jsv$swap_status_id_array [ijle_p^.swap_status];
        IFEND;
        s^ (string_indexr - 1, 2) := ch2;
      = ofc$fi_job_mode =
        s^ (string_indexr - 1, 2) := job_mode_conversion [ijle_p^.job_mode];
      = ofc$fi_job_priority =
        IF (ijle_p^.swap_status <= jmc$iss_swapped_no_io) OR
              (ijle_p^.entry_status = jmc$ies_swapin_candidate) THEN
          n := ijle_p^.job_scheduler_data.priority;
        ELSE
          field.scale := 0;
        IFEND;
      = ofc$fi_job_recovery_disposition =
        IF ijle_p^.queue_file_information.job_recovery_disposition = jmc$continue_on_recovery THEN
          ch := 'C';
        ELSEIF ijle_p^.queue_file_information.job_recovery_disposition = jmc$restart_on_recovery THEN
          ch := 'R';
        ELSEIF ijle_p^.queue_file_information.job_recovery_disposition = jmc$terminate_on_recovery THEN
          ch := 'T';
        ELSE
          ch := ' ';
        IFEND;
        s^ (string_indexr) := ch;
      = ofc$fi_job_swap_count =
        n := ijle_p^.job_scheduler_data.job_swap_counts.long_wait +
              ijle_p^.job_scheduler_data.job_swap_counts.job_mode;
      = ofc$fi_last_think_time =
        n := ijle_p^.last_think_time;
        IF n = 0 THEN
          field.scale := 0;
        IFEND;
      = ofc$fi_memory_pages =
        n := ijle_p^.job_page_queue_list [mmc$pq_job_fixed].
              count + ijle_p^.job_page_queue_list [mmc$pq_job_io_error].
              count + ijle_p^.job_page_queue_list [mmc$pq_job_working_set].count;
      = ofc$fi_page_fault_count =
        n := ijle_p^.statistics.paging_statistics.page_fault_count;
      = ofc$fi_percent_cp_usage =
        cp_time := ijle_p^.statistics.cp_time.time_spent_in_job_mode +
              ijle_p^.statistics.cp_time.time_spent_in_mtr_mode;
        n := ((cp_time - ince_p^.int [int_index]) * 100) DIV (clock - ince_p^.last_clock);
        ince_p^.int [int_index] := cp_time;
        int_index := int_index + 1;
        field.incremental := FALSE;
        IF NOT incremental_ok THEN
          field.scale := 0;
        IFEND;
      = ofc$fi_permanent_file_space =
        n := ijle_p^.statistics.perm_file_space;
      = ofc$fi_ps_pages_assigned =
        n := ijle_p^.statistics.paging_statistics.new_pages_assigned;
      = ofc$fi_ps_pages_from_server =
        n := ijle_p^.statistics.paging_statistics.pages_from_server;
      = ofc$fi_ps_pages_reclaimed =
        n := ijle_p^.statistics.paging_statistics.pages_reclaimed_from_queue;
      = ofc$fi_ps_page_in =
        n := ijle_p^.statistics.paging_statistics.page_in_count;
      = ofc$fi_ready_task_count =
        IF ijle_p^.statistics.tasks_not_in_long_wait = 0 THEN
          field.scale := 0;
        ELSE
          n := ijle_p^.statistics.ready_task_count;
        IFEND;
      = ofc$fi_service_accumulator =
        n := ijle_p^.job_scheduler_data.service_accumulator;
      = ofc$fi_service_class =
        jmp$idetermine_serv_class_abbre (ijle_p^.job_scheduler_data.service_class, s^ (string_indexr - 1, 2));
      = ofc$fi_service_since_swap =
        n := ijle_p^.job_scheduler_data.service_accumulator_since_swap;
      = ofc$fi_ssn_full =
        s^ (string_index, jmc$system_supplied_name_size) := ijle_p^.system_supplied_name;
      = ofc$fi_ssn_long =
        s^ (string_index) := '$';
        s^ (string_index + 1, jmc$long_ssn_size - 1) := ijle_p^.system_supplied_name (12, 8);
      = ofc$fi_ssn_short =
        s^ (string_index) := '$';
        s^ (string_index + 1, jmc$short_ssn_size - 1) := ijle_p^.system_supplied_name (16, 4);
      = ofc$fi_swap_entry_status =
        IF ijle_p^.hung_task_in_job THEN
          ch2 := '*H';
        ELSEIF ijle_p^.job_damaged_during_recovery THEN
          ch2 := '*R';
        ELSE
          ch2 := entry_status_conversion [ijle_p^.entry_status];
        IFEND;
        s^ (string_indexr - 1, 2) := ch2;
      = ofc$fi_swap_in_wait_time =
        IF ijle_p^.entry_status = jmc$ies_swapin_candidate THEN
          n := #FREE_RUNNING_CLOCK (0) - ijle_p^.job_scheduler_data.swapin_q_priority_timestamp;
        ELSE
          field.scale := 0;
        IFEND;
      = ofc$fi_swap_reason =
        s^ (string_indexr - 1, 2) := swap_reasons_conversion [ijle_p^.job_scheduler_data.swapout_reason];
      = ofc$fi_swap_status =
        IF ijle_p^.hung_task_in_job THEN
          ch2 := '*H';
        ELSEIF ijle_p^.job_damaged_during_recovery THEN
          ch2 := '*R';
        ELSE
          ch2 := jsv$swap_status_id_array [ijle_p^.swap_status];
        IFEND;
        s^ (string_indexr - 1, 2) := ch2;
      = ofc$fi_temporary_file_space =
        n := ijle_p^.statistics.temp_file_space;
      = ofc$fi_terminal_name =
        s^ (string_index, width) := jmv$kjlx_p^ [ijle_p^.kjl_ordinal].terminal_name;
      = ofc$fi_think_time =
        IF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_long_wait THEN
          n := clock - (ijle_p^.estimated_ready_time - ijle_p^.last_think_time);
        ELSE
          field.scale := 0;
        IFEND;
      = ofc$fi_thrashing_flag =
        IF ijle_p^.maxws_aio_slowdown_display > 0 THEN
          s^ (string_indexr) := '*';
        IFEND;
      = ofc$fi_time_in_swap_state =
        n := clock - ijle_p^.swap_data.timestamp;
      = ofc$fi_user_job_name =
        s^ (string_index, width) := ijle_p^.job_name;
      = ofc$fi_working_set_size =
        IF swap_status = ofc$fs_active THEN
          n := ijle_p^.job_page_queue_list [mmc$pq_job_working_set].count;
        ELSE
          n := ijle_p^.swap_data.swapped_job_page_count;
        IFEND;

{Include all cases - dont put an ELSE, degrades performance

      CASEND;


      IF field.incremental AND NOT incremental_ok THEN
        ince_p^.int [int_index] := n;
        int_index := int_index + 1;
      ELSEIF field.scale > 0 THEN
        IF field.incremental THEN
          n := n - ince_p^.int [int_index];
          ince_p^.int [int_index] := ince_p^.int [int_index] + n;
          int_index := int_index + 1;
        IFEND;
        IF n < 0 THEN
          n := 0;
        IFEND;
        IF field.scale > 1 THEN
          n := n DIV field.scale;
        IFEND;
        IF (width >= UPPERBOUND (max_field_values)) OR (n <= max_field_values [width] [FALSE]) OR
              (field.field_overflow_action = ofc$foa_maximum) THEN
          IF (width <= c$max_positive_numer_size) AND ((n > max_field_values [width] [FALSE]) AND
                (field_index > 1) OR (n > max_field_values [width + 1] [FALSE])) THEN
            n := max_field_values [width] [FALSE];
          IFEND;
          REPEAT
            s^ (string_indexr) := $CHAR ((n MOD 10) + $INTEGER ('0'));
            n := n DIV 10;
            string_indexr := string_indexr - 1;
          UNTIL n = 0;
        ELSEIF field.field_overflow_action = ofc$foa_scale THEN
          pmp$binary_to_ascii_fit (n, 10, width - 1, width - 1, s^ (string_index + 1, width - 1));
        ELSE
          s^ (string_index, width) := ' *********************';
        IFEND;
      IFEND;

      string_index := string_index + width;

    FOREND /build_line_loop/;

    ince_p^.last_clock := clock;

  PROCEND build_line;
?? OLDTITLE ??
?? NEWTITLE := 'P$DISPLAY_UNIT_STATISTIC', EJECT ??

  PROCEDURE p$display_unit_statistic
    (    wid: dpt$window_id;
         ud_p: ^oft$max_unit_stat_display_desc;
         file_name: amt$local_file_name;
         initial_call: boolean;
     VAR status: ost$status);

    TYPE
      t$unit_statistic_control = record
        current_clock: ost$free_running_clock,
        current_time_in_us: integer,
        incremental_clock: ost$free_running_clock,
        incremental_time_in_us: integer,
        highest_lun: integer,
        maintain_incremental_data: boolean,
        initialize_incremental_data: boolean,
        incremental_data_reset_required: boolean,
      recend;

    VAR
      control: t$unit_statistic_control,
      display_control: clt$display_control,
      i: integer,
      lines_to_write: integer,
      lines_written: integer,
      s: string (255),
      skip_lines: integer,
      starting_line: integer;

?? NEWTITLE := 'BUILD_LINE', EJECT ??

    PROCEDURE build_line
      (    unit_usage: oft$unit_statistic_data;
           ud_p: ^oft$max_unit_stat_display_desc;
           s: ^string (132));

      TYPE
        t$boolean = record
          case boolean of
          = FALSE =
            c: cell,
          = TRUE =
            b: boolean,
          casend,
        recend;

      VAR
        bool: t$boolean,
        cell_p: ^cell,
        field_available: boolean,
        field_index: 1 .. ofc$max_display_width,
        n: integer,
        r: real,
        l: longreal,
        string_index: 1 .. ofc$max_display_width + 1,
        string_indexr: 0 .. ofc$max_display_width + 1,
        ude_p: ^oft$us_field_description,
        width: 1 .. ofc$max_display_width;


?? NEWTITLE := 'F$INTEGER', EJECT ??

      FUNCTION [INLINE] f$integer
        (    source_p: ^cell;
             source_length: 1 .. 8): integer;

        TYPE
          t$int = record
            case boolean of
            = FALSE =
              i: integer,
            = TRUE =
              s: string (8),
            casend,
          recend;

        VAR
          int: t$int,
          str_p: ^string (8);

?? PUSH (CHKRNG := OFF, CHKSUB := OFF) ??
        str_p := source_p;
        int.i := 0;
        int.s (8 - source_length + 1, source_length) := str_p^ (1, source_length);
        f$integer := int.i;
?? POP ??

      FUNCEND f$integer;
?? OLDTITLE ??
?? NEWTITLE := 'F$REAL', EJECT ??

      FUNCTION f$real
        (    source_p: ^cell): real;

        TYPE
          t$real = record
            case boolean of
            = FALSE =
              r: real,
            = TRUE =
              s: string (8),
            casend,
          recend;

        VAR
          r: t$real,
          str_p: ^string (8);

        str_p := source_p;
        r.s := str_p^;
        f$real := r.r;

      FUNCEND f$real;
?? OLDTITLE ??
?? NEWTITLE := 'P$MOVE_STRING', EJECT ??

      PROCEDURE [INLINE] p$move_string
        (    source_p: ^cell;
             source_length: 0 .. 7fffffff(16);
             dest_p: ^cell;
             dest_length: 0 .. 7fffffff(16));

        VAR
          str1_p: ^string (255),
          str2_p: ^string (255);

?? PUSH (CHKRNG := OFF, CHKSUB := OFF) ??
        IF dest_length <> 0 THEN
          str1_p := source_p;
          str2_p := dest_p;
          str2_p^ (1, dest_length) := str1_p^ (1, source_length);
          #SPOIL (str2_p^);
        IFEND;
?? POP ??

      PROCEND p$move_string;
?? OLDTITLE ??
?? NEWTITLE := 'P$PROCESS_REAL_FORMAT_ERROR', EJECT ??

      PROCEDURE p$process_real_format_error
        (    error: mlt$error);

        CASE error OF
        = mle$invalid_bdp_data =
          s^ (string_index, width) := ' Invalid BDP Data';

        = mle$loss_of_significance =
          s^ (string_index, width) := ' Loss of Significance';

        = mle$overflow =
          s^ (string_index, width) := ' Overflow';

        = mle$underflow =
          s^ (string_index, width) := ' Underflow';

        = mle$indefinite =
          s^ (string_index, width) := ' Indefinite';

        = mle$infinite =
          s^ (string_index, width) := ' Infinite';

        = mle$bad_parameters =
          s^ (string_index, width) := ' *********************';

        = mle$no_digits =
          s^ (string_index, width) := ' No Digits';
        ELSE
          s^ (string_index, width) := ' *********************';
        CASEND;

      PROCEND p$process_real_format_error;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_CHANNEL', EJECT ??

      PROCEDURE p$put_channel
        (    channel: cmt$physical_channel);

        VAR
          str: ost$string,
          ignore_status: ost$status;

        IF channel.concurrent THEN
          fip#addl_initialize (str, 'CCH');
        ELSE
          fip#addl_initialize (str, 'CH');
        IFEND;

        fip#addl_integer (str, channel.number, ignore_status);

        CASE channel.port OF
        = cmc$port_a =
          ;
          fip#addl_string (str, 'A');
        = cmc$port_b =
          ;
          fip#addl_string (str, 'B');
        ELSE
          ;
        CASEND;

        p$move_string (^str.value, str.size, ^s^ (string_index), width);

      PROCEND p$put_channel;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_CLASS', EJECT ??

      PROCEDURE p$put_class
        (    class: dmt$class);

?? NEWTITLE := 'P$PUT_CLASS_0', EJECT ??

        PROCEDURE p$put_class_0
          (    class: dmt$class);

{ Classes are displayed at a fix position l like in LCU;DISMSC;

          VAR
            c: $INTEGER ('A') .. $INTEGER ('Z'),
            pos: ost$string_index,
            str: ost$string;

          fip#addl_initialize (str, '');

          FOR c := LOWERVALUE (c) TO UPPERVALUE (c) DO
            IF $CHAR (c) IN class THEN
              pos := 2 * (c - $INTEGER ('A') + 1) - 1;
              str.size := pos;
              str.value (pos) := $CHAR (c);
            IFEND;
          FOREND;

          p$move_string (^str.value, str.size, ^s^ (string_index), width);

        PROCEND p$put_class_0;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_CLASS_1', EJECT ??

        PROCEDURE p$put_class_1
          (    class: dmt$class);

{ Classes are displayed at a fix position like in LCU;DISMSC but without a space between each class member

          VAR
            c: $INTEGER ('A') .. $INTEGER ('Z'),
            pos: ost$string_index,
            str: ost$string;

          fip#addl_initialize (str, '');

          FOR c := LOWERVALUE (c) TO UPPERVALUE (c) DO
            IF $CHAR (c) IN class THEN
              pos := c - $INTEGER ('A') + 1;
              str.size := pos;
              str.value (pos) := $CHAR (c);
            IFEND;
          FOREND;

          p$move_string (^str.value, str.size, ^s^ (string_index), width);

        PROCEND p$put_class_1;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_CLASS_2', EJECT ??

        PROCEDURE p$put_class_2
          (    class: dmt$class);

{ Every defined class member is appended to the string and separated by a ','

          VAR
            c: $INTEGER ('A') .. $INTEGER ('Z'),
            str: ost$string;

          fip#addl_initialize (str, '');

          FOR c := LOWERVALUE (c) TO UPPERVALUE (c) DO
            IF $CHAR (c) IN class THEN
              fip#addl_char (str, $CHAR (c));
              fip#addl_char (str, ',');
            IFEND;
          FOREND;

          IF str.size > 1 THEN
            str.size := str.size - 1;
          IFEND;

          p$move_string (^str.value, str.size, ^s^ (string_index), width);

        PROCEND p$put_class_2;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_CLASS_3', EJECT ??

        PROCEDURE p$put_class_3
          (    class: dmt$class);

{ Every defined class member is appended to the string and separated by a ','
{ Continuous members are displayed in the format: <first member>..<last_member>

          VAR
            c: $INTEGER ('A') .. $INTEGER ('Z'),
            dot_written: boolean,
            prev_is_member: boolean,
            str: ost$string;

          fip#addl_initialize (str, '');
          prev_is_member := FALSE;

          FOR c := LOWERVALUE (c) TO UPPERVALUE (c) DO
            IF $CHAR (c) IN class THEN
              IF (prev_is_member = FALSE) OR (c = UPPERVALUE (c)) OR (NOT ($CHAR (c + 1) IN class)) THEN
                fip#addl_char (str, $CHAR (c));
                fip#addl_char (str, ',');
              ELSEIF dot_written THEN
                ;
              ELSE
                dot_written := TRUE;
                fip#addl_string (str, '..');
              IFEND;
              prev_is_member := TRUE;
            ELSE
              dot_written := FALSE;
              prev_is_member := FALSE;
            IFEND;
          FOREND;

          IF str.size > 1 THEN
            str.size := str.size - 1;
          IFEND;

          p$move_string (^str.value, str.size, ^s^ (string_index), width);

        PROCEND p$put_class_3;
?? OLDTITLE ??
?? EJECT ??

        CASE ude_p^.display_option OF
        = 0 =
          p$put_class_0 (class);
        = 1 =
          p$put_class_1 (class);
        = 2 =
          p$put_class_2 (class);
        = 3 =
          p$put_class_3 (class);
        ELSE
          p$put_class_0 (class);
        CASEND;

      PROCEND p$put_class;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_DISK_TABLE_STATUS', EJECT ??

      PROCEDURE p$put_disk_table_status
        (    volume_table_status: dmt$ms_volume_table_status);

        VAR
          status: dmt$disk_table_status,
          element_count: integer,
          element_count2: integer,
          str: ost$string;

        element_count := 0;
        element_count2 := 0;
        FOR status := LOWERVALUE (dmt$disk_table_status) TO UPPERVALUE (dmt$disk_table_status) DO
          IF status IN volume_table_status THEN
            element_count := element_count + 1;
          IFEND;
        FOREND;

        CASE element_count OF
        = 0 =
          fip#addl_initialize (str, 'NONE');
        = 1 =
          fip#addl_initialize (str, '');
        ELSE
          fip#addl_initialize (str, '(');
        CASEND;

        FOR status := LOWERVALUE (dmt$disk_table_status) TO UPPERVALUE (dmt$disk_table_status) DO
          IF status IN volume_table_status THEN
            element_count2 := element_count2 + 1;
            CASE status OF
            = dmc$table_update_inhibited =
              fip#addl_string (str, 'Update Inhibited');

            = dmc$table_update_in_progress =
              fip#addl_string (str, 'Update In Progress');

            = dmc$dflt_update_required =
              fip#addl_string (str, 'Update Required');

            = dmc$no_available_dflt_entries =
              fip#addl_string (str, 'No Available Entries');

            ELSE;
              fip#addl_string (str, 'Unknown Disk Status');
            CASEND;

            IF element_count2 <> element_count THEN
              fip#addl_string (str, ', ');
            IFEND;
          IFEND;
        FOREND;

        IF element_count > 1 THEN
          fip#addl_string (str, ')');
        IFEND;

        p$move_string (^str.value, str.size, ^s^ (string_index), width);

      PROCEND p$put_disk_table_status;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_ELEMENT_ACCESS', EJECT ??

      PROCEDURE p$put_element_access
        (    element_access: cmt$element_access);

        VAR
          str: ost$string;

        fip#addl_initialize (str, '(');

        IF element_access = $cmt$element_access [] THEN
          fip#addl_initialize (str, 'NONE');

        ELSEIF element_access = $cmt$element_access [cmc$read] THEN
          fip#addl_initialize (str, 'Read');

        ELSEIF element_access = $cmt$element_access [cmc$write] THEN
          fip#addl_initialize (str, 'Write');

        ELSE
          fip#addl_initialize (str, '(Read, Write)');
        IFEND;

        p$move_string (^str.value, str.size, ^s^ (string_index), width);

      PROCEND p$put_element_access;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_ELEMENT_CAPABILITIES', EJECT ??

      PROCEDURE p$put_element_capabilities
        (    element_capabilities: cmt$element_capabilities);

        VAR
          device_capability: cmt$device_capability,
          element_count2: integer,
          element_count: integer,
          str: ost$string;

        element_count := 0;
        element_count2 := 0;
        FOR device_capability := LOWERVALUE (cmt$device_capability) TO UPPERVALUE (cmt$device_capability) DO
          IF device_capability IN element_capabilities THEN
            element_count := element_count + 1;
          IFEND;
        FOREND;

        CASE element_count OF
        = 0 =
          fip#addl_initialize (str, 'NONE');
        = 1 =
          fip#addl_initialize (str, '');
        ELSE
          fip#addl_initialize (str, '(');
        CASEND;

        FOR device_capability := LOWERVALUE (cmt$device_capability) TO UPPERVALUE (cmt$device_capability) DO
          IF device_capability IN element_capabilities THEN
            element_count2 := element_count2 + 1;
            CASE device_capability OF
            = cmc$job_reservation =
              fip#addl_string (str, 'Job Reservation');

            = cmc$volume_assignment =
              fip#addl_string (str, 'Volume Assignment');

            = cmc$file_allocation =
              fip#addl_string (str, 'File Allocation');

            = cmc$io_request_submission =
              fip#addl_string (str, 'IO Request Submission');

            = cmc$concurrent_maintenance =
              fip#addl_string (str, 'Concurrent Maintenance');

            = cmc$dedicated_maintenance =
              fip#addl_string (str, 'Dedicated Maintenance');

            ELSE;
            CASEND;

            IF element_count2 <> element_count THEN
              fip#addl_string (str, ', ');
            IFEND;
          IFEND;
        FOREND;

        IF element_count > 1 THEN
          fip#addl_string (str, ')');
        IFEND;

        p$move_string (^str.value, str.size, ^s^ (string_index), width);

      PROCEND p$put_element_capabilities;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_INTEGER', EJECT ??

      PROCEDURE p$put_integer
        (    value: integer);

        VAR
          field_overflow: boolean,
          n_negative: boolean,
          n_abs: integer,
          n: integer,
          string_indexr: 0 .. ofc$max_display_width + 1;

        IF ude_p^.scale > 1 THEN
          n := value DIV ude_p^.scale;
        ELSE
          n := value;
        IFEND;

        n_negative := n < 0;
        IF n_negative THEN
          n_abs := -n;
        ELSE
          n_abs := n;
        IFEND;

{NOTE: WIDTH also contains a space between the counts.

        field_overflow := (width < UPPERBOUND (max_field_values))
{         } AND (((n_negative = FALSE) AND (n > max_field_values [width] [FALSE]))
{           } OR ((n_negative = TRUE) AND (n < max_field_values [width] [TRUE])));

        IF NOT field_overflow
{     } OR (ude_p^.field_overflow_action = ofc$foa_maximum) THEN

          IF (width <= v$max_integer_sizes [n_negative])
{       } AND (field_overflow AND (field_index > 1)
{         } OR (((n_negative = FALSE) AND (n > max_field_values [width + 1] [FALSE]))
{         } OR ((n_negative = TRUE) AND (n < max_field_values [width + 1] [TRUE])))) THEN

            n := max_field_values [width] [n_negative];
            IF n_negative THEN
              n_abs := -n;
            ELSE
              n_abs := n;
            IFEND;
          IFEND;

          string_indexr := string_index + width - 1;
          REPEAT
            s^ (string_indexr) := $CHAR ((n_abs MOD 10) + $INTEGER ('0'));
            n_abs := n_abs DIV 10;
            string_indexr := string_indexr - 1;
          UNTIL n_abs = 0;

          IF n_negative THEN
            s^ (string_indexr) := '-';
          IFEND;

        ELSEIF ude_p^.field_overflow_action = ofc$foa_scale THEN
          pmp$binary_to_ascii_fit (n, 10, width - 1, width - 1, s^ (string_index + 1, width - 1));

        ELSE
          s^ (string_index, width) := ' *********************';
        IFEND;

      PROCEND p$put_integer;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_INTERNAL_VSN', EJECT ??

      PROCEDURE p$put_internal_vsn
        (    value: dmt$internal_vsn);

        VAR
          name: ost$name,
          ignore_status: ost$status;

        name := '';
        ignore_status.normal := TRUE;
        pmp$convert_binary_unique_name (value, name, ignore_status);
        p$move_string (^name, osc$max_name_size, ^s^ (string_index), width);

      PROCEND p$put_internal_vsn;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_LOGICAL_UNIT_STATUS', EJECT ??

      PROCEDURE p$put_logical_unit_status
        (    logical_unit_status: cmt$logical_unit_status);

        VAR
          str: ost$string;

        fip#addl_initialize (str, '');

        IF logical_unit_status.assignable_device THEN
          IF logical_unit_status.assigned THEN
            fip#addl_string (str, '(assigned, ');
            fip#addl_string (str, logical_unit_status.assigned_jsn);
            fip#addl_string (str, ')');
          ELSE
            fip#addl_string (str, 'not assigned, ');
          IFEND;
        IFEND;

        p$move_string (^str.value, str.size, ^s^ (string_index), width);

      PROCEND p$put_logical_unit_status;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_LONGREAL', EJECT ??

      PROCEDURE p$put_longreal
        (    value: longreal);

        VAR
          r: longreal,
          format: mlt$output_format,
          length: mlt$string_length,
          error: mlt$error,
          str: string (80);

        IF ude_p^.scale > 1 THEN
          r := value / $LONGREAL (ude_p^.scale);
        ELSE
          r := value;
        IFEND;

        format.justification := mlc$left_justify;
        format.sign := mlc$minus_if_negative;
        format.format := mlc$f_style;
        format.scale_factor := 1;
        format.width := width - 1;
        format.digits := ude_p^.fraction_width;
        format.exponent_character := 'E';
        format.exponent_style := 0;

        mlp$output_floating_number (^r, mlc$double_precision, ^str, format, length, error);
        IF error = mle$no_error THEN
          s^ (string_index + width - length, width) := str (1, length);
        ELSE
          p$process_real_format_error (error);
        IFEND;

      PROCEND p$put_longreal;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_MAINFRAME_ASSIGNED', EJECT ??

      PROCEDURE p$put_mainframe_assigned
        (    value: dmt$mainframe_assigned);

        VAR
          str: ost$string,
          ignore_status: ost$status;

        fip#addl_initialize (str, '(');
        fip#addl_integer (str, value.log_in_sequence, ignore_status);
        fip#addl_string (str, ', ');
        fip#addl_integer (str, value.log_in_index, ignore_status);
        fip#addl_string (str, ')');
        p$move_string (^str.value, str.size, ^s^ (string_index), width);

      PROCEND p$put_mainframe_assigned;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_MS_VOLUME_SYSTEM_STATUS', EJECT ??

      PROCEDURE p$put_ms_volume_system_status
        (    volume_system_status: dmt$ms_volume_system_status);

        VAR
          status: dmt$ms_avt_status,
          element_count: integer,
          element_count2: integer,
          str: ost$string;

        element_count := 0;
        element_count2 := 0;
        FOR status := LOWERVALUE (dmt$ms_avt_status) TO UPPERVALUE (dmt$ms_avt_status) DO
          IF status IN volume_system_status THEN
            element_count := element_count + 1;
          IFEND;
        FOREND;

        CASE element_count OF
        = 0 =
          fip#addl_initialize (str, 'NONE');
        = 1 =
          fip#addl_initialize (str, '');
        ELSE
          fip#addl_initialize (str, '(');
        CASEND;

        FOR status := LOWERVALUE (dmt$ms_avt_status) TO UPPERVALUE (dmt$ms_avt_status) DO
          IF status IN volume_system_status THEN
            element_count2 := element_count2 + 1;
            CASE status OF
            = dmc$mainframe_mounted =
              fip#addl_string (str, 'Mainframe mounted');

            = dmc$mainframe_dismounted =
              fip#addl_string (str, 'Mainframe dismounted');

            = dmc$system_mounted =
              fip#addl_string (str, 'System mounted');

            = dmc$system_dismounted =
              fip#addl_string (str, 'System dismounted');

            ELSE;
            CASEND;

            IF element_count2 <> element_count THEN
              fip#addl_string (str, ', ');
            IFEND;
          IFEND;
        FOREND;

        IF element_count > 1 THEN
          fip#addl_string (str, ')');
        IFEND;

        p$move_string (^str.value, str.size, ^s^ (string_index), width);

      PROCEND p$put_ms_volume_system_status;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_OFF_LINE_DRIVE_NUMBER', EJECT ??

      PROCEDURE p$put_off_line_drive_number
        (    off_line_drive_number: 0 .. 0ff(16));

        CONST
          c$init_off_line_drive_number = 0ff(16),
          c$no_drives_offline = 0fe(16);

        CASE off_line_drive_number OF
        = c$init_off_line_drive_number, c$no_drives_offline =

          s^ (string_index, v$field_info [ude_p^.field_id].size) := '';

        ELSE
          p$put_integer (f$integer (#ADDRESS (#RING (^unit_usage.total_data),
                #SEGMENT (^unit_usage.total_data), #OFFSET (^unit_usage.total_data) +
                v$field_info [ude_p^.field_id].offset), v$field_info [ude_p^.field_id].size));
        CASEND;

      PROCEND p$put_off_line_drive_number;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_REAL', EJECT ??

      PROCEDURE p$put_real
        (    value: real);

        VAR
          r: real,
          format: mlt$output_format,
          length: mlt$string_length,
          error: mlt$error,
          str: string (80);

        IF ude_p^.scale > 1 THEN
          r := value / $REAL (ude_p^.scale);
        ELSE
          r := value;
        IFEND;

        format.justification := mlc$left_justify;
        format.sign := mlc$minus_if_negative;
        format.format := mlc$f_style;
        format.scale_factor := 1;
        format.width := width - 1;
        format.digits := ude_p^.fraction_width;
        format.exponent_character := 'E';
        format.exponent_style := 0;

        mlp$output_floating_number (^r, mlc$single_precision, ^str, format, length, error);
        IF error = mle$no_error THEN
          s^ (string_index + width - length, width) := str (1, length);
        ELSE
          p$process_real_format_error (error);
        IFEND;

      PROCEND p$put_real;
?? OLDTITLE ??
?? NEWTITLE := 'p$put_volume_owner', EJECT ??

      PROCEDURE p$put_volume_owner
        (    value: ost$user_identification);

        VAR
          str: ost$string;

        fip#addl_initialize (str, '(');
        fip#addl_trimmed_string (str, value.user, fic#ato_trailing, ' ');
        fip#addl_string (str, ', ');
        fip#addl_trimmed_string (str, value.family, fic#ato_trailing, ' ');

        p$move_string (^str.value, str.size, ^s^ (string_index), width);

      PROCEND p$put_volume_owner;
?? OLDTITLE ??
?? EJECT ??
      string_index := 1;

    /build_line_loop/
      FOR field_index := 1 TO ud_p^.header.field_count DO
        ude_p := ^ud_p^.fields [field_index];
        width := ude_p^.width;

{     IF (field.field_selection <> ofc$fs_unconditional) AND (field.field_selection <> swap_status) THEN
{       IF field.non_selection_action = ofc$nsa_blank THEN
{         string_index := string_index + width;
{       IFEND;
{       CYCLE /build_line_loop/; {----->
{     IFEND;

{Check if field available
        field_available := (ude_p^.scale = 0)
{     } OR ((ude_p^.numeric_selection_mode = ofc$nsm_incremental)
{         } AND unit_usage.incremental_data_defined
{         } AND (v$field_source [ude_p^.field_id] <= unit_usage.incremental_data.defined_sources))
{     } OR ((ude_p^.numeric_selection_mode = ofc$nsm_total)
{         } AND (v$field_source [ude_p^.field_id] <= unit_usage.total_data.defined_sources));

        IF field_available = FALSE THEN
          string_index := string_index + width;
          CYCLE /build_line_loop/; {----->
        IFEND;

        CASE v$field_info [ude_p^.field_id].kind OF
        = c$boolean =
          cell_p := #ADDRESS (#RING (^unit_usage), #SEGMENT (^unit_usage),
                #OFFSET (^unit_usage) + v$field_info [ude_p^.field_id].offset);
          bool.c := cell_p^;
          s^ (string_index, width) := v$boolean_string [bool.b];

        = c$text =
          p$move_string (#ADDRESS (#RING (^unit_usage), #SEGMENT (^unit_usage),
                #OFFSET (^unit_usage) + v$field_info [ude_p^.field_id].offset),
                v$field_info [ude_p^.field_id].size, ^s^ (string_index), width);

        = c$integer =
          CASE ude_p^.numeric_selection_mode OF
          = ofc$nsm_total =
            CASE ude_p^.numeric_display_mode.kind OF

            = ofc$ndm_total =
              p$put_integer (f$integer (#ADDRESS (#RING (^unit_usage.total_data),
                    #SEGMENT (^unit_usage.total_data), #OFFSET (^unit_usage.total_data) +
                    v$field_info [ude_p^.field_id].offset), v$field_info [ude_p^.field_id].size));

            = ofc$ndm_interval =
              IF control.current_time_in_us = 0 THEN
                p$put_longreal ($LONGREAL (0.0));
              ELSE
                n := f$integer (#ADDRESS (#RING (^unit_usage.total_data), #SEGMENT (^unit_usage.total_data),
                      #OFFSET (^unit_usage.total_data) + v$field_info [ude_p^.field_id].offset),
                      v$field_info [ude_p^.field_id].size);
                p$put_longreal ($LONGREAL (n) * ($LONGREAL (ude_p^.numeric_display_mode.interval) /
                      $LONGREAL (control.current_time_in_us)));
              IFEND;
            CASEND;

          = ofc$nsm_incremental =
            CASE ude_p^.numeric_display_mode.kind OF
            = ofc$ndm_total =
              p$put_integer (f$integer (#ADDRESS (#RING (^unit_usage.incremental_data),
                    #SEGMENT (^unit_usage.incremental_data), #OFFSET (^unit_usage.incremental_data) +
                    v$field_info [ude_p^.field_id].offset), v$field_info [ude_p^.field_id].size));
              ;

            = ofc$ndm_interval =
              IF control.incremental_time_in_us = 0 THEN
                p$put_longreal ($LONGREAL (0.0));
              ELSE
                n := f$integer (#ADDRESS (#RING (^unit_usage.incremental_data),
                      #SEGMENT (^unit_usage.incremental_data), #OFFSET (^unit_usage.incremental_data) +
                      v$field_info [ude_p^.field_id].offset), v$field_info [ude_p^.field_id].size);
                p$put_longreal ($LONGREAL (n) * ($LONGREAL (ude_p^.numeric_display_mode.interval) /
                      $LONGREAL (control.incremental_time_in_us)));
              IFEND;
            CASEND;
          CASEND;

        = c$real =
          CASE ude_p^.numeric_selection_mode OF
          = ofc$nsm_total =
            CASE ude_p^.numeric_display_mode.kind OF

            = ofc$ndm_total =
              p$put_real (f$real (#ADDRESS (#RING (^unit_usage.total_data), #SEGMENT (^unit_usage.total_data),
                    #OFFSET (^unit_usage.total_data) + v$field_info [ude_p^.field_id].offset)));

            = ofc$ndm_interval =
              IF control.current_time_in_us = 0 THEN
                p$put_longreal ($LONGREAL (0.0));
              ELSE
                r := f$real (#ADDRESS (#RING (^unit_usage.total_data), #SEGMENT (^unit_usage.total_data),
                      #OFFSET (^unit_usage.total_data) + v$field_info [ude_p^.field_id].offset));
                p$put_longreal ($LONGREAL (r) * ($LONGREAL (ude_p^.numeric_display_mode.interval) /
                      $LONGREAL (control.current_time_in_us)));
              IFEND;
            CASEND;

          = ofc$nsm_incremental =
            CASE ude_p^.numeric_display_mode.kind OF
            = ofc$ndm_total =
              p$put_real (f$real (#ADDRESS (#RING (^unit_usage.incremental_data),
                    #SEGMENT (^unit_usage.incremental_data), #OFFSET (^unit_usage.incremental_data) +
                    v$field_info [ude_p^.field_id].offset)));

            = ofc$ndm_interval =
              IF control.incremental_time_in_us = 0 THEN
                p$put_longreal ($LONGREAL (0.0));
              ELSE
                r := f$real (#ADDRESS (#RING (^unit_usage.incremental_data),
                      #SEGMENT (^unit_usage.incremental_data), #OFFSET (^unit_usage.incremental_data) +
                      v$field_info [ude_p^.field_id].offset));
                p$put_longreal ($LONGREAL (r) * ($LONGREAL (ude_p^.numeric_display_mode.interval) /
                      $LONGREAL (control.incremental_time_in_us)));
              IFEND;
            CASEND;
          CASEND;

        = c$to_be_determined =
          ;
        = c$miscellaneous =
          CASE ude_p^.field_id OF
          = ofc$us_fill =
            s^ (string_index, width) := ude_p^.field_title (1, width);

          = ofc$us_channel =
            p$put_channel (unit_usage.total_data.channel);

          = ofc$us_off_line_drive_number =
            p$put_off_line_drive_number (unit_usage.total_data.off_line_drive_number);

          = ofc$us_unit_type =
{Display Product Identifier
            p$move_string (^unit_usage.total_data.product_identification.str,
                  STRLENGTH (unit_usage.total_data.product_identification.str), ^s^ (string_index), width);

          = ofc$us_element_access =
            p$put_element_access (unit_usage.total_data.element_access);

          = ofc$us_element_capabilities =
            p$put_element_capabilities (unit_usage.total_data.element_capabilities);

          = ofc$us_logical_unit_status =
            p$put_logical_unit_status (unit_usage.total_data.logical_unit_status);

          = ofc$us_disk_table_status =
            p$put_disk_table_status (unit_usage.total_data.disk_table_status);

          = ofc$us_class =
            p$put_class (unit_usage.total_data.class);

          = ofc$us_internal_vsn =
            p$put_internal_vsn (unit_usage.total_data.internal_vsn);

          = ofc$us_mainframe_assigned =
            p$put_mainframe_assigned (unit_usage.total_data.mainframe_assigned);

          = ofc$us_status =
            p$put_ms_volume_system_status (unit_usage.total_data.status);

          = ofc$us_volume_owner =
            p$put_volume_owner (unit_usage.total_data.volume_owner);

          ELSE
          CASEND;
        ELSE
        CASEND;

        string_index := string_index + width;

      FOREND /build_line_loop/;

    PROCEND build_line;
?? OLDTITLE ??
?? NEWTITLE := 'P$GET_UNIT_STATISTIC_DATA', EJECT ??

    PROCEDURE p$get_unit_statistic_data
      (VAR ud: oft$unit_stat_display_desc;
           lun: integer;
           control: t$unit_statistic_control;
       VAR unit_statistic_data: oft$unit_statistic_data);

      VAR
        inc_p: ^oft$unit_statistic_data_item;

?? NEWTITLE := 'P$BUILD_INCREMENTAL_DATA', EJECT ??

      PROCEDURE p$build_incremental_data
        (    prev_p: ^oft$unit_statistic_data_item;
         VAR unit_statistic_data: oft$unit_statistic_data);

{This request builds the incremental data from the previous and the current data. The
{fields are built the following way:
{ - incremental fields (integer counters): current - previous
{ - non incremental fields               : previous
{

        VAR
          system_class: dmt$system_class,
          inc_p: ^oft$unit_statistic_data_item,
          total_p: ^oft$unit_statistic_data_item;

{NOTE: prev_p in newer NIL.
        inc_p := ^unit_statistic_data.incremental_data;
        total_p := ^unit_statistic_data.total_data;

{NOTE: we move the complete prev data into the incremental_data. So we do only have to
{      adjust the fields that can have incremental values.

        inc_p^ := prev_p^;

{Incremental and Non-incremental fields are only considered as available, when the data
{was available in the previous and also in the current data.

        inc_p^.defined_sources := total_p^.defined_sources * prev_p^.defined_sources;

{OFC$US_STATISTIC_DATA
        IF ofc$us_statistic_data IN inc_p^.defined_sources THEN
          inc_p^.read_requests := total_p^.read_requests - prev_p^.read_requests;
          inc_p^.read_qtime := total_p^.read_qtime - prev_p^.read_qtime;
          inc_p^.read_mau_count := total_p^.read_mau_count - prev_p^.read_mau_count;
          inc_p^.write_requests := total_p^.write_requests - prev_p^.write_requests;
          inc_p^.write_qtime := total_p^.write_qtime - prev_p^.write_qtime;
          inc_p^.write_data_mau_count := total_p^.write_data_mau_count - prev_p^.write_data_mau_count;
          inc_p^.write_data_and_preset_maus := total_p^.write_data_and_preset_maus -
                prev_p^.write_data_and_preset_maus;
          inc_p^.swap_in_requests := total_p^.swap_in_requests - prev_p^.swap_in_requests;
          inc_p^.swap_in_qtime := total_p^.swap_in_qtime - prev_p^.swap_in_qtime;
          inc_p^.swap_in_mau_count := total_p^.swap_in_mau_count - prev_p^.swap_in_mau_count;
          inc_p^.swap_out_requests := total_p^.swap_out_requests - prev_p^.swap_out_requests;
          inc_p^.swap_out_qtime := total_p^.swap_out_qtime - prev_p^.swap_out_qtime;
          inc_p^.swap_out_data_mau_count := total_p^.swap_out_data_mau_count -
                prev_p^.swap_out_data_mau_count;
          inc_p^.swap_out_data_and_preset_maus := total_p^.swap_out_data_and_preset_maus -
                prev_p^.swap_out_data_and_preset_maus;
          inc_p^.streamed_req_count_read := total_p^.streamed_req_count_read -
                prev_p^.streamed_req_count_read;
          inc_p^.streamed_req_failed_count_read := total_p^.streamed_req_failed_count_read -
                prev_p^.streamed_req_failed_count_read;
          inc_p^.streamed_req_count_write := total_p^.streamed_req_count_write -
                prev_p^.streamed_req_count_write;
          inc_p^.streamed_req_failed_count_write := total_p^.streamed_req_failed_count_write -
                prev_p^.streamed_req_failed_count_write;
          inc_p^.requests_causing_skipped_cyl := total_p^.requests_causing_skipped_cyl -
                prev_p^.requests_causing_skipped_cyl;
          inc_p^.total_cylinders_skipped := total_p^.total_cylinders_skipped -
                prev_p^.total_cylinders_skipped;
          inc_p^.intermediate_errors := total_p^.intermediate_errors - prev_p^.intermediate_errors;
          inc_p^.recovered_errors := total_p^.recovered_errors - prev_p^.recovered_errors;
          inc_p^.unrecovered_errors := total_p^.unrecovered_errors - prev_p^.unrecovered_errors;
        IFEND;

{OFC$US_EXTENDED_STATISTIC_DATA
        IF ofc$us_extended_statistic_data IN inc_p^.defined_sources THEN
          inc_p^.average_byte_count_per_request := total_p^.average_byte_count_per_request -
                prev_p^.average_byte_count_per_request;
          inc_p^.qtime_per_read_request := total_p^.qtime_per_read_request - prev_p^.qtime_per_read_request;
          inc_p^.qtime_per_swap_in_request := total_p^.qtime_per_swap_in_request -
                prev_p^.qtime_per_swap_in_request;
          inc_p^.qtime_per_swap_out_request := total_p^.qtime_per_swap_out_request -
                prev_p^.qtime_per_swap_out_request;
          inc_p^.qtime_per_total_request := total_p^.qtime_per_total_request -
                prev_p^.qtime_per_total_request;
          inc_p^.qtime_per_write_request := total_p^.qtime_per_write_request -
                prev_p^.qtime_per_write_request;
          inc_p^.seeks := total_p^.seeks - prev_p^.seeks;
          inc_p^.stream_req_count_total := total_p^.stream_req_count_total - prev_p^.stream_req_count_total;
          inc_p^.stream_req_failed_total := total_p^.stream_req_failed_total -
                prev_p^.stream_req_failed_total;
          inc_p^.stream_req_attempt_total := total_p^.stream_req_attempt_total -
                prev_p^.stream_req_attempt_total;
          inc_p^.streamed_success := total_p^.streamed_success - prev_p^.streamed_success;
          inc_p^.total_bytes := total_p^.total_bytes - prev_p^.total_bytes;
          inc_p^.total_errors := total_p^.total_errors - prev_p^.total_errors;
          inc_p^.total_input_bytes := total_p^.total_input_bytes - prev_p^.total_input_bytes;
          inc_p^.total_output_bytes := total_p^.total_output_bytes - prev_p^.total_output_bytes;
          inc_p^.total_qtime := total_p^.total_qtime - prev_p^.total_qtime;
          inc_p^.total_requests := total_p^.total_requests - prev_p^.total_requests;
        IFEND;

{OFC$US_UNIT_INTERFACE_TABLE
        IF ofc$us_unit_interface_table IN inc_p^.defined_sources THEN
          inc_p^.queue_count := total_p^.queue_count - prev_p^.queue_count;
        IFEND;

{OFC$US_ACTIVE_VOLUME_TABLE
        IF ofc$us_active_volume_table IN inc_p^.defined_sources THEN
          FOR system_class := LOWERVALUE (dmt$system_class) TO UPPERVALUE (dmt$system_class) DO
            inc_p^.system_class_activity [system_class] := total_p^.system_class_activity [system_class] -
                  prev_p^.system_class_activity [system_class];
          FOREND;

          inc_p^.current_position_offset_in_log := total_p^.current_position_offset_in_log -
                prev_p^.current_position_offset_in_log;
          inc_p^.allocated_log_size := total_p^.allocated_log_size - prev_p^.allocated_log_size;
          inc_p^.device_log_entry_count := total_p^.device_log_entry_count - prev_p^.device_log_entry_count;
        IFEND;

{We do not have to build source OFC$US_VSN and OFC$US_UNIT_INTERFACE_TABLE, as there are no
{incremental fields.

        unit_statistic_data.incremental_data_defined := TRUE;

      PROCEND p$build_incremental_data;
?? OLDTITLE ??
?? NEWTITLE := '[INLINE] P$GET_ACTIVE_VOLUME_TABLE_DATA', EJECT ??

      PROCEDURE [INLINE] p$get_active_volume_table_data
        (    lun: integer;
         VAR total_data: oft$unit_statistic_data_item);

        VAR
          avt: dmt$active_volume_table_index,
          system_class: dmt$system_class,
          found: boolean;

        IF dmv$active_volume_table.table_p = NIL THEN
          RETURN; {----->
        IFEND;

        dmp$search_avt_by_lun (lun, avt, found);

        IF found THEN
          total_data.allocation_allowed := dmv$active_volume_table.table_p^ [avt].mass_storage.
                allocation_allowed;
          total_data.space_low := dmv$active_volume_table.table_p^ [avt].mass_storage.space_low;
          total_data.space_gone := dmv$active_volume_table.table_p^ [avt].mass_storage.space_gone;
          total_data.disk_table_status := dmv$active_volume_table.table_p^ [avt].mass_storage.
                disk_table_status;
          total_data.class := dmv$active_volume_table.table_p^ [avt].mass_storage.class;

          FOR system_class := LOWERVALUE (dmt$system_class) TO UPPERVALUE (dmt$system_class) DO
            total_data.system_class_activity [system_class] :=
                  dmv$active_volume_table.table_p^ [avt].mass_storage.system_class_activity [system_class];
          FOREND;

          total_data.logged_in_for_recovery := dmv$active_volume_table.table_p^ [avt].mass_storage.
                logged_in_for_recovery;
          total_data.internal_vsn := dmv$active_volume_table.table_p^ [avt].mass_storage.internal_vsn;
          total_data.mainframe_assigned := dmv$active_volume_table.table_p^ [avt].mass_storage.
                mainframe_assigned;
          total_data.set_name := dmv$active_volume_table.table_p^ [avt].mass_storage.set_name;
          total_data.status := dmv$active_volume_table.table_p^ [avt].mass_storage.status;
          total_data.volume_owner := dmv$active_volume_table.table_p^ [avt].mass_storage.volume_owner;
          total_data.current_position_offset_in_log := dmv$active_volume_table.table_p^ [avt].mass_storage.
                current_position_offset_in_log;
          total_data.allocated_log_size := dmv$active_volume_table.table_p^ [avt].mass_storage.
                allocated_log_size;
          total_data.device_log_entry_count := dmv$active_volume_table.table_p^ [avt].mass_storage.
                device_log_entry_count;
          total_data.volume_unavailable := dmv$active_volume_table.table_p^ [avt].mass_storage.
                volume_unavailable;
          total_data.previous_allocation_allowed := dmv$active_volume_table.table_p^ [avt].mass_storage.
                previous_allocation_allowed;
          total_data.logging_process_damaged := dmv$active_volume_table.table_p^ [avt].mass_storage.
                logging_process_damaged;
        IFEND;

      PROCEND p$get_active_volume_table_data;
?? OLDTITLE ??
?? NEWTITLE := '[INLINE] P$GET_STATISTIC_DATA', EJECT ??

      PROCEDURE [INLINE] p$get_statistic_data
        (    lun: integer;
         VAR total_data: oft$unit_statistic_data_item);

        VAR
          total_data_defined: boolean;

{NOTE:
{  - iov$disk_unit_usage_p in NOT NIL
{  - (lun >= lowerbound(iov$disk_unit_usage_p^)) and (lun <= lowerbound(iov$disk_unit_usage_p^))
{  - RECORDED_VSN is not initialized and needs to be processed in the caller.

        total_data_defined := iov$disk_unit_usage_p^ [lun] <> NIL;
        IF total_data_defined THEN

          total_data.defined_sources := total_data.defined_sources +
                $oft$us_field_sources [ofc$us_statistic_data];

          total_data.disk_unit_usage := iov$disk_unit_usage_p^ [lun]^;

{ whipeout unprintable VSN characters
          total_data.recorded_vsn := '';
        IFEND;

      PROCEND p$get_statistic_data;
?? OLDTITLE ??
?? NEWTITLE := '[INLINE] P$GET_LOGICAL_UNIT_TABLE_DATA', EJECT ??

      PROCEDURE [INLINE] p$get_logical_unit_table_data
        (    lun: integer;
{            inc_p: ^oft$unit_statistic_data_item;
         VAR total_data: oft$unit_statistic_data_item);

{It appears to me, like the Logical Unit Table index is the same as the LUN,
{even when LUN is stored in the table!?!

{If this is not always the case, we could do it over the index like the VSN, ...
{**** debug code begin

        VAR
          i: integer,
          s: string (255);

{**** debug code end

        VAR
          logical_unit_p: ^cmt$logical_unit;

        IF (cmv$logical_unit_table = NIL) OR (lun < 1) OR (lun > UPPERBOUND (cmv$logical_unit_table^)) THEN
          RETURN; {----->
        IFEND;

        logical_unit_p := ^cmv$logical_unit_table^ [lun];
        IF logical_unit_p^.configured AND (lun <> logical_unit_p^.logical_unit_number) THEN
{we would have to get the index from the incremental display or search the table ....
{**** debug code begin
          STRINGREP (s, i, '* LUN <> Logical Unit Table Index *  LUN= ', logical_unit_p^.logical_unit_number,
                ' index= lun');
          put_line (i, s);
{**** debug code end
        ELSE
          total_data.defined_sources := total_data.defined_sources +
                $oft$us_field_sources [ofc$us_logical_unit_table];

          total_data.logical_unit_table_index := lun;
          total_data.configured := logical_unit_p^.configured;
          total_data.entry_interlock := logical_unit_p^.entry_interlock;
          total_data.element_capabilities := logical_unit_p^.element_capability;
          total_data.logical_unit_status := logical_unit_p^.status;
          total_data.element_access := logical_unit_p^.element_access;
        IFEND;

      PROCEND p$get_logical_unit_table_data;
?? OLDTITLE ??
?? NEWTITLE := '[INLINE] P$GET_PRODUCT_IDENTIFICATION', EJECT ??

      PROCEDURE [INLINE] p$get_product_identification
        (    lun: integer;
             inc_p: ^oft$unit_statistic_data_item;
         VAR total_data: oft$unit_statistic_data_item);

        VAR
          element_p: ^cmt$peripheral_element_entry;

        IF inc_p = NIL THEN
          cmp$get_element_entry_via_lun (lun, element_p);
          IF element_p <> NIL THEN
            total_data.defined_sources := total_data.defined_sources +
                  $oft$us_field_sources [ofc$us_product_identification];
            total_data.product_identification.value := element_p^.product_id;
          IFEND;
        ELSE
          total_data.product_identification := inc_p^.product_identification;
          total_data.defined_sources := total_data.defined_sources +
                $oft$us_field_sources [ofc$us_product_identification];
        IFEND;

      PROCEND p$get_product_identification;
?? OLDTITLE ??
?? NEWTITLE := '[INLINE] P$GET_UNIT_INTERFACE_TABLE_DATA', EJECT ??

      PROCEDURE [INLINE] p$get_unit_interface_table_data
        (    lun: integer;
{            inc_p: ^oft$unit_statistic_data_item;
         VAR total_data: oft$unit_statistic_data_item);

{We get the Unit Interface Table via the Logical Unit Table. So we will have the same
{problem here as in P$GET_LOGICAL_UNIT_TABLE_DATA, if the index and the LUN does not match

{NOTE: The Logical_Unit_Numer is also contained in the interface table.

        VAR
          unit_interface_p: ^iot$unit_interface_table;

        IF (cmv$logical_unit_table = NIL) OR (lun < 1) OR (lun > UPPERBOUND (cmv$logical_unit_table^))
{     } OR (cmv$logical_unit_table^ [lun].configured = FALSE) { we can't get to the table
{     } OR (lun <> cmv$logical_unit_table^ [lun].logical_unit_number)
{     } OR (cmv$logical_unit_table^ [lun].unit_interface_table = NIL) THEN
          RETURN; {----->
        IFEND;

        unit_interface_p := cmv$logical_unit_table^ [lun].unit_interface_table;
        total_data.defined_sources := total_data.defined_sources +
              $oft$us_field_sources [ofc$us_unit_interface_table];

        total_data.unit_disabled := unit_interface_p^.unit_status.disabled;
        total_data.parity_protection_enabled := unit_interface_p^.unit_status.parity_protection_enabled;
        total_data.force_format := unit_interface_p^.unit_status.force_format;
        total_data.restoring_drive := unit_interface_p^.unit_status.restoring_drive;
        total_data.off_line_drive_number := unit_interface_p^.unit_status.off_line_drive_number;
        total_data.queue_count := unit_interface_p^.queue_count;
        total_data.unit_shared := unit_interface_p^.unit_shared;

      PROCEND p$get_unit_interface_table_data;
?? OLDTITLE ??
?? NEWTITLE := '[INLINE] P$GET_VSN', EJECT ??

      PROCEDURE [INLINE] p$get_vsn
        (    lun: integer;
             inc_p: ^oft$unit_statistic_data_item;
         VAR total_data: oft$unit_statistic_data_item);

        VAR
          found: boolean,
          rvsn: rmt$recorded_vsn;

        IF inc_p = NIL THEN
          osp$get_rvsn_by_lun (lun, rvsn, found);
          IF found THEN
            total_data.defined_sources := total_data.defined_sources + $oft$us_field_sources [ofc$us_vsn];
            total_data.recorded_vsn := rvsn;
          IFEND;
        ELSE
          total_data.recorded_vsn := inc_p^.recorded_vsn;
          total_data.defined_sources := total_data.defined_sources + $oft$us_field_sources [ofc$us_vsn];
        IFEND;

      PROCEND p$get_vsn;
?? OLDTITLE ??
?? EJECT ??

{set inc_p to statistic data
      IF control.maintain_incremental_data AND (control.initialize_incremental_data = FALSE) THEN
{  We don't have to check for NIL or bounds (see p$init_control)
        inc_p := ^ud.header.incremental_data_p^ [lun];
      ELSE
        inc_p := NIL;
      IFEND;

{Init unit_statistic_data
      unit_statistic_data := v$nil_unit_statistic_data;
      unit_statistic_data.total_data.logical_unit_number := lun;

{Get statistical Data
      IF ofc$us_statistic_data IN ud.header.field_sources THEN
        p$get_statistic_data (lun, unit_statistic_data.total_data);
      IFEND;

      IF ofc$us_extended_statistic_data IN ud.header.field_sources THEN
        p$build_extended_statistic_data (unit_statistic_data.total_data);
      IFEND;

{Get VSN
      IF ofc$us_vsn IN ud.header.field_sources THEN
        p$get_vsn (lun, inc_p, unit_statistic_data.total_data);
      IFEND;

{Get Product_id / unit_type
      IF ofc$us_product_identification IN ud.header.field_sources THEN
        p$get_product_identification (lun, inc_p, unit_statistic_data.total_data);
      IFEND;

{Get Logical Unit Table Data
      IF ofc$us_logical_unit_table IN ud.header.field_sources THEN
        p$get_logical_unit_table_data (lun, unit_statistic_data.total_data);
      IFEND;

{Get Unit Interface Table Data
      IF ofc$us_unit_interface_table IN ud.header.field_sources THEN
        p$get_unit_interface_table_data (lun, unit_statistic_data.total_data);
      IFEND;

{Get Active Volume Table Data
      IF ofc$us_active_volume_table IN ud.header.field_sources THEN
        p$get_active_volume_table_data (lun, unit_statistic_data.total_data);
      IFEND;

{.. more, future Gets..

      IF (inc_p <> NIL) AND control.maintain_incremental_data THEN
        p$build_incremental_data (inc_p, unit_statistic_data);
      IFEND;

      IF control.incremental_data_reset_required THEN
        ud.header.incremental_data_p^ [lun] := unit_statistic_data.total_data;
        ud_p^.header.incremental_data_last_reset := control.current_clock;
      IFEND;

    PROCEND p$get_unit_statistic_data;
?? OLDTITLE ??
?? NEWTITLE := 'P$INIT_CONTROL', EJECT ??

    PROCEDURE [INLINE] p$init_control
      (    header: oft$us_display_descript_header;
           highest_lun: integer;
       VAR control: t$unit_statistic_control);

      control.current_clock := #FREE_RUNNING_CLOCK (0);
      control.current_time_in_us := control.current_clock - syv$nos_system_time.corresponding_frc;
      control.incremental_clock := header.incremental_data_last_reset;
      control.incremental_time_in_us := control.current_clock - control.incremental_clock;
      control.maintain_incremental_data := header.incremental_data_required;
      control.highest_lun := highest_lun;

      IF control.maintain_incremental_data
{   } AND ((header.incremental_data_p = NIL) OR (UPPERBOUND (header.incremental_data_p^) < highest_lun)) THEN
        control.initialize_incremental_data := TRUE;
      ELSE
        control.initialize_incremental_data := FALSE;
      IFEND;

      IF control.maintain_incremental_data = FALSE THEN
        control.incremental_data_reset_required := FALSE;
      ELSEIF control.initialize_incremental_data THEN
        control.incremental_data_reset_required := TRUE;
      ELSE
        control.incremental_data_reset_required := header.incremental_data_last_reset +
              header.incremental_data_reset_freq <= control.current_clock;
      IFEND;

    PROCEND p$init_control;
?? OLDTITLE ??
?? NEWTITLE := 'put_line', EJECT ??

    PROCEDURE [INLINE] put_line
      (    size: integer;
           s: string (255));

      IF wid <> 0 THEN
        ?IF debug THEN
          zdpp$put_next_line (wid, s (1, 80), status);
        ?ELSE
          dpp$put_next_line (wid, s (1, 80), status);
        ?IFEND;
      ELSE
        clp$put_display (display_control, s (1, size), clc$trim, status);
      IFEND;

      lines_written := lines_written + 1;

    PROCEND put_line;
?? OLDTITLE ??
?? NEWTITLE := 'p$put_unit_statistic', EJECT ??

    PROCEDURE p$put_unit_statistic
      (VAR control: t$unit_statistic_control);

      VAR
        column_index: integer,
        entry_in_use: boolean,
        inc_p: ^oft$us_incremental_unit_stats,
        line_has_data: boolean,
        lun: integer,
        unit_statistic_data: oft$unit_statistic_data,
        units_per_line_left: integer;

{debug code begin

      VAR
        str: string (255),
        i: integer;

{debug code end

      column_index := 1;
      line_has_data := FALSE;

{Process Incremental data
      inc_p := ud_p^.header.incremental_data_p;
      IF control.initialize_incremental_data THEN

{ NOTE: UPPERBOUND (inc_p^) is defined in PCU. So the only reason for a change is a deadstart
{       and there we want to get rid of the old data, anyway.

        ALLOCATE ud_p^.header.incremental_data_p: [1 .. control.highest_lun] IN osv$task_shared_heap^;
        pmp$zero_out_table (#LOC (ud_p^.header.incremental_data_p^),
              #SIZE (ud_p^.header.incremental_data_p^));
        IF inc_p <> NIL THEN
          FREE inc_p IN osv$task_shared_heap^;
        IFEND;
        inc_p := ud_p^.header.incremental_data_p;
        control.initialize_incremental_data := TRUE;
      IFEND;

      lun := 1; {lowerbound (iov$disk_unit_usage_p^)
      units_per_line_left := ud_p^.header.units_per_line;

    /build_display/
      WHILE (lines_written < lines_to_write) AND (lun <= UPPERBOUND (iov$disk_unit_usage_p^)) DO

        IF skip_lines > 0 THEN
          entry_in_use := TRUE;
        ELSE
          p$get_unit_statistic_data (ud_p^, lun, control, unit_statistic_data);

          IF f$disk_unit_statistic_selected (ud_p^.header.unit_selection, unit_statistic_data)
{tmp} AND (iov$disk_unit_usage_p^ [lun] <> NIL)
{tmp} AND (iov$disk_unit_usage_p^ [lun]^.unit_used) THEN

            s := '';
            build_line (unit_statistic_data, ud_p, ^s (column_index, 132));
            entry_in_use := TRUE;
          ELSE
            entry_in_use := FALSE;
          IFEND;
        IFEND;

        IF entry_in_use OR ud_p^.header.display_blank_lines THEN
          column_index := column_index + ud_p^.header.column_width;
          units_per_line_left := units_per_line_left - 1;
          line_has_data := TRUE;
        IFEND;

        IF units_per_line_left = 0 THEN
          IF skip_lines > 0 THEN
            skip_lines := skip_lines - 1;
          ELSE
            lines_written := lines_written + 1;
            IF line_has_data OR (wid <> 0) THEN
              put_line (column_index, s);
            IFEND;
          IFEND;
          line_has_data := FALSE;
          column_index := 1;
          units_per_line_left := ud_p^.header.units_per_line;
          s := '';
        IFEND;

        lun := lun + 1;
      WHILEND /build_display/;

      IF line_has_data THEN
        put_line (column_index, s);
      IFEND;

    PROCEND p$put_unit_statistic;
?? OLDTITLE ??
?? EJECT ??

{ Form pointer to max display description. This is cheating  but is "safe" and improves
{ performance since fixed pointers are used instead of adaptable pointers.

    s := ' ';
    IF initial_call THEN
      IF wid <> 0 THEN
        ?IF NOT debug THEN
          ofp$open_display (file_name, wid, dpc$wc_sharing, dpc$wk_table, ud_p^.header.title (2, 80),
                display_control, status);
        ?IFEND;
      ELSE
        ofp$open_display (file_name, wid, dpc$wc_sharing, dpc$wk_table, ud_p^.header.title (2, 80),
              display_control, status);
      IFEND;
    IFEND;

{ Determine starting and ending unit for display. If output is to a file, all lines are
{ displayed. If output is to the console (wid>0), only the current page is generated,
{ except for the very first call. Otherwise we do not properly initialize all previous data
{ (ex. VSN).

    IF wid <> 0 THEN
      ?IF NOT debug THEN
        dpp$get_starting_line (wid, starting_line, status);
      ?ELSE
        starting_line := 1;
      ?IFEND;
      skip_lines := starting_line - 1;
      IF initial_call THEN
        lines_to_write := 65535; {Max display size.
      ELSE
        lines_to_write := 20; {This is current max window size.}
      IFEND;
    ELSE
      skip_lines := 0;
      lines_to_write := 65535; {Max display size.
    IFEND;

{Header line
    IF ud_p^.header.display_system_line THEN
      ofp$build_system_line (ud_p^.header.system_line_info, s (1, 80));
      put_line (80, s);
      IF wid = 0 THEN
        clp$put_display (display_control, s (1, 1), clc$trim, status);
      IFEND;
      lines_written := 1;
    ELSE
      lines_written := 0;
      IF wid = 0 THEN
        clp$put_display (display_control, s (1, 1), clc$trim, status);
      IFEND;
    IFEND;

    IF iov$disk_unit_usage_p = NIL THEN
      put_line (1, s);
      s := ' No Disk Unit Statistics defined!';
      put_line (33, s);
    ELSE
      p$init_control (ud_p^.header, UPPERBOUND (iov$disk_unit_usage_p^), control);
      p$put_unit_statistic (control);
    IFEND;

    IF wid = 0 THEN
      clp$close_display (display_control, status);
    ELSEIF initial_call = FALSE THEN
      s := ' ';
      FOR i := lines_written + 1 TO lines_to_write DO
        ?IF debug THEN
          zdpp$put_next_line (wid, s (1, 80), status);
        ?ELSE
          dpp$put_next_line (wid, s (1, 80), status);
        ?IFEND;
      FOREND;
    IFEND;

  PROCEND p$display_unit_statistic;
?? OLDTITLE ??
?? NEWTITLE := 'search_for_display_description', EJECT ??

  PROCEDURE [INLINE] search_for_display_description
    (    display_name: ost$name;
     VAR dd_pp: ^oft$display_descriptions_p;
     VAR ud_pp: ^^oft$unit_stat_display_desc);

    dd_pp := ^display_descriptions_p;
    ud_pp := ^unit_display_descriptions_p;
    WHILE (dd_pp^ <> NIL) AND (dd_pp^^.header.display_name <> display_name) AND
          (dd_pp^^.header.display_name_abbrev <> display_name) DO
      dd_pp := ^dd_pp^^.header.next_description_p;
    WHILEND;

    IF dd_pp^ = NIL THEN
      WHILE (ud_pp^ <> NIL) AND (ud_pp^^.header.display_name <> display_name) AND
            (ud_pp^^.header.display_name_abbrev <> display_name) DO
        ud_pp := ^ud_pp^^.header.next_description_p;
      WHILEND;
    IFEND;

  PROCEND search_for_display_description;

?? OLDTITLE, NEWTITLE := 'ofp$access_display_description', EJECT ??

  PROCEDURE [XDCL, #GATE] ofp$access_display_description
    (    request_code: oft$access_display_request_code;
         callers_dd_p: oft$display_descriptions_p;
     VAR field_count: oft$field_count;
     VAR status: ost$status);

    VAR
      abbrev_dd_pp: ^oft$display_descriptions_p,
      abbrev_ud_pp: ^^oft$unit_stat_display_desc,
      dd_pp: ^oft$display_descriptions_p,
      dd_p: ^oft$display_description,
      delete_dd_p: ^oft$display_description,
      index: integer,
      ud_pp: ^^oft$unit_stat_display_desc,
      unit_statistic_display: boolean,
      ok: boolean;

{ If request is to create or update an existing display, make sure the names do not
{ duplicate the names of one on the standard displays. (INDEX > 0 on search).
{ Return WARNING if duplicate name - however, create/update the display.

    status.normal := TRUE;
    delete_dd_p := NIL;
    IF (request_code = ofc$adrc_create) OR (request_code = ofc$adrc_change) THEN
      ofp$search_for_display_name (callers_dd_p^.header.display_name_abbrev, index);
      IF index > 0 THEN
        osp$set_status_abnormal ('OF', ofe$duplicates_hard_coded_name,
              callers_dd_p^.header.display_name_abbrev, status);
      IFEND;
      ofp$search_for_display_name (callers_dd_p^.header.display_name, index);
      IF index > 0 THEN
        osp$set_status_abnormal ('OF', ofe$duplicates_hard_coded_name, callers_dd_p^.header.display_name,
              status);
      IFEND;
      ALLOCATE dd_p: [1 .. field_count] IN osv$task_shared_heap^;
      i#move (callers_dd_p, dd_p, #SIZE (dd_p^));
      dd_p^.header.next_description_p := NIL;
      dd_p^.header.incremental_data_p := NIL;
      dd_p^.header.system_line_info.initialized := FALSE;
      dd_p^.header.field_count := field_count;
      WHILE (dd_p^.header.field_count > 1) AND (dd_p^.fields [dd_p^.header.field_count].field_id =
            ofc$fi_fill) AND (dd_p^.fields [dd_p^.header.field_count].field_title = ' ') DO
        dd_p^.header.field_count := dd_p^.header.field_count - 1;
      WHILEND;
      FOR index := 1 TO dd_p^.header.field_count DO
        dd_p^.fields [index].pack.width := dd_p^.fields [index].width;
        dd_p^.fields [index].pack.scale := dd_p^.fields [index].scale;
        dd_p^.fields [index].pack.field_id := dd_p^.fields [index].field_id;
        dd_p^.fields [index].pack.incremental := dd_p^.fields [index].incremental;
        dd_p^.fields [index].pack.field_overflow_action := dd_p^.fields [index].field_overflow_action;
        dd_p^.fields [index].pack.non_selection_action := dd_p^.fields [index].non_selection_action;
        dd_p^.fields [index].pack.field_selection := dd_p^.fields [index].field_selection;
      FOREND;
    IFEND;

    osp$set_job_signature_lock (display_lock);

    search_for_display_description (callers_dd_p^.header.display_name_abbrev, abbrev_dd_pp, abbrev_ud_pp);
    search_for_display_description (callers_dd_p^.header.display_name, dd_pp, ud_pp);
    ok := dd_pp^ <> NIL;
    unit_statistic_display := ud_pp^ <> NIL;

    IF NOT ok THEN
      IF unit_statistic_display THEN
        osp$set_status_abnormal ('OF', ofe$alternate_display_exists, callers_dd_p^.header.display_name,
              status);
        osp$append_status_parameter (osc$status_parameter_delimiter, 'Unit Statistic', status);
      ELSE
        osp$set_status_abnormal ('OF', ofe$unknown_display, callers_dd_p^.header.display_name, status);
      IFEND;
    IFEND;

    CASE request_code OF
    = ofc$adrc_get =
      IF ok THEN
        i#move (dd_pp^, callers_dd_p, #SIZE (dd_pp^^));
        field_count := UPPERBOUND (dd_pp^^.fields);
      IFEND;
    = ofc$adrc_create =
      IF ok OR (abbrev_dd_pp^ <> NIL) THEN
        osp$set_status_abnormal ('OF', ofe$display_already_exists, dd_p^.header.display_name, status);
        delete_dd_p := dd_p;
      ELSEIF unit_statistic_display THEN
        delete_dd_p := dd_p;
      ELSE
        dd_pp^ := dd_p;
        IF status.condition = ofe$unknown_display THEN
          status.normal := TRUE;
        IFEND;
      IFEND;
      ofv$displays_initialized := TRUE;
    = ofc$adrc_change =
      IF ok AND ((abbrev_dd_pp^ = NIL) OR (dd_pp = abbrev_dd_pp)) THEN
        delete_dd_p := dd_pp^;
        dd_p^.header.next_description_p := dd_pp^^.header.next_description_p;
        dd_pp^ := dd_p;
      ELSE
        delete_dd_p := dd_p;
      IFEND;
    = ofc$adrc_delete =
      IF ok THEN
        delete_dd_p := dd_pp^;
        dd_pp^ := dd_pp^^.header.next_description_p;
      IFEND;
    ELSE
    CASEND;

    osp$clear_job_signature_lock (display_lock);

    IF delete_dd_p <> NIL THEN
      IF delete_dd_p^.header.incremental_data_p <> NIL THEN
        FREE delete_dd_p^.header.incremental_data_p IN osv$task_shared_heap^;
      IFEND;
      FREE delete_dd_p IN osv$task_shared_heap^;
    IFEND;

  PROCEND ofp$access_display_description;

?? OLDTITLE, NEWTITLE := 'ofp$access_ms_display_infos', EJECT ??

  PROCEDURE [XDCL, #GATE] ofp$access_ms_display_infos
    (    request_code: oft$access_display_request_code;
     VAR work_area_p: ^clt$work_area;
     VAR mass_storage_display_infos: oft$mass_storage_display_infos;
     VAR status: ost$status);

    VAR
      screen: oft$mass_storage_display_screen;

?? NEWTITLE := 'p$build_sorted_vsn_unit_list', EJECT ??

    PROCEDURE p$build_sorted_vsn_unit_list
      (VAR entries_p: ^oft$msdi_sort_option_entries;
       VAR work_area_p: ^clt$work_area;
       VAR status: ost$status);

      VAR
        avt_entry_count: integer,
        avt_index: dmt$active_volume_table_index,
        local_entries_p: ^oft$msdi_sort_option_entries;

      status.normal := TRUE;
      entries_p := NIL;
      avt_entry_count := 0;

      IF work_area_p = NIL THEN
        osp$set_status_abnormal ('CL', cle$work_area_overflow, 'OFP$ACCESS_MS_DISPLAY_INFOS', status);
        RETURN; {----->
      IFEND;

{Count Units
      FOR avt_index := LOWERBOUND (dmv$active_volume_table.table_p^)
            TO UPPERBOUND (dmv$active_volume_table.table_p^) DO
        IF NOT dmv$active_volume_table.table_p^ [avt_index].entry_available THEN
          avt_entry_count := avt_entry_count + 1;
        IFEND;
      FOREND;

{Fillin Units
      NEXT local_entries_p: [1 .. avt_entry_count] IN work_area_p;
      IF local_entries_p = NIL THEN
        osp$set_status_abnormal ('CL', cle$work_area_overflow, 'OFP$ACCESS_MS_DISPLAY_INFOS', status);
        RETURN; {----->
      IFEND;

      avt_entry_count := 0;
      FOR avt_index := LOWERBOUND (dmv$active_volume_table.table_p^)
            TO UPPERBOUND (dmv$active_volume_table.table_p^) DO
        IF NOT dmv$active_volume_table.table_p^ [avt_index].entry_available THEN
          avt_entry_count := avt_entry_count + 1;
          local_entries_p^ [avt_entry_count].vsn := dmv$active_volume_table.table_p^ [avt_index].mass_storage.
                recorded_vsn;
          local_entries_p^ [avt_entry_count].avt_index := avt_index;
        IFEND;
      FOREND;

      p$sort_entries (local_entries_p^);
      ALLOCATE entries_p: [1 .. avt_entry_count] IN osv$task_shared_heap^;
      entries_p^ := local_entries_p^;

    PROCEND p$build_sorted_vsn_unit_list;
?? OLDTITLE ??
?? NEWTITLE := 'p$build_user_defined_unit_list', EJECT ??

    PROCEDURE p$build_user_defined_unit_list
      (    source_entries_p: ^oft$msdi_sort_option_entries;
       VAR validated_entries_p: ^oft$msdi_sort_option_entries;
       VAR work_area_p: ^clt$work_area;
       VAR status: ost$status);

      VAR
        avt_entries_specified_p: ^array [ * ] of boolean,
        avt_index: dmt$active_volume_table_index,
        found: boolean,
        i: integer,
        local_entries_p: ^oft$msdi_sort_option_entries;

      status.normal := TRUE;
      validated_entries_p := NIL;
      IF source_entries_p = NIL THEN
        RETURN; {----->
      IFEND;

      IF work_area_p = NIL THEN
        osp$set_status_abnormal ('CL', cle$work_area_overflow, 'OFP$ACCESS_MS_DISPLAY_INFOS', status);
        RETURN; {----->
      IFEND;

      NEXT avt_entries_specified_p: [LOWERBOUND (dmv$active_volume_table.
            table_p^) .. UPPERBOUND (dmv$active_volume_table.table_p^)] IN work_area_p;
      IF avt_entries_specified_p = NIL THEN
        osp$set_status_abnormal ('CL', cle$work_area_overflow, 'OFP$ACCESS_MS_DISPLAY_INFOS', status);
        RETURN; {----->
      IFEND;

      FOR i := LOWERBOUND (avt_entries_specified_p^) TO UPPERBOUND (avt_entries_specified_p^) DO
        avt_entries_specified_p^ [i] := FALSE;
      FOREND;

      NEXT local_entries_p: [1 .. UPPERBOUND (source_entries_p^)] IN work_area_p;
      IF local_entries_p = NIL THEN
        osp$set_status_abnormal ('CL', cle$work_area_overflow, 'OFP$ACCESS_MS_DISPLAY_INFOS', status);
        RETURN; {----->
      IFEND;

      FOR i := 1 TO UPPERBOUND (source_entries_p^) DO
        dmp$search_avt_by_rvsn (source_entries_p^ [i].vsn, avt_index, found);
        IF NOT found THEN
          osp$set_status_abnormal ('OF', ofe$vsn_not_found, source_entries_p^ [i].vsn, status);
          RETURN; {----->

        ELSEIF avt_entries_specified_p^ [avt_index] THEN
          osp$set_status_abnormal ('OF', ofe$duplicate_vsn, source_entries_p^ [i].vsn, status);
          RETURN; {----->

        ELSE
          local_entries_p^ [i].vsn := source_entries_p^ [i].vsn;
          local_entries_p^ [i].avt_index := avt_index;
          avt_entries_specified_p^ [avt_index] := TRUE;
        IFEND;
      FOREND;

      ALLOCATE validated_entries_p: [1 .. UPPERBOUND (source_entries_p^)] IN osv$task_shared_heap^;
      validated_entries_p^ := local_entries_p^;

    PROCEND p$build_user_defined_unit_list;
?? OLDTITLE ??
?? NEWTITLE := 'P$SORT_ENTRIES', EJECT ??

    PROCEDURE [INLINE] p$sort_entries
      (VAR entries: oft$msdi_sort_option_entries);

      VAR
        current: integer,
        gap: integer,
        start: integer,
        swap: oft$msdi_sort_option_entry;

      gap := UPPERBOUND (entries);
      WHILE gap > 1 DO
        gap := 2 * (gap DIV 4) + 1;
        FOR start := 1 TO UPPERBOUND (entries) - gap DO
          current := start;
          WHILE (current > 0) AND (entries [current].vsn > entries [current + gap].vsn) DO
            swap := entries [current];
            entries [current] := entries [current + gap];
            entries [current + gap] := swap;
            current := current - gap;
          WHILEND;
        FOREND;
      WHILEND;

    PROCEND p$sort_entries;
?? OLDTITLE ??
?? EJECT ??

    status.normal := TRUE;
    osp$set_job_signature_lock (display_lock);

  /process_request/
    BEGIN
      CASE request_code OF
      = ofc$adrc_change =
        FOR screen := LOWERBOUND (ofv$mass_storage_display_infos)
              TO UPPERBOUND (ofv$mass_storage_display_infos) DO

{DISPLAY_OPTIONS
          IF mass_storage_display_infos [screen].display_options.default THEN
            ofv$mass_storage_display_infos [screen].display_options :=
                  v$default_ms_display_infos [screen].display_options;
          ELSE
            ofv$mass_storage_display_infos [screen].display_options :=
                  mass_storage_display_infos [screen].display_options;
          IFEND;

{SORT_OPTION
          IF NOT mass_storage_display_infos [screen].sort_option.saved_sort_option THEN
            IF (ofv$mass_storage_display_infos [screen].sort_option.key = ofc$msdi_user_defined)
{         } AND (ofv$mass_storage_display_infos [screen].sort_option.entries_p <> NIL) THEN

              FREE ofv$mass_storage_display_infos [screen].sort_option.entries_p IN osv$task_shared_heap^;
              ofv$mass_storage_display_infos [screen].sort_option.entries_p := NIL;
            IFEND;

            CASE mass_storage_display_infos [screen].sort_option.key OF
            = ofc$msdi_avt =
              ofv$mass_storage_display_infos [screen].sort_option.key := ofc$msdi_avt;

            = ofc$msdi_lut =
              ofv$mass_storage_display_infos [screen].sort_option.key := ofc$msdi_lut;

            = ofc$msdi_vsn =
              ofv$mass_storage_display_infos [screen].sort_option.key := ofc$msdi_user_defined;
              ofv$mass_storage_display_infos [screen].sort_option.sorted_by_vsn := TRUE;
              ofv$mass_storage_display_infos [screen].sort_option.display_omitted_units := TRUE;
              p$build_sorted_vsn_unit_list (ofv$mass_storage_display_infos [screen].sort_option.entries_p,
                    work_area_p, status);
              IF NOT status.normal THEN
                ofv$mass_storage_display_infos [screen].sort_option.key := ofc$msdi_avt;
                EXIT /process_request/; {----->
              IFEND;

            = ofc$msdi_user_defined =
              ofv$mass_storage_display_infos [screen].sort_option.key := ofc$msdi_user_defined;
              ofv$mass_storage_display_infos [screen].sort_option.sorted_by_vsn := FALSE;
              ofv$mass_storage_display_infos [screen].sort_option.display_omitted_units :=
                    mass_storage_display_infos [screen].sort_option.display_omitted_units;
              p$build_user_defined_unit_list (mass_storage_display_infos [screen].sort_option.entries_p,
                    ofv$mass_storage_display_infos [screen].sort_option.entries_p, work_area_p, status);
              IF NOT status.normal THEN
                ofv$mass_storage_display_infos [screen].sort_option.key := ofc$msdi_avt;
                EXIT /process_request/; {----->
              IFEND;
            ELSE
              ;
            CASEND;
          IFEND;

{SPACE_QUANTITY
          IF mass_storage_display_infos [screen].space_quantity = ofc$msdi_default_space_quantity THEN
            ofv$mass_storage_display_infos [screen].space_quantity :=
                  v$default_ms_display_infos [screen].space_quantity;
          ELSE
            ofv$mass_storage_display_infos [screen].space_quantity :=
                  mass_storage_display_infos [screen].space_quantity;
          IFEND;

{SPACE_SELECTION
          IF mass_storage_display_infos [screen].space_selection = ofc$msdi_default_space_select THEN
            ofv$mass_storage_display_infos [screen].space_selection :=
                  v$default_ms_display_infos [screen].space_selection;
          ELSE
            ofv$mass_storage_display_infos [screen].space_selection :=
                  mass_storage_display_infos [screen].space_selection;
          IFEND;
        FOREND;

      = ofc$adrc_get =
        mass_storage_display_infos := ofv$mass_storage_display_infos;
        FOR screen := LOWERBOUND (ofv$mass_storage_display_infos)
              TO UPPERBOUND (ofv$mass_storage_display_infos) DO
          IF ofv$mass_storage_display_infos [screen].sort_option.key = ofc$msdi_user_defined THEN
            IF ofv$mass_storage_display_infos [screen].sort_option.sorted_by_vsn THEN

              mass_storage_display_infos [screen].sort_option.entries_p := NIL;
              mass_storage_display_infos [screen].sort_option.key := ofc$msdi_vsn;

            ELSEIF ofv$mass_storage_display_infos [screen].sort_option.entries_p <> NIL THEN
              IF work_area_p = NIL THEN
                osp$set_status_abnormal ('CL', cle$work_area_overflow, 'OFP$ACCESS_MS_DISPLAY_INFOS', status);
                EXIT /process_request/; {----->
              IFEND;

              NEXT mass_storage_display_infos [screen].sort_option.entries_p:
                    [1 .. UPPERBOUND (ofv$mass_storage_display_infos [screen].sort_option.entries_p^)] IN
                    work_area_p;

              IF mass_storage_display_infos [screen].sort_option.entries_p = NIL THEN
                osp$set_status_abnormal ('CL', cle$work_area_overflow, 'OFP$ACCESS_MS_DISPLAY_INFOS', status);
                EXIT /process_request/; {----->
              IFEND;

              mass_storage_display_infos [screen].sort_option.entries_p^ :=
                    ofv$mass_storage_display_infos [screen].sort_option.entries_p^;
            IFEND;
          IFEND;
        FOREND;

      = ofc$adrc_reset =
        FOR screen := LOWERBOUND (ofv$mass_storage_display_infos)
              TO UPPERBOUND (ofv$mass_storage_display_infos) DO
          IF (ofv$mass_storage_display_infos [screen].sort_option.key = ofc$msdi_user_defined)
{       } AND (ofv$mass_storage_display_infos [screen].sort_option.entries_p <> NIL) THEN

            FREE ofv$mass_storage_display_infos [screen].sort_option.entries_p IN osv$task_shared_heap^;
          IFEND;
        FOREND;
        ofv$mass_storage_display_infos := v$default_ms_display_infos;
      ELSE
      CASEND;
    END /process_request/;

    osp$clear_job_signature_lock (display_lock);

  PROCEND ofp$access_ms_display_infos;

?? OLDTITLE, NEWTITLE := 'ofp$access_unit_stat_descript', EJECT ??

  PROCEDURE [XDCL, #GATE] ofp$access_unit_stat_descript
    (    request_code: oft$access_display_request_code;
         callers_ud_p: ^oft$unit_stat_display_desc;
     VAR field_count: oft$field_count;
     VAR status: ost$status);

    VAR
      abbrev_dd_pp: ^oft$display_descriptions_p,
      abbrev_ud_pp: ^^oft$unit_stat_display_desc,
      dd_pp: ^oft$display_descriptions_p,
      delete_ud_p: ^oft$unit_stat_display_desc,
      display_description_display: boolean,
      incremental_field_counts: integer,
      index: integer,
      ok: boolean,
      selector_incremental_selection: boolean,
      selector_sources: oft$us_field_sources,
      ud_p: ^oft$unit_stat_display_desc,
      ud_pp: ^^oft$unit_stat_display_desc;

{ If request is to create or update an existing display, make sure the names do not
{ duplicate the names of one on the standard displays. (INDEX > 0 on search).
{ Return WARNING if duplicate name - however, create/update the display.

    status.normal := TRUE;
    delete_ud_p := NIL;
    IF (request_code = ofc$adrc_create) OR (request_code = ofc$adrc_change) THEN
      ofp$search_for_display_name (callers_ud_p^.header.display_name_abbrev, index);
      IF index > 0 THEN
        osp$set_status_abnormal ('OF', ofe$duplicates_hard_coded_name,
              callers_ud_p^.header.display_name_abbrev, status);
      IFEND;
      ofp$search_for_display_name (callers_ud_p^.header.display_name, index);
      IF index > 0 THEN
        osp$set_status_abnormal ('OF', ofe$duplicates_hard_coded_name, callers_ud_p^.header.display_name,
              status);
      IFEND;
      ALLOCATE ud_p: [1 .. field_count] IN osv$task_shared_heap^;
      i#move (callers_ud_p, ud_p, #SIZE (ud_p^));
      ud_p^.header.next_description_p := NIL;
      ud_p^.header.incremental_data_p := NIL;
      ud_p^.header.system_line_info.initialized := FALSE;
      ud_p^.header.field_count := field_count;
      ud_p^.header.incremental_data_last_reset := 0;
      ud_p^.header.field_sources := $oft$us_field_sources [];

{Verify/update field count
      WHILE (ud_p^.header.field_count > 1) AND (ud_p^.fields [ud_p^.header.field_count].field_id =
            ofc$us_fill) AND (ud_p^.fields [ud_p^.header.field_count].field_title = ' ') DO
        ud_p^.header.field_count := ud_p^.header.field_count - 1;
      WHILEND;

{Ensure that we do not maintain the incremental data when there are no incremental fields
{and update field_source.
      incremental_field_counts := 0;
      FOR index := 1 TO ud_p^.header.field_count DO
        ud_p^.header.field_sources := ud_p^.header.field_sources +
              v$field_source [ud_p^.fields [index].field_id];

        IF ud_p^.fields [index].numeric_selection_mode <> ofc$nsm_total THEN
          incremental_field_counts := incremental_field_counts + 1;
        IFEND;
      FOREND;

      p$get_statistic_select_attrib (ud_p^.header.unit_selection, selector_incremental_selection,
            selector_sources);

      ud_p^.header.incremental_data_required := (incremental_field_counts > 0) OR
            selector_incremental_selection;
      ud_p^.header.field_sources := ud_p^.header.field_sources + selector_sources;
    IFEND;

    osp$set_job_signature_lock (display_lock);

    search_for_display_description (callers_ud_p^.header.display_name_abbrev, abbrev_dd_pp, abbrev_ud_pp);
    search_for_display_description (callers_ud_p^.header.display_name, dd_pp, ud_pp);
    ok := ud_pp^ <> NIL;
    display_description_display := dd_pp^ <> NIL;

    IF NOT ok THEN
      IF display_description_display THEN
        osp$set_status_abnormal ('OF', ofe$alternate_display_exists, callers_ud_p^.header.display_name,
              status);
        osp$append_status_parameter (osc$status_parameter_delimiter, 'Unit Statistic', status);
      ELSE
        osp$set_status_abnormal ('OF', ofe$unknown_display, callers_ud_p^.header.display_name, status);
      IFEND;
    IFEND;

    CASE request_code OF
    = ofc$adrc_get =
      IF ok THEN
        i#move (ud_pp^, callers_ud_p, #SIZE (ud_pp^^));
        field_count := UPPERBOUND (ud_pp^^.fields);
      IFEND;
    = ofc$adrc_create =
      IF ok OR (abbrev_ud_pp^ <> NIL) THEN
        osp$set_status_abnormal ('OF', ofe$display_already_exists, ud_p^.header.display_name, status);
        delete_ud_p := ud_p;
      ELSEIF display_description_display THEN
        delete_ud_p := ud_p;
      ELSE
        ud_pp^ := ud_p;
        IF status.condition = ofe$unknown_display THEN
          status.normal := TRUE;
        IFEND;
      IFEND;
      ofv$displays_initialized := TRUE;
    = ofc$adrc_change =
      IF ok AND ((abbrev_ud_pp^ = NIL) OR (ud_pp = abbrev_ud_pp)) THEN
        delete_ud_p := ud_pp^;
        ud_p^.header.next_description_p := ud_pp^^.header.next_description_p;
        ud_pp^ := ud_p;
      ELSE
        delete_ud_p := ud_p;
      IFEND;
    = ofc$adrc_delete =
      IF ok THEN
        delete_ud_p := ud_pp^;
        ud_pp^ := ud_pp^^.header.next_description_p;
      IFEND;
    ELSE
    CASEND;

    osp$clear_job_signature_lock (display_lock);

    IF delete_ud_p <> NIL THEN
      IF delete_ud_p^.header.incremental_data_p <> NIL THEN
        FREE delete_ud_p^.header.incremental_data_p IN osv$task_shared_heap^;
      IFEND;
      FREE delete_ud_p IN osv$task_shared_heap^;
    IFEND;

  PROCEND ofp$access_unit_stat_descript;

?? OLDTITLE, NEWTITLE := 'ofp$display', EJECT ??

  PROCEDURE [XDCL, #GATE] ofp$display
    (    wid: dpt$window_id;
         display_name: ost$name;
         file_name: amt$local_file_name;
         initial_call: boolean;
     VAR status: ost$status);


    VAR
      ajlo: integer, {must be integer}
      clock: ost$free_running_clock,
      jobs_per_line_left: integer,
      job_selection: oft$job_selection,
      column_index: integer,
      dd_p: oft$max_display_descriptions_p,
      dd_pp: ^oft$display_descriptions_p,
      ud_p: ^oft$max_unit_stat_display_desc,
      ud_pp: ^^oft$unit_stat_display_desc,
      display_control: clt$display_control,
      ending_line: integer,
      entry_in_use: boolean,
      i: integer,
      ijl_bi: integer, {must be integer}
      ijl_bn: jmt$ijl_block_number,
      ijle_index_p: ^array [jmt$ijl_block_index] of jmt$initiated_job_list_entry,
      ijle_p: ^jmt$initiated_job_list_entry,
      ijl_number: integer,
      inc_p: ^oft$save_incremental_data,
      line_has_data: boolean,
      lines_to_write: integer,
      lines_written: integer,
      max_ijl_block_in_use: jmt$ijl_block_number,
      max_ijl_number: 0 .. jmc$max_ijl_entries + 1,
      s: string (255),
      skip_lines: integer,
      starting_line: integer;

    { PURPOSE:
    {  This procedure  is a condition handler established to clear the display_
    {  lock if the display manager aborts.

    PROCEDURE clear_display_lock
      (    condition: pmt$condition;
           cond_desc: ^pmt$condition_information;
           save: ^ost$stack_frame_save_area;
       VAR status: ost$status);

      VAR
        local_status: ost$status,
        lock_status: ost$signature_lock_status;

      IF condition.selector = pmc$block_exit_processing THEN
        {This task is terminating so clear display lock}

        osp$initialize_signature_lock (display_lock, local_status);
      ELSE
        pmp$continue_to_cause (pmc$execute_standard_procedure, local_status);
      IFEND;
    PROCEND clear_display_lock;



    status.normal := TRUE;
    osp$establish_condition_handler (^clear_display_lock, TRUE);

    osp$set_job_signature_lock (display_lock);

    search_for_display_description (display_name, dd_pp, ud_pp);
    IF (dd_pp^ = NIL) AND (ud_pp^ = NIL) THEN
      osp$clear_job_signature_lock (display_lock);
      osp$set_status_abnormal ('  ', ofe$unknown_display, display_name, status);
      RETURN; {----->
    ELSEIF (dd_pp^ = NIL) AND (ud_pp^ <> NIL) THEN
      ud_p := #ADDRESS (1, #SEGMENT (ud_pp^), #OFFSET (ud_pp^));
      p$display_unit_statistic (wid, ud_p, file_name, initial_call, status);
      osp$clear_job_signature_lock (display_lock);
      RETURN; {----->
    IFEND;

{ Form pointer to max display description. This is cheating  but is "safe" and improves
{ performance since fixed pointers are used instead of adaptable pointers.

    dd_p := #ADDRESS (1, #SEGMENT (dd_pp^), #OFFSET (dd_pp^));

    inc_p := dd_p^.header.incremental_data_p;

    max_ijl_block_in_use := jmv$ijl_p.max_block_in_use;
    max_ijl_number := (max_ijl_block_in_use + 1) * jmc$max_ijl_index_count;
    IF (inc_p = NIL) OR (UPPERBOUND (inc_p^) < max_ijl_number) THEN
      ALLOCATE dd_p^.header.incremental_data_p: [0 .. max_ijl_number] IN osv$task_shared_heap^;
      pmp$zero_out_table (#LOC (dd_p^.header.incremental_data_p^), #SIZE (dd_p^.header.incremental_data_p^));
      IF inc_p <> NIL THEN
        i#move (inc_p, dd_p^.header.incremental_data_p, #SIZE (inc_p^));
        FREE inc_p IN osv$task_shared_heap^;
      IFEND;
      inc_p := dd_p^.header.incremental_data_p;
    IFEND;

    IF initial_call THEN
      IF wid <> 0 THEN
        ?IF NOT debug THEN
          ofp$open_display (file_name, wid, dpc$wc_sharing, dpc$wk_table, dd_p^.header.title (2, 80),
                display_control, status);
        ?IFEND;
      ELSE
        ofp$open_display (file_name, wid, dpc$wc_sharing, dpc$wk_table, dd_p^.header.title (2, 80),
              display_control, status);
      IFEND;
    IFEND;

{ Determine starting and ending IJLO/AJLO for display. If output is to a file, all lines are
{ displayed. If output is to the console (wid>0), only the current page is generated.

    IF wid <> 0 THEN
      ?IF NOT debug THEN
        dpp$get_starting_line (wid, starting_line, status);
      ?ELSE
        starting_line := 1;
      ?IFEND;
      skip_lines := starting_line - 1;
      lines_to_write := 20; {This is current max window size.}
    ELSE
      skip_lines := 0;
      lines_to_write := 65535; {Max display size.
    IFEND;

    IF dd_p^.header.display_system_line THEN
      ofp$build_system_line (dd_p^.header.system_line_info, s (1, 80));
      IF wid <> 0 THEN
        ?IF debug THEN
          zdpp$put_next_line (wid, s (1, 80), status);
        ?ELSE
          dpp$put_next_line (wid, s (1, 80), status);
        ?IFEND;
      ELSE
        clp$put_display (display_control, s (1, 80), clc$trim, status);
        s (1) := ' ';
        clp$put_display (display_control, s (1, 1), clc$trim, status);
      IFEND;
      lines_written := 1;
    ELSE
      lines_written := 0;
      IF wid = 0 THEN
        s (1) := ' ';
        clp$put_display (display_control, s (1, 1), clc$trim, status);
      IFEND;
    IFEND;

    ajlo := LOWERVALUE (jmt$ajl_ordinal) - 1;
    ijl_bn := 0;
    ijl_bi := -1;
    jobs_per_line_left := dd_p^.header.jobs_per_line;
    column_index := 1;
    ijl_number := -1;
    line_has_data := FALSE;
    s := '';
    job_selection := dd_p^.header.job_selection;

  /build_display/
    WHILE lines_written < lines_to_write DO

      IF job_selection = ofc$js_active THEN
        ajlo := ajlo + 1;
        IF ajlo > jmv$max_ajl_ordinal_in_use THEN
          EXIT /build_display/; {----->
        IFEND;
        ijle_p := jmv$ajl_p^ [ajlo].ijle_p;
        ijl_number := jmv$ajl_p^ [ajlo].ijl_ordinal.block_number * jmc$max_ijl_index_count +
              jmv$ajl_p^ [ajlo].ijl_ordinal.block_index;
        entry_in_use := (jmv$ajl_p^ [ajlo].in_use > 0) AND (ijl_number <= max_ijl_number) AND (ijle_p <> NIL);
      ELSE
        ijl_bi := ijl_bi + 1;
        ijl_number := ijl_number + 1;
        ?IF debug THEN
          IF wid <> 0 THEN
            ijl_bi := 0;
            ijl_number := 0;
          IFEND;
        ?IFEND;
        IF ijl_bi > UPPERVALUE (jmt$ijl_block_index) THEN
          ijl_bi := LOWERVALUE (jmt$ijl_block_index);
          ijl_bn := ijl_bn + 1;
          IF ijl_bn > max_ijl_block_in_use THEN
            EXIT /build_display/; {----->
          IFEND;
        IFEND;
        entry_in_use := FALSE;
        IF jmv$ijl_p.block_p^ [ijl_bn].index_p <> NIL THEN
          ijle_index_p := jmv$ijl_p.block_p^ [ijl_bn].index_p;
          IF ijle_index_p <> NIL THEN
            ijle_p := ^ijle_index_p^ [ijl_bi];
            entry_in_use := ijle_p^.entry_status <> jmc$ies_entry_free;
          IFEND;
        IFEND;
      IFEND;

      IF entry_in_use AND (skip_lines = 0) THEN
        build_line (ijle_p, ijl_number, dd_p, ^inc_p^ [ijl_number], ^s (column_index, 132));
      IFEND;

      IF entry_in_use OR dd_p^.header.display_blank_lines THEN
        column_index := column_index + dd_p^.header.column_width;
        jobs_per_line_left := jobs_per_line_left - 1;
        line_has_data := TRUE;
      IFEND;

      IF jobs_per_line_left = 0 THEN
        IF skip_lines > 0 THEN
          skip_lines := skip_lines - 1;
        ELSE
          lines_written := lines_written + 1;
          IF line_has_data OR (wid <> 0) THEN
            IF wid <> 0 THEN
              ?IF debug THEN
                zdpp$put_next_line (wid, s (1, 80), status);
              ?ELSE
                dpp$put_next_line (wid, s (1, 80), status);
              ?IFEND;
            ELSE
              clp$put_display (display_control, s (1, column_index - 2), clc$trim, status);
            IFEND;
          IFEND;
        IFEND;
        line_has_data := FALSE;
        column_index := 1;
        jobs_per_line_left := dd_p^.header.jobs_per_line;
        s := '';
      IFEND;

    WHILEND /build_display/;

    IF line_has_data THEN
      IF wid <> 0 THEN
        ?IF debug THEN
          zdpp$put_next_line (wid, s (1, 80), status);
        ?ELSE
          dpp$put_next_line (wid, s (1, 80), status);
        ?IFEND;
      ELSE
        clp$put_display (display_control, s (1, column_index - 1), clc$trim, status);
      IFEND;
      lines_written := lines_written + 1;
    IFEND;

    IF wid = 0 THEN
      clp$close_display (display_control, status);
    ELSE
      s := ' ';
      FOR i := lines_written + 1 TO lines_to_write DO
        ?IF debug THEN
          zdpp$put_next_line (wid, s (1, 80), status);
        ?ELSE
          dpp$put_next_line (wid, s (1, 80), status);
        ?IFEND;
      FOREND;
    IFEND;

    osp$clear_job_signature_lock (display_lock);

  PROCEND ofp$display;
?? OLDTITLE ??
?? NEWTITLE := 'ofp$display_ved_field_data', EJECT ??

  PROCEDURE [XDCL, #GATE] ofp$display_ved_field_data
    (    display_name: ost$name;
         field_display_selection: oft$field_data_display_select;
         update_incremental_data: boolean;
     VAR display_control: clt$display_control;
     VAR status: ost$status);

    VAR
      dd_p: oft$max_display_descriptions_p,
      dd_pp: ^oft$display_descriptions_p,
      ud_p: ^oft$max_unit_stat_display_desc,
      ud_pp: ^^oft$unit_stat_display_desc;

?? NEWTITLE := 'CLEAR_DISPLAY_LOCK', EJECT ??

    { PURPOSE:
    {  This procedure  is a condition handler established to clear the display_
    {  lock if the display manager aborts.

    PROCEDURE clear_display_lock
      (    condition: pmt$condition;
           cond_desc: ^pmt$condition_information;
           save: ^ost$stack_frame_save_area;
       VAR status: ost$status);

      VAR
        local_status: ost$status,
        lock_status: ost$signature_lock_status;

      IF condition.selector = pmc$block_exit_processing THEN
        {This task is terminating so clear display lock}

        osp$initialize_signature_lock (display_lock, local_status);
      ELSE
        pmp$continue_to_cause (pmc$execute_standard_procedure, local_status);
      IFEND;
    PROCEND clear_display_lock;
?? OLDTITLE ??
?? NEWTITLE := 'P$DISPLAY_DD_FIELD_DATA', EJECT ??


    PROCEDURE p$display_dd_field_data
      (VAR display_control: clt$display_control;
           field_display_selection: oft$field_data_display_select;
           update_incremental_data: boolean;
           dd_p: oft$max_display_descriptions_p;
       VAR status: ost$status);

      VAR
        ajlo: integer, {must be integer}
        job_selection: oft$job_selection,
        ijl_bi: integer, {must be integer}
        ijl_bn: jmt$ijl_block_number,
        ijle_p: ^jmt$initiated_job_list_entry,
        ijl_number: integer,
        inc_p: ^oft$save_incremental_data,
        max_ijl_block_in_use: jmt$ijl_block_number,
        max_ijl_number: 0 .. jmc$max_ijl_entries + 1;

?? NEWTITLE := 'P$PUT_ENTRY', EJECT ??

      PROCEDURE p$put_entry
        (    ijle_p: ^jmt$initiated_job_list_entry;
             ijl_number: integer;
             dd_p: oft$max_display_descriptions_p;
             ince_p: ^oft$save_incremental_data_entry);

        VAR
          clock: ost$free_running_clock,
          cp_time: integer,
          dde_p: ^oft$field_description,
          field: oft$packed_field_attributes,
          field_index: 1 .. ofc$max_display_width,
          incremental_ok: boolean,
          int_index: 0 .. ofc$max_incremental_fields + 1,
          n: integer,
          string_index: 1 .. ofc$max_display_width + 1,
          swap_status: oft$field_selection;

?? NEWTITLE := 'P$PUT_FIELD', EJECT ??

        PROCEDURE p$put_field
          (    field_id: oft$field_id;
               ijle_p: ^jmt$initiated_job_list_entry;
               ijl_number: integer;
               ince_p: ^oft$save_incremental_data_entry);

          VAR
            ch: char,
            ch2: string (2),
            int_index: 0 .. ofc$max_incremental_fields + 1,
            message_column,
            n: integer,
            s: string (132),
            swap_status: oft$field_selection;

          string_index := 1;
          int_index := 0;

          CASE field_id OF
          = ofc$fi_active_io_pages =
            n := ijle_p^.active_io_page_count;
          = ofc$fi_active_io_requests =
            n := ijle_p^.active_io_requests;
          = ofc$fi_ajl_ordinal =
            n := ijle_p^.ajl_ordinal;
            IF (n = jmc$null_ajl_ordinal) OR (ijle_p <> jmv$ajl_p^ [n].ijle_p) THEN
              field.scale := 0;
            IFEND;
          = ofc$fi_cp_time_increment =

{       n := ijle_p^.statistics.cp_time.time_spent_in_mtr_mode +
{             ijle_p^.statistics.cp_time.time_spent_in_job_mode -
{             ijle_p^.cp_time_last_dc_reset;

          = ofc$fi_cp_time_job =
            n := ijle_p^.statistics.cp_time.time_spent_in_job_mode;
          = ofc$fi_cp_time_monitor =
            n := ijle_p^.statistics.cp_time.time_spent_in_mtr_mode;
          = ofc$fi_cp_time_total =
            n := ijle_p^.statistics.cp_time.time_spent_in_mtr_mode +
                  ijle_p^.statistics.cp_time.time_spent_in_job_mode;
          = ofc$fi_dispatching_priority, ofc$fi_dispatching_priority_act =
            IF field.field_id = ofc$fi_dispatching_priority THEN
              n := ijle_p^.dispatching_control.dispatching_priority;
            ELSE
              n := ijle_p^.scheduling_dispatching_priority;
            IFEND;
            n := n - 1;
            s (string_index) := 'P';
            IF n >= 10 THEN
              s (string_index + 2) := $CHAR ((n MOD 10) + $INTEGER ('0'));
              n := n DIV 10;
            IFEND;
            s (string_index + 1) := $CHAR (n + $INTEGER ('0'));
          = ofc$fi_display_message =
            IF ijle_p^.display_message.display_message.size > 0 THEN
              n := 1;
              WHILE (ijle_p^.display_message.display_message.text (n) = ' ') AND
                    (n < ijle_p^.display_message.display_message.size) DO
                n := n + 1;
              WHILEND;
              s := ijle_p^.display_message.display_message.text
                    (n, ijle_p^.display_message.display_message.size - n + 1);
              FOR message_column := 1 TO (ijle_p^.display_message.display_message.size - n + 1) DO
                CASE s (message_column) OF
                = $CHAR (0) .. $CHAR (31), $CHAR (127) =
                  s (message_column) := '?';
                ELSE
                  ;
                CASEND;
              FOREND;
            IFEND;
          = ofc$fi_fill =
            s := dde_p^.field_title;
          = ofc$fi_guaranteed_service_rem =
            n := ijle_p^.job_scheduler_data.guaranteed_service_remaining;
            IF field.incremental THEN
              n := -n;
            IFEND;
          = ofc$fi_hung_task_in_job_flag =
            IF ijle_p^.hung_task_in_job THEN
              s (1) := '*';
            IFEND;
          = ofc$fi_ijl_ordinal =
            n := ijl_number;
          = ofc$fi_job_abort_disposition =
            ;
          = ofc$fi_job_class =
            jmp$idetermine_job_class_abbrev (ijle_p^.job_scheduler_data.job_class, s (1, 2));
          = ofc$fi_job_entry_status =
            IF ijle_p^.entry_status < jmc$ies_swapin_in_progress THEN
              ch := 'M';
            ELSEIF ijle_p^.entry_status = jmc$ies_swapin_in_progress THEN
              ch := 'I';
            ELSEIF ijle_p^.entry_status = jmc$ies_operator_force_out THEN
              ch := 'F';
            ELSE { entry_status = swapped }
              IF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_long_wait THEN
                ch := ' ';
              ELSEIF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_thrashing THEN
                ch := 'T';
              ELSEIF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_lower_priority THEN
                ch := 'P';
              ELSEIF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_idling_system_swapout THEN
                ch := 'L';
              ELSEIF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_idle_dispatching THEN
                ch := 'D';
              ELSE
                ch := 'U';
              IFEND;
            IFEND;
            s (1) := ch;
          = ofc$fi_job_status =
            IF ijle_p^.hung_task_in_job THEN
              ch2 := '*H';
            ELSEIF ijle_p^.job_damaged_during_recovery THEN
              ch2 := '*R';
            ELSEIF (ijle_p^.swap_status = jmc$iss_swapout_complete) OR
                  (ijle_p^.swap_status = jmc$iss_swapped_io_complete) OR
                  (ijle_p^.swap_status = jmc$iss_swapped_no_io) THEN
              ch2 := swap_reasons_conversion [ijle_p^.job_scheduler_data.swapout_reason];
            ELSE
              ch2 := jsv$swap_status_id_array [ijle_p^.swap_status];
            IFEND;
            s (1, 2) := ch2;
          = ofc$fi_job_recovery_disposition =
            ;
          = ofc$fi_job_mode =
            s (1, 2) := job_mode_conversion [ijle_p^.job_mode];
          = ofc$fi_job_priority =
            IF (ijle_p^.swap_status <= jmc$iss_swapped_no_io) OR
                  (ijle_p^.entry_status = jmc$ies_swapin_candidate) THEN
              n := ijle_p^.job_scheduler_data.priority;
            ELSE
              field.scale := 0;
            IFEND;
          = ofc$fi_job_swap_count =
            n := ijle_p^.job_scheduler_data.job_swap_counts.long_wait +
                  ijle_p^.job_scheduler_data.job_swap_counts.job_mode;
          = ofc$fi_last_think_time =
            n := ijle_p^.last_think_time;
            IF n = 0 THEN
              field.scale := 0;
            IFEND;
          = ofc$fi_memory_pages =
            n := ijle_p^.job_page_queue_list [mmc$pq_job_fixed].
                  count + ijle_p^.job_page_queue_list [mmc$pq_job_io_error].count +
                  ijle_p^.job_page_queue_list [mmc$pq_job_working_set].count;
          = ofc$fi_page_fault_count =
            n := ijle_p^.statistics.paging_statistics.page_fault_count;
          = ofc$fi_percent_cp_usage =
            cp_time := ijle_p^.statistics.cp_time.time_spent_in_job_mode +
                  ijle_p^.statistics.cp_time.time_spent_in_mtr_mode;
            field.incremental := FALSE;
            IF incremental_ok THEN
              n := ((cp_time - ince_p^.int [int_index]) * 100) DIV (clock - ince_p^.last_clock);
            ELSE
              field.scale := 0;
            IFEND;

            IF update_incremental_data THEN
              ince_p^.int [int_index] := cp_time;
            IFEND;

            int_index := int_index + 1;
          = ofc$fi_permanent_file_space =
            n := ijle_p^.statistics.perm_file_space;
          = ofc$fi_ps_pages_assigned =
            n := ijle_p^.statistics.paging_statistics.new_pages_assigned;
          = ofc$fi_ps_pages_from_server =
            n := ijle_p^.statistics.paging_statistics.pages_from_server;
          = ofc$fi_ps_pages_reclaimed =
            n := ijle_p^.statistics.paging_statistics.pages_reclaimed_from_queue;
          = ofc$fi_ps_page_in =
            n := ijle_p^.statistics.paging_statistics.page_in_count;
          = ofc$fi_ready_task_count =
            IF ijle_p^.statistics.tasks_not_in_long_wait = 0 THEN
              field.scale := 0;
            ELSE
              n := ijle_p^.statistics.ready_task_count;
            IFEND;
          = ofc$fi_service_accumulator =
            n := ijle_p^.job_scheduler_data.service_accumulator;
          = ofc$fi_service_class =
            jmp$idetermine_serv_class_abbre (ijle_p^.job_scheduler_data.service_class, s (1, 2));
          = ofc$fi_service_since_swap =
            n := ijle_p^.job_scheduler_data.service_accumulator_since_swap;
          = ofc$fi_ssn_full =
            s (string_index, jmc$system_supplied_name_size) := ijle_p^.system_supplied_name;
          = ofc$fi_ssn_long =
            s (string_index) := '$';
            s (string_index + 1, jmc$long_ssn_size - 1) := ijle_p^.system_supplied_name (12, 8);
          = ofc$fi_ssn_short =
            s (string_index) := '$';
            s (string_index + 1, jmc$short_ssn_size - 1) := ijle_p^.system_supplied_name (16, 4);
          = ofc$fi_swap_entry_status =
            IF ijle_p^.hung_task_in_job THEN
              ch2 := '*H';
            ELSEIF ijle_p^.job_damaged_during_recovery THEN
              ch2 := '*R';
            ELSE
              ch2 := entry_status_conversion [ijle_p^.entry_status];
            IFEND;
            s (1, 2) := ch2;
          = ofc$fi_swap_in_wait_time =
            IF ijle_p^.entry_status = jmc$ies_swapin_candidate THEN
              n := #FREE_RUNNING_CLOCK (0) - ijle_p^.job_scheduler_data.swapin_q_priority_timestamp;
            ELSE
              field.scale := 0;
            IFEND;
          = ofc$fi_swap_reason =
            s (1, 2) := swap_reasons_conversion [ijle_p^.job_scheduler_data.swapout_reason];
          = ofc$fi_swap_status =
            IF ijle_p^.hung_task_in_job THEN
              ch2 := '*H';
            ELSEIF ijle_p^.job_damaged_during_recovery THEN
              ch2 := '*R';
            ELSE
              ch2 := jsv$swap_status_id_array [ijle_p^.swap_status];
            IFEND;
            s (1, 2) := ch2;
          = ofc$fi_temporary_file_space =
            n := ijle_p^.statistics.temp_file_space;
          = ofc$fi_terminal_name =
            s := jmv$kjlx_p^ [ijle_p^.kjl_ordinal].terminal_name;
          = ofc$fi_think_time =
            IF ijle_p^.job_scheduler_data.swapout_reason = jmc$sr_long_wait THEN
              n := clock - (ijle_p^.estimated_ready_time - ijle_p^.last_think_time);
            ELSE
              field.scale := 0;
            IFEND;
          = ofc$fi_thrashing_flag =
            IF ijle_p^.maxws_aio_slowdown_display > 0 THEN
              s (1) := '*';
            IFEND;
          = ofc$fi_time_in_swap_state =
            n := clock - ijle_p^.swap_data.timestamp;
          = ofc$fi_user_job_name =
            s := ijle_p^.job_name;
          = ofc$fi_working_set_size =
            IF swap_status = ofc$fs_active THEN
              n := ijle_p^.job_page_queue_list [mmc$pq_job_working_set].count;
            ELSE
              n := ijle_p^.swap_data.swapped_job_page_count;
            IFEND;

{Include all cases - dont put an ELSE, degrades performance

          CASEND;


          IF field.incremental AND NOT incremental_ok THEN
            int_index := int_index + 1;
            IF update_incremental_data THEN
              ince_p^.int [int_index] := n;
            IFEND;
          ELSEIF field.scale > 0 THEN
            IF field.incremental THEN
              n := n - ince_p^.int [int_index];
              IF update_incremental_data THEN
                ince_p^.int [int_index] := ince_p^.int [int_index] + n;
              IFEND;
              int_index := int_index + 1;
            IFEND;
            IF n < 0 THEN
              n := 0;
            IFEND;
            IF field.scale > 1 THEN
              n := n DIV field.scale;
            IFEND;
{put_integer
          IFEND;

        PROCEND p$put_field;
?? OLDTITLE ??
?? EJECT ??
        string_index := 1;
        int_index := 0;
        incremental_ok := (ince_p <> NIL) AND (ince_p^.ssn_id = ijle_p^.system_supplied_name (12, 8));

        IF update_incremental_data AND (ince_p <> NIL) THEN
          ince_p^.ssn_id := ijle_p^.system_supplied_name (12, 8);
        IFEND;

        IF ijle_p^.swap_status <= jmc$iss_swapped_no_io THEN
          swap_status := ofc$fs_active;
        ELSE
          swap_status := ofc$fs_swapped;
        IFEND;
        clock := #FREE_RUNNING_CLOCK (0);

        IF field_display_selection = ofc$fdds_all_fields THEN
{ofc$fdds_all_fields
        ELSE

        /build_line_loop/
          FOR field_index := 1 TO dd_p^.header.field_count DO
            dde_p := ^dd_p^.fields [field_index];
            field := dde_p^.pack;
{ff
            CASE field_display_selection OF
            = ofc$fdds_selected_fields =
              IF (field.field_selection <> ofc$fs_unconditional) AND
                    (field.field_selection <> swap_status) THEN
                CYCLE /build_line_loop/; {----->
              IFEND;

            = ofc$fdds_incremental_fields, ofc$fdds_all_incremental_fields =
              IF field.incremental = FALSE THEN
                CYCLE /build_line_loop/; {----->
              IFEND;

            = ofc$fdds_all_non_inc_fields =
              IF field.incremental THEN
                CYCLE /build_line_loop/; {----->
              IFEND;

            ELSE {ofc$ofc$fdds_defined_fields
            CASEND;




            IF field.incremental AND NOT incremental_ok THEN
              int_index := int_index + 1;
              IF update_incremental_data THEN
                ince_p^.int [int_index] := n;
              IFEND;
            ELSEIF field.scale > 0 THEN
              IF field.incremental THEN
                n := n - ince_p^.int [int_index];
                IF update_incremental_data THEN
                  ince_p^.int [int_index] := ince_p^.int [int_index] + n;
                IFEND;
                int_index := int_index + 1;
              IFEND;
              IF n < 0 THEN
                n := 0;
              IFEND;
              IF field.scale > 1 THEN
                n := n DIV field.scale;
              IFEND;
            IFEND;

          FOREND /build_line_loop/;
        IFEND;

        IF update_incremental_data THEN
          ince_p^.last_clock := clock;
        IFEND;

      PROCEND p$put_entry;
?? OLDTITLE ??
?? EJECT ??

      inc_p := dd_p^.header.incremental_data_p;

      max_ijl_block_in_use := jmv$ijl_p.max_block_in_use;
      max_ijl_number := (max_ijl_block_in_use + 1) * jmc$max_ijl_index_count;

      IF update_incremental_data AND ((inc_p = NIL) OR (UPPERBOUND (inc_p^) < max_ijl_number)) THEN
        ALLOCATE dd_p^.header.incremental_data_p: [0 .. max_ijl_number] IN osv$task_shared_heap^;
        pmp$zero_out_table (#LOC (dd_p^.header.incremental_data_p^),
              #SIZE (dd_p^.header.incremental_data_p^));
        IF inc_p <> NIL THEN
          i#move (inc_p, dd_p^.header.incremental_data_p, #SIZE (inc_p^));
          FREE inc_p IN osv$task_shared_heap^;
        IFEND;
        inc_p := dd_p^.header.incremental_data_p;
      IFEND;

      job_selection := dd_p^.header.job_selection;

      IF job_selection = ofc$js_active THEN
        FOR ajlo := LOWERVALUE (jmt$ajl_ordinal) TO jmv$max_ajl_ordinal_in_use DO
          ijle_p := jmv$ajl_p^ [ajlo].ijle_p;
          ijl_number := jmv$ajl_p^ [ajlo].ijl_ordinal.block_number * jmc$max_ijl_index_count +
                jmv$ajl_p^ [ajlo].ijl_ordinal.block_index;
          IF (jmv$ajl_p^ [ajlo].in_use > 0) AND (ijl_number <= max_ijl_number) AND (ijle_p <> NIL) THEN
            IF inc_p = NIL THEN
              p$put_entry (ijle_p, ijl_number, dd_p, NIL);
            ELSE
              p$put_entry (ijle_p, ijl_number, dd_p, ^inc_p^ [ijl_number]);
            IFEND;
          IFEND;
        FOREND;
      ELSE
        ijl_number := -1;

        FOR ijl_bn := LOWERBOUND (jmv$ijl_p.block_p^) TO max_ijl_block_in_use DO
          IF (jmv$ijl_p.block_p^ [ijl_bn].index_p <> NIL) THEN
            FOR ijl_bi := LOWERVALUE (jmt$ijl_block_index) TO UPPERVALUE (jmt$ijl_block_index) DO
              ijl_number := ijl_number + 1;
              ijle_p := ^jmv$ijl_p.block_p^ [ijl_bn].index_p^ [ijl_bi];
              IF ijle_p^.entry_status <> jmc$ies_entry_free THEN
                IF inc_p = NIL THEN
                  p$put_entry (ijle_p, ijl_number, dd_p, NIL);
                ELSE
                  p$put_entry (ijle_p, ijl_number, dd_p, ^inc_p^ [ijl_number]);
                IFEND;
              IFEND;
            FOREND;
          IFEND;
        FOREND
      IFEND;

    PROCEND p$display_dd_field_data;
?? OLDTITLE ??
?? NEWTITLE := 'P$DISPLAY_UD_FIELD_DATA', EJECT ??


    PROCEDURE p$display_ud_field_data
      (VAR display_control: clt$display_control;
           field_display_selection: oft$field_data_display_select;
           update_incremental_data: boolean;
           ud_p: ^oft$max_unit_stat_display_desc;
       VAR status: ost$status);

    PROCEND p$display_ud_field_data;
?? OLDTITLE ??
?? EJECT ??

    status.normal := TRUE;
    osp$establish_condition_handler (^clear_display_lock, TRUE);

    osp$set_job_signature_lock (display_lock);

    search_for_display_description (display_name, dd_pp, ud_pp);
    IF dd_pp^ <> NIL THEN
      dd_p := #ADDRESS (1, #SEGMENT (dd_pp^), #OFFSET (dd_pp^));
      p$display_dd_field_data (display_control, field_display_selection, update_incremental_data, dd_p,
            status);
    ELSEIF ud_pp^ <> NIL THEN
      ud_p := #ADDRESS (1, #SEGMENT (ud_pp^), #OFFSET (ud_pp^));
      p$display_ud_field_data (display_control, field_display_selection, update_incremental_data, ud_p,
            status);
    ELSE
      osp$set_status_abnormal ('  ', ofe$unknown_display, display_name, status);
    IFEND;

    osp$clear_job_signature_lock (display_lock);

  PROCEND ofp$display_ved_field_data;
?? OLDTITLE ??
?? NEWTITLE := 'ofp$display_site_ved_names', EJECT ??

  PROCEDURE [XDCL, #GATE] ofp$display_site_ved_names
    (VAR display_control: clt$display_control;
         display_option_full: boolean;
     VAR status: ost$status);

{ Display the values of display_descriptions_p which contains the current
{ site defined ved names.

    VAR
      line: ost$string,
      temp_unit_display_descripts_p: ^oft$unit_stat_display_desc,
      temp_display_description: oft$display_descriptions_p;

    IF (display_descriptions_p = NIL) AND (unit_display_descriptions_p = NIL) THEN
      clp$put_display (display_control, ' No site VEDISPLAYS are currently defined.',
            {trim_option =} clc$no_trim, status);
      RETURN; {----->
    IFEND;

    IF display_descriptions_p <> NIL THEN
      temp_display_description := display_descriptions_p;

    /display_description_names/
      WHILE (temp_display_description <> NIL) DO
        fip#addl_initialize (line, temp_display_description^.header.display_name);

        IF display_option_full THEN
          fip#addl_string (line, ' ');
          fip#addl_string (line, temp_display_description^.header.display_name_abbrev);
          fip#addl_string (line, ' Job Statistic');
        IFEND;

        clp$put_display (display_control, line.value (1, line.size), {trim_option =} clc$trim, status);
        IF NOT status.normal THEN
          EXIT /display_description_names/; {----->
        IFEND;
        temp_display_description := temp_display_description^.header.next_description_p;
      WHILEND /display_description_names/;
    IFEND;

    IF unit_display_descriptions_p <> NIL THEN
      temp_unit_display_descripts_p := unit_display_descriptions_p;

    /display_unit_statistic_names/
      WHILE (temp_unit_display_descripts_p <> NIL) DO
        fip#addl_initialize (line, temp_unit_display_descripts_p^.header.display_name);

        IF display_option_full THEN
          fip#addl_string (line, ' ');
          fip#addl_string (line, temp_unit_display_descripts_p^.header.display_name_abbrev);
          fip#addl_string (line, ' Unit Statistic');
        IFEND;

        clp$put_display (display_control, line.value (1, line.size), {trim_option =} clc$trim, status);
        IF NOT status.normal THEN
          EXIT /display_unit_statistic_names/; {----->
        IFEND;
        temp_unit_display_descripts_p := temp_unit_display_descripts_p^.header.next_description_p;
      WHILEND /display_unit_statistic_names/;
    IFEND;

  PROCEND ofp$display_site_ved_names;
?? OLDTITLE ??
?? NEWTITLE := '[xdcl, #gate] OFP$PURGE_INCREMENTAL_DATA', EJECT ??

  PROCEDURE [XDCL, #GATE] ofp$purge_incremental_data
    (    display_kinds: oft$display_kinds;
     VAR status: ost$status);

    VAR
      line: ost$string,
      temp_unit_display_descripts_p: ^oft$unit_stat_display_desc,
      temp_display_description: oft$display_descriptions_p;

    status.normal := TRUE;
    IF (display_descriptions_p = NIL) AND (unit_display_descriptions_p = NIL) THEN
      RETURN; {----->
    IFEND;

{OFC$DT_INITIATED_JOB_DISPLAY
    IF (ofc$dt_initiated_job_display IN display_kinds) AND (display_descriptions_p <> NIL) THEN
      temp_display_description := display_descriptions_p;

      WHILE (temp_display_description <> NIL) DO
        IF temp_display_description^.header.incremental_data_p <> NIL THEN
          FREE temp_display_description^.header.incremental_data_p IN osv$task_shared_heap^;
          temp_display_description^.header.incremental_data_p := NIL;
        IFEND;

        temp_display_description := temp_display_description^.header.next_description_p;
      WHILEND;
    IFEND;

{OFC$DT_UNIT_STATISTIC_DISPLAY
    IF (ofc$dt_unit_statistic_display IN display_kinds) AND (unit_display_descriptions_p <> NIL) THEN
      temp_unit_display_descripts_p := unit_display_descriptions_p;

      WHILE (temp_unit_display_descripts_p <> NIL) DO
        IF temp_unit_display_descripts_p^.header.incremental_data_p <> NIL THEN
          FREE temp_unit_display_descripts_p^.header.incremental_data_p IN osv$task_shared_heap^;
          temp_unit_display_descripts_p^.header.incremental_data_p := NIL;
        IFEND;

        temp_unit_display_descripts_p := temp_unit_display_descripts_p^.header.next_description_p;
      WHILEND;
    IFEND;

  PROCEND ofp$purge_incremental_data;
?? OLDTITLE ??
?? NEWTITLE := 'ofp$verify_display_name', EJECT ??

  PROCEDURE [XDCL, #GATE] ofp$verify_display_name
    (    display_name: ost$name;
     VAR long_name: ost$name;
     VAR status: ost$status);

    VAR
      dd_p: oft$display_descriptions_p,
      dd_pp: ^oft$display_descriptions_p,
      ud_p: ^oft$unit_stat_display_desc,
      ud_pp: ^^oft$unit_stat_display_desc;

    status.normal := TRUE;
    osp$set_job_signature_lock (display_lock);

    search_for_display_description (display_name, dd_pp, ud_pp);

    IF dd_pp^ <> NIL THEN
      dd_p := dd_pp^;
      dd_pp^ := dd_p^.header.next_description_p;
      dd_p^.header.next_description_p := display_descriptions_p;
      display_descriptions_p := dd_p;
      long_name := dd_p^.header.display_name;
    ELSEIF ud_pp^ <> NIL THEN
      ud_p := ud_pp^;
      ud_pp^ := ud_p^.header.next_description_p;
      ud_p^.header.next_description_p := unit_display_descriptions_p;
      unit_display_descriptions_p := ud_p;
      long_name := ud_p^.header.display_name;
    ELSE
      osp$set_status_abnormal ('  ', ofe$unknown_display, display_name, status);
    IFEND;

    osp$clear_job_signature_lock (display_lock);

  PROCEND ofp$verify_display_name;
?? NOCOMPILE ??
?? EJECT ??

  PROCEDURE [XDCL] zdpp$put_next_line
    (    wid: dpt$window_id;
         s: string ( * );
     VAR status: ost$status);

    status.normal := TRUE;
  PROCEND zdpp$put_next_line;
*copyc clp$put_job_command_response

  PROCEDURE [XDCL, #GATE] vedtest;

    VAR
      i,
      tot: integer,
      dn: ost$name,
      fn: amt$local_file_name,
      s: string (100),
      sl: integer,
      t: array [1 .. 100] of integer,
      status: ost$status;

    dn := 'IJ';
    FOR i := 1 TO 100 DO
      t [i] := #READ_REGISTER (0c9(16));
      ofp$display (1, dn, fn, i = 1, status);
      t [i] := t [i] - #READ_REGISTER (0c9(16));
    FOREND;
    tot := 0;
    FOR i := 1 TO 100 DO
      tot := tot + t [i];
      IF i < 11 THEN
        STRINGREP (s, sl, t [i]: 10, ' microseconds');
        clp$put_job_command_response (s (1, sl), status);
      IFEND;
    FOREND;
    STRINGREP (s, sl, tot DIV 10: 10, ' average microseconds');
    clp$put_job_command_response (s (1, sl), status);
  PROCEND vedtest;
?? COMPILE ??
MODEND ofm$designer_screens_r3

