?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Configuration Management: Logical Configuration Utility' ??
MODULE cmm$logical_configuration_util;

{ PURPOSE:
{   This module provides operator status and control interfaces to the Logical Configuration structures of
{ NOS/VE.  These include interfaces used during during, as well as after, deadstart.  Included are commands
{ relating to mass storage devices, tape label initialization, and network configuration, as well as more
{ general configuration status and control.

?? NEWTITLE := 'Global Declarations Referenced By This Module', EJECT ??

?? PUSH (LISTEXT := ON) ??
*copyc amt$local_file_name
*copyc amt$access_selection
*copyc clc$standard_file_names
*copyc cle$ecc_file_reference
*copyc cle$ecc_parsing
*copyc clt$function_proc_table_entry
*copyc clt$function_processor_table
*copyc clt$parameter_value_table
*copyc clt$path_display_chunks
*copyc clt$string_value
*copyc clt$work_area
*copyc cmc$logical_unit_constants
*copyc cme$logical_configuration_mgr
*copyc cme$logical_configuration_utl
*copyc cme$reserve_element
*copyc cmt$configuration_state
*copyc cmt$cpu_element_definition
*copyc cmt$element_definition
*copyc cmt$element_name
*copyc cmt$element_state
*copyc cmt$lcu_display_option_key
*copyc cmt$lcu_lock_control
*copyc cmt$mass_storage_volume
*copyc cmt$unit_class
*copyc cmt$unit_type
*copyc dmc$k_multiplier
*copyc dmt$allocation_size
*copyc dmt$error_condition_codes
*copyc dmt$flaw_dau_definition
*copyc dmt$flaw_duplication
*copyc dmt$log_flaw_init_data
*copyc dmt$transfer_size
*copyc dmt$volume_attribute_info
*copyc dmt$volume_attributes
*copyc jmc$system_family
*copyc mme$condition_codes
*copyc nac$network_catalog
*copyc nac$sk_max_host_name_size
*copyc nat$channel_descriptor
*copyc nat$display_option
*copyc nat$network_descriptor
*copyc ofe$error_codes
*copyc oss$job_paged_literal
*copyc oss$task_shared
*copyc ost$caller_identifier
*copyc ost$cpu_down_state_reason
*copyc ost$name
*copyc ost$processor_id
*copyc ost$processor_id_set
*copyc rmc$condition_code_limits
*copyc rmd$volume_declarations
*copyc rmt$density
*copyc stt$number_of_members
*copyc stt$volume_info
*copyc stt$volume_list
?? POP ??
*copyc amp$copy_file
*copyc amp$get_file_attributes
*copyc amp$get_next
*copyc amp$return
*copyc avp$capabilities_active_any
*copyc avp$configuration_administrator
*copyc avp$removable_media_operator
*copyc avp$system_displays
*copyc avp$system_operator
*copyc clp$begin_utility
*copyc clp$build_standard_title
*copyc clp$close_display
*copyc clp$convert_integer_to_rjstring
*copyc clp$convert_integer_to_string
*copyc clp$convert_string_to_file
*copyc clp$count_list_elements
*copyc clp$end_scan_command_file
*copyc clp$end_utility
*copyc clp$evaluate_parameters
*copyc clp$new_display_line
*copyc clp$open_display
*copyc clp$open_display_file
*copyc clp$open_display_reference
*copyc clp$put_display
*copyc clp$put_job_output
*copyc clp$put_partial_display
*copyc clp$reset_for_next_display_page
*copyc clp$scan_command_file
*copyc clp$scan_command_line
*copyc clp$trimmed_string_size
*copyc cmf$physical_config_activated
*copyc cmp$activate_volume
*copyc cmp$add_class_to_element
*copyc cmp$change_cpu_element_state
*copyc cmp$determine_tape_element
*copyc cmp$change_volume_attributes
*copyc cmp$check_init_status
*copyc cmp$clean_up_error_count
*copyc cmp$clean_up_network_list
*copyc cmp$copy_active_configuration
*copyc cmp$display_named_element
*copyc cmp$display_type_elements
*copyc cmp$echo_command
*copyc cmp$echo_errors
*copyc cmp$enable_production_r3
*copyc cmp$form_network_list
*copyc cmp$free_command_list
*copyc cmp$generate_error_listing
*copyc cmp$get_cpu_element_r3
*copyc cmp$get_element_r3
*copyc cmp$get_element_state
*copyc cmp$get_element_state_via_lun
*copyc cmp$get_element_information
*copyc cmp$get_logical_attributes
*copyc cmp$get_logical_unit_number_r3
*copyc cmp$get_ms_class_on_volume
*copyc cmp$get_ms_status_via_lun
*copyc cmp$get_ms_volume_info
*copyc cmp$get_ms_volumes
*copyc cmp$get_number_of_element
*copyc cmp$get_physical_attributes
*copyc cmp$get_sys_dev_rec_vsn
*copyc cmp$get_unit_number_via_vsn
*copyc cmp$get_volume_attributes
*copyc cmp$get_volumes_active
*copyc cmp$hide_commands
*copyc cmp$initialize_ms_volume
*copyc cmp$lock_set_by_current_task
*copyc cmp$manage_lock_r3
*copyc cmp$obtain_max_volume_index
*copyc cmp$obtain_volumes
*copyc cmp$open_scratch_err_file
*copyc cmp$process_das_restore
*copyc cmp$lcu_process_state_change
*copyc cmp$process_force_format
*copyc cmp$process_outstanding_sc_req
*copyc cmp$valid_channel_name
*copyc cmp$validate_cip_path
*copyc cmp$validate_ms_class
*copyc cmp$validate_set_membership
*copyc cmp$volume_online
*copyc cmv$error_count
*copyc cmv$network_descriptor_p
*copyc dmp$define_remove_ms_flaw
*copyc dmp$identify_flawed_daus
*copyc dmp$invoke_space_manager
*copyc fip#addl_char
*copyc fip#addl_initialize
*copyc fip#addl_string
*copyc fsp$close_file
*copyc fsp$open_file
*copyc nap$display_network_config
*copyc nap$get_file_cycle_count
*copyc osp$append_status_integer
*copyc osp$append_status_parameter
*copyc osp$disestablish_cond_handler
*copyc osp$establish_block_exit_hndlr
*copyc osp$set_status_abnormal
*copyc osp$set_status_condition
*copyc osp$unpack_status_identifier
*copyc osv$lower_to_upper
*copyc pfp$define
*copyc pfp$define_catalog
*copyc pfp$overhaul_set
*copyc pfp$purge
*copyc pmp$continue_to_cause
*copyc pmp$convert_binary_unique_name
*copyc pmp$get_unique_name
*copyc pmp$zero_out_table
*copyc stp$add_member_vol_to_set
*copyc stp$create_set
*copyc amv$nil_file_identifier
*copyc clv$nil_display_control
*copyc cmv$lcu_command_list
*copyc cmv$lcu_function_list
?? OLDTITLE ??
?? NEWTITLE := 'Global Declarations Declared By This Module', EJECT ??

  VAR
    cmv$utility_name: [STATIC, READ, oss$job_paged_literal] ost$name := 'LOGICAL_CONFIGURATION_UTILITY';

  VAR
    v$lcu_lock_control: cmt$lcu_lock_control := [
{ SYSTEM_ACTIVITY_SET        } FALSE,
{ CONTROLS                   } [REP 2 OF [FALSE, FALSE]]];

?? OLDTITLE ??
?? NEWTITLE := 'LOGICAL_CONFIGURATION_UTILITY', EJECT ??

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

{ PROCEDURE (cmm$lcu) logical_configuration_utility, lcu (
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 1] of clt$pdt_parameter_name,
      parameters: array [1 .. 1] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [101, 9, 20, 16, 54, 34, 833],
    clc$command, 1, 1, 0, 0, 0, 0, 1, 'CMM$LCU'], [
    ['STATUS                         ',clc$nominal_entry, 1]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$status_type]]];

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

    CONST
      p$status = 1;

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

{ table lcu_command_list type=command section_name=oss$job_paged_literal s=local
{ command (add_volume_to_set, addvts) add_volume_to_set cm=local,
{ command (change_element_state, chaes) change_element_state cm=local
{ command (change_ms_class, change_ms_classes, chamc, chamsc) change_ms_class cm=local
{ command (change_ms_volume, chamv, chamsv) change_ms_volume cm=local
{ command (create_set, cres) create_set cm=local
{ command (define_host_network, defhn) cmp$define_host_network cm=local availability=hidden
{ command (define_ms_flaw, defmf, defmsf) define_ms_flaw cm=local
{ command (define_network_connection, defnc) cmp$define_network_connection cm=local availability=hidden
{ command (define_tcpip_host, defth) cmp$define_tcpip_host cm=local availability=hidden
{ command (display_element_status, dises) display_element_status cm=local
{ command (display_mainframe_configuration, dismc) cmp$display_mf_configuration cm=local
{ command (display_ms_class, display_ms_classes, dismsc) display_ms_class cm=local
{ command (display_ms_flaws, display_ms_flaw, dismsf) display_ms_flaw cm=local
{ command (display_ms_volume, dismv, dismsv) display_ms_volume cm=local
{ command (display_network_configuration, disnc) cmp$display_netw_configuration cm=local
{ command (display_processor_state, disps) display_processor_state cm=local
{ command (enable_production, enap) enable_production cm=local
{ command (format_reinstated_parity_unit, forrpu) format_reinstated_parity_unit cm=local
{ command (initialize_ms_volume, inimv, inimsv) initialize_ms_volume cm=local
{ command (initiate_das_restore, inidr) initiate_das_restore cm=local
{ command (install_network_configuration, insnc) install_network_configuration cm=local
{ command (invoke_space_manager, invsm) invoke_space_manager cm=local
{ command (quit, qui) quit cm=local
{ command (remove_ms_flaw, remmf, remmsf) remove_ms_flaw cm=local
{ command (verify_network_configuration, vernc) verify_network_configuration cm=local
{ tablend

?? PUSH (LISTEXT := ON) ??

VAR
  lcu_command_list: [STATIC, READ, oss$job_paged_literal] ^clt$command_table := ^lcu_command_list_entries,

  lcu_command_list_entries: [STATIC, READ, oss$job_paged_literal] array [1 .. 59] of
      clt$command_table_entry := [
  {} ['ADDVTS                         ', clc$abbreviation_entry, clc$normal_usage_entry, 1,
        clc$automatically_log, clc$linked_call, ^add_volume_to_set],
  {} ['ADD_VOLUME_TO_SET              ', clc$nominal_entry, clc$normal_usage_entry, 1,
        clc$automatically_log, clc$linked_call, ^add_volume_to_set],
  {} ['CHAES                          ', clc$abbreviation_entry, clc$normal_usage_entry, 2,
        clc$automatically_log, clc$linked_call, ^change_element_state],
  {} ['CHAMC                          ', clc$alias_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^change_ms_class],
  {} ['CHAMSC                         ', clc$abbreviation_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^change_ms_class],
  {} ['CHAMSV                         ', clc$abbreviation_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^change_ms_volume],
  {} ['CHAMV                          ', clc$alias_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^change_ms_volume],
  {} ['CHANGE_ELEMENT_STATE           ', clc$nominal_entry, clc$normal_usage_entry, 2,
        clc$automatically_log, clc$linked_call, ^change_element_state],
  {} ['CHANGE_MS_CLASS                ', clc$nominal_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^change_ms_class],
  {} ['CHANGE_MS_CLASSES              ', clc$alias_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^change_ms_class],
  {} ['CHANGE_MS_VOLUME               ', clc$nominal_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^change_ms_volume],
  {} ['CREATE_SET                     ', clc$nominal_entry, clc$normal_usage_entry, 5,
        clc$automatically_log, clc$linked_call, ^create_set],
  {} ['CRES                           ', clc$abbreviation_entry, clc$normal_usage_entry, 5,
        clc$automatically_log, clc$linked_call, ^create_set],
  {} ['DEFHN                          ', clc$abbreviation_entry, clc$hidden_entry, 6,
        clc$automatically_log, clc$linked_call, ^cmp$define_host_network],
  {} ['DEFINE_HOST_NETWORK            ', clc$nominal_entry, clc$hidden_entry, 6,
        clc$automatically_log, clc$linked_call, ^cmp$define_host_network],
  {} ['DEFINE_MS_FLAW                 ', clc$nominal_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^define_ms_flaw],
  {} ['DEFINE_NETWORK_CONNECTION      ', clc$nominal_entry, clc$hidden_entry, 8,
        clc$automatically_log, clc$linked_call, ^cmp$define_network_connection],
  {} ['DEFINE_TCPIP_HOST              ', clc$nominal_entry, clc$hidden_entry, 9,
        clc$automatically_log, clc$linked_call, ^cmp$define_tcpip_host],
  {} ['DEFMF                          ', clc$alias_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^define_ms_flaw],
  {} ['DEFMSF                         ', clc$abbreviation_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^define_ms_flaw],
  {} ['DEFNC                          ', clc$abbreviation_entry, clc$hidden_entry, 8,
        clc$automatically_log, clc$linked_call, ^cmp$define_network_connection],
  {} ['DEFTH                          ', clc$abbreviation_entry, clc$hidden_entry, 9,
        clc$automatically_log, clc$linked_call, ^cmp$define_tcpip_host],
  {} ['DISES                          ', clc$abbreviation_entry, clc$normal_usage_entry, 10,
        clc$automatically_log, clc$linked_call, ^display_element_status],
  {} ['DISMC                          ', clc$abbreviation_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^cmp$display_mf_configuration],
  {} ['DISMSC                         ', clc$abbreviation_entry, clc$normal_usage_entry, 12,
        clc$automatically_log, clc$linked_call, ^display_ms_class],
  {} ['DISMSF                         ', clc$abbreviation_entry, clc$normal_usage_entry, 13,
        clc$automatically_log, clc$linked_call, ^display_ms_flaw],
  {} ['DISMSV                         ', clc$abbreviation_entry, clc$normal_usage_entry, 14,
        clc$automatically_log, clc$linked_call, ^display_ms_volume],
  {} ['DISMV                          ', clc$alias_entry, clc$normal_usage_entry, 14,
        clc$automatically_log, clc$linked_call, ^display_ms_volume],
  {} ['DISNC                          ', clc$abbreviation_entry, clc$normal_usage_entry, 15,
        clc$automatically_log, clc$linked_call, ^cmp$display_netw_configuration],
  {} ['DISPLAY_ELEMENT_STATUS         ', clc$nominal_entry, clc$normal_usage_entry, 10,
        clc$automatically_log, clc$linked_call, ^display_element_status],
  {} ['DISPLAY_MAINFRAME_CONFIGURATION', clc$nominal_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^cmp$display_mf_configuration],
  {} ['DISPLAY_MS_CLASS               ', clc$nominal_entry, clc$normal_usage_entry, 12,
        clc$automatically_log, clc$linked_call, ^display_ms_class],
  {} ['DISPLAY_MS_CLASSES             ', clc$alias_entry, clc$normal_usage_entry, 12,
        clc$automatically_log, clc$linked_call, ^display_ms_class],
  {} ['DISPLAY_MS_FLAW                ', clc$alias_entry, clc$normal_usage_entry, 13,
        clc$automatically_log, clc$linked_call, ^display_ms_flaw],
  {} ['DISPLAY_MS_FLAWS               ', clc$nominal_entry, clc$normal_usage_entry, 13,
        clc$automatically_log, clc$linked_call, ^display_ms_flaw],
  {} ['DISPLAY_MS_VOLUME              ', clc$nominal_entry, clc$normal_usage_entry, 14,
        clc$automatically_log, clc$linked_call, ^display_ms_volume],
  {} ['DISPLAY_NETWORK_CONFIGURATION  ', clc$nominal_entry, clc$normal_usage_entry, 15,
        clc$automatically_log, clc$linked_call, ^cmp$display_netw_configuration],
  {} ['DISPLAY_PROCESSOR_STATE        ', clc$nominal_entry, clc$normal_usage_entry, 16,
        clc$automatically_log, clc$linked_call, ^display_processor_state],
  {} ['DISPS                          ', clc$abbreviation_entry, clc$normal_usage_entry, 16,
        clc$automatically_log, clc$linked_call, ^display_processor_state],
  {} ['ENABLE_PRODUCTION              ', clc$nominal_entry, clc$normal_usage_entry, 17,
        clc$automatically_log, clc$linked_call, ^enable_production],
  {} ['ENAP                           ', clc$abbreviation_entry, clc$normal_usage_entry, 17,
        clc$automatically_log, clc$linked_call, ^enable_production],
  {} ['FORMAT_REINSTATED_PARITY_UNIT  ', clc$nominal_entry, clc$normal_usage_entry, 18,
        clc$automatically_log, clc$linked_call, ^format_reinstated_parity_unit],
  {} ['FORRPU                         ', clc$abbreviation_entry, clc$normal_usage_entry, 18,
        clc$automatically_log, clc$linked_call, ^format_reinstated_parity_unit],
  {} ['INIDR                          ', clc$abbreviation_entry, clc$normal_usage_entry, 20,
        clc$automatically_log, clc$linked_call, ^initiate_das_restore],
  {} ['INIMSV                         ', clc$abbreviation_entry, clc$normal_usage_entry, 19,
        clc$automatically_log, clc$linked_call, ^initialize_ms_volume],
  {} ['INIMV                          ', clc$alias_entry, clc$normal_usage_entry, 19,
        clc$automatically_log, clc$linked_call, ^initialize_ms_volume],
  {} ['INITIALIZE_MS_VOLUME           ', clc$nominal_entry, clc$normal_usage_entry, 19,
        clc$automatically_log, clc$linked_call, ^initialize_ms_volume],
  {} ['INITIATE_DAS_RESTORE           ', clc$nominal_entry, clc$normal_usage_entry, 20,
        clc$automatically_log, clc$linked_call, ^initiate_das_restore],
  {} ['INSNC                          ', clc$abbreviation_entry, clc$normal_usage_entry, 21,
        clc$automatically_log, clc$linked_call, ^install_network_configuration],
  {} ['INSTALL_NETWORK_CONFIGURATION  ', clc$nominal_entry, clc$normal_usage_entry, 21,
        clc$automatically_log, clc$linked_call, ^install_network_configuration],
  {} ['INVOKE_SPACE_MANAGER           ', clc$nominal_entry, clc$normal_usage_entry, 22,
        clc$automatically_log, clc$linked_call, ^invoke_space_manager],
  {} ['INVSM                          ', clc$abbreviation_entry, clc$normal_usage_entry, 22,
        clc$automatically_log, clc$linked_call, ^invoke_space_manager],
  {} ['QUI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 23,
        clc$automatically_log, clc$linked_call, ^quit],
  {} ['QUIT                           ', clc$nominal_entry, clc$normal_usage_entry, 23,
        clc$automatically_log, clc$linked_call, ^quit],
  {} ['REMMF                          ', clc$alias_entry, clc$normal_usage_entry, 24,
        clc$automatically_log, clc$linked_call, ^remove_ms_flaw],
  {} ['REMMSF                         ', clc$abbreviation_entry, clc$normal_usage_entry, 24,
        clc$automatically_log, clc$linked_call, ^remove_ms_flaw],
  {} ['REMOVE_MS_FLAW                 ', clc$nominal_entry, clc$normal_usage_entry, 24,
        clc$automatically_log, clc$linked_call, ^remove_ms_flaw],
  {} ['VERIFY_NETWORK_CONFIGURATION   ', clc$nominal_entry, clc$normal_usage_entry, 25,
        clc$automatically_log, clc$linked_call, ^verify_network_configuration],
  {} ['VERNC                          ', clc$abbreviation_entry, clc$normal_usage_entry, 25,
        clc$automatically_log, clc$linked_call, ^verify_network_configuration]];

?? POP ??

{ table lcu_function_list type=function section_name=oss$job_paged_literal scope=local
{ function $active_sets                   cmp$$active_sets xref
{ function $active_set_families           cmp$$active_set_families xref
{ function $active_set_members            cmp$$active_set_members xref
{ function $mass_storage_class_members    cmp$$mass_storage_class_members xref
{ function ($channel_port                 $cp) cmp$$channel_port xref
{ function $element                       cmp$$element xref
{ function ($physical_address             $pa) cmp$$physical_address xref
{ function $storage_device_name          cmp$$storage_device_name xref
{ function $system_set_name              cmp$$system_set_name xref
{ tablend

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

VAR
  lcu_function_list: [STATIC, READ, oss$job_paged_literal] ^clt$function_processor_table :=
      ^lcu_function_list_entries,

  lcu_function_list_entries: [STATIC, READ, oss$job_paged_literal] array [1 .. 11] of
      clt$function_proc_table_entry := [
  {} ['$ACTIVE_SETS                   ', clc$nominal_entry, clc$normal_usage_entry, 1,
        clc$linked_call, ^cmp$$active_sets],
  {} ['$ACTIVE_SET_FAMILIES           ', clc$nominal_entry, clc$normal_usage_entry, 2,
        clc$linked_call, ^cmp$$active_set_families],
  {} ['$ACTIVE_SET_MEMBERS            ', clc$nominal_entry, clc$normal_usage_entry, 3,
        clc$linked_call, ^cmp$$active_set_members],
  {} ['$CHANNEL_PORT                  ', clc$nominal_entry, clc$normal_usage_entry, 5,
        clc$linked_call, ^cmp$$channel_port],
  {} ['$CP                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5,
        clc$linked_call, ^cmp$$channel_port],
  {} ['$ELEMENT                       ', clc$nominal_entry, clc$normal_usage_entry, 6,
        clc$linked_call, ^cmp$$element],
  {} ['$MASS_STORAGE_CLASS_MEMBERS    ', clc$nominal_entry, clc$normal_usage_entry, 4,
        clc$linked_call, ^cmp$$mass_storage_class_members],
  {} ['$PA                            ', clc$abbreviation_entry, clc$normal_usage_entry, 7,
        clc$linked_call, ^cmp$$physical_address],
  {} ['$PHYSICAL_ADDRESS              ', clc$nominal_entry, clc$normal_usage_entry, 7,
        clc$linked_call, ^cmp$$physical_address],
  {} ['$STORAGE_DEVICE_NAME           ', clc$nominal_entry, clc$normal_usage_entry, 8,
        clc$linked_call, ^cmp$$storage_device_name],
  {} ['$SYSTEM_SET_NAME               ', clc$nominal_entry, clc$normal_usage_entry, 9,
        clc$linked_call, ^cmp$$system_set_name]];

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

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

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

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

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

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

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

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

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

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

?? NEWTITLE := '   abort_handler', EJECT ??

    PROCEDURE abort_handler
      (    condition: pmt$condition;
           p_condition_info: ^pmt$condition_information;
           p_stack: ^ost$stack_frame_save_area;
       VAR condition_status: ost$status);

      CASE condition.selector OF

      = pmc$block_exit_processing =
        cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_clear_lock, v$lcu_lock_control, status);

        cmp$manage_lock_r3 (cmc$removable_media_operation, cmc$llo_clear_lock, v$lcu_lock_control, status);
      ELSE
        pmp$continue_to_cause (pmc$execute_standard_procedure, condition_status);
      CASEND;

    PROCEND abort_handler;

?? OLDTITLE ??
?? EJECT ??

    VAR
      utility_attributes_p: ^clt$utility_attributes;

    IF NOT cmf$physical_config_activated () THEN
      osp$set_status_condition (cme$phys_config_not_installed, status);
      RETURN; {----->
    IFEND;

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

    osp$establish_block_exit_hndlr (^abort_handler);
    cmp$hide_commands (lcu_command_list, lcu_function_list);

    PUSH utility_attributes_p: [1 .. 5];
    utility_attributes_p^ [1].key := clc$utility_command_search_mode;
    utility_attributes_p^ [1].command_search_mode := clc$global_command_search;
    utility_attributes_p^ [2].key := clc$utility_command_table;
    utility_attributes_p^ [2].command_table := cmv$lcu_command_list;
    utility_attributes_p^ [3].key := clc$utility_function_proc_table;
    utility_attributes_p^ [3].function_processor_table := cmv$lcu_function_list;
    utility_attributes_p^ [4].key := clc$utility_prompt;
    utility_attributes_p^ [4].prompt.value := 'LCU';
    utility_attributes_p^ [4].prompt.size := 3;
    utility_attributes_p^ [5].key := clc$utility_termination_command;
    utility_attributes_p^ [5].termination_command := 'QUIT';

    clp$begin_utility (cmv$utility_name, utility_attributes_p^, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    clp$scan_command_file (clc$current_command_input, cmv$utility_name, 'LCU', status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    clp$end_utility (cmv$utility_name, status);

  PROCEND logical_configuration_utility;
?? OLDTITLE ??
?? NEWTITLE := 'LCU', EJECT ??

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

    logical_configuration_utility (parameter_list, status);

  PROCEND lcu;
?? OLDTITLE ??
?? NEWTITLE := 'ADD_VOLUME_TO_SET', EJECT ??

  PROCEDURE add_volume_to_set
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{   PROCEDURE (cmm$lcu_addvts) add_volume_to_set, addvts (
{     recorded_vsn, member_vsn, memvsn, mv, rv: name 1..6 = $required
{     set_name, sn: name
{     status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 8] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 8, 25, 9, 10, 23, 89],
    clc$command, 8, 3, 1, 0, 0, 0, 3, 'CMM$LCU_ADDVTS'], [
    ['MEMBER_VSN                     ',clc$alias_entry, 1],
    ['MEMVSN                         ',clc$alias_entry, 1],
    ['MV                             ',clc$alias_entry, 1],
    ['RECORDED_VSN                   ',clc$nominal_entry, 1],
    ['RV                             ',clc$abbreviation_entry, 1],
    ['SET_NAME                       ',clc$nominal_entry, 2],
    ['SN                             ',clc$abbreviation_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],
{ PARAMETER 3
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, 6]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

    CONST
      p$recorded_vsn = 1,
      p$set_name = 2,
      p$status = 3;

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

    CONST
      command_name = 'ADD_VOLUME_TO_SET';

    VAR
      allow_to_continue: boolean,
      logical_unit_number: iot$logical_unit,
      message: string (60),
      recorded_vsn: rmt$recorded_vsn,
      set_name: stt$set_name,
      status_p: ^ost$status,
      system_device_vsn: rmt$recorded_vsn;

    status.normal := TRUE;
    IF (NOT avp$configuration_administrator ()) THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration', status);
      RETURN; {----->
    IFEND;

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

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  /main_program/
    BEGIN
      recorded_vsn := pvt [p$recorded_vsn].value^.name_value;
      IF pvt [p$set_name].specified THEN
        set_name := pvt [p$set_name].value^.name_value;
      ELSE
        set_name := 'UNSPECIFIED';
      IFEND;
      cmp$get_unit_number_via_vsn (recorded_vsn, logical_unit_number, status);
      IF NOT status.normal THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_recorded_vsn_not_found,
              command_name, status);
        EXIT /main_program/;
      IFEND;

      cmp$get_sys_dev_rec_vsn (system_device_vsn, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      IF logical_unit_number = 2 THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_illegal_addvts, ' ', status);
        EXIT /main_program/;
      IFEND;

      IF recorded_vsn = system_device_vsn THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_duplicate_vsn, recorded_vsn,
              status);
        EXIT /main_program/;
      IFEND;

      cmp$validate_set_membership (pvt [p$recorded_vsn].value^.name_value (1, 6), set_name, allow_to_continue,
            status);
      IF (NOT status.normal) OR (NOT allow_to_continue) THEN
        EXIT /main_program/;
      IFEND;

      stp$add_member_vol_to_set (set_name, recorded_vsn, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      message := ' ACTIVATING ';
      message (13, * ) := recorded_vsn;
      clp$put_job_output (message, status);
      cmp$activate_volume (logical_unit_number, status);
      status.normal := status.normal OR (status.condition = dme$volume_already_active);
    END /main_program/;

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND add_volume_to_set;

?? OLDTITLE ??
?? NEWTITLE := '  CHANGE_ELEMENT_STATE', EJECT ??

{ PURPOSE:
{   This procedure is the command processor for the CHANGE_ELEMENT_STATE command.

  PROCEDURE change_element_state
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{  PROCEDURE (cmm$lcu_chaes) change_element_state, chaes (
{    element, e: name = $required
{    state, s: key
{        down, off, on
{      keyend = $required
{    iou, i: name = IOU0
{    status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 7] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 3] of clt$keyword_specification,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 8, 29, 13, 48, 49, 964],
    clc$command, 7, 4, 2, 0, 0, 0, 4, 'CMM$LCU_CHAES'], [
    ['E                              ',clc$abbreviation_entry, 1],
    ['ELEMENT                        ',clc$nominal_entry, 1],
    ['I                              ',clc$abbreviation_entry, 3],
    ['IOU                            ',clc$nominal_entry, 3],
    ['S                              ',clc$abbreviation_entry, 2],
    ['STATE                          ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 118, clc$required_parameter, 0, 0],
{ PARAMETER 3
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$optional_default_parameter, 0, 4],
{ PARAMETER 4
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [3], [
    ['DOWN                           ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['OFF                            ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
    ['ON                             ', clc$nominal_entry,
  clc$normal_usage_entry, 3]]
    ],
{ PARAMETER 3
    [[1, 0, clc$name_type], [1, osc$max_name_size],
    'IOU0'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$element = 1,
      p$state = 2,
      p$iou = 3,
      p$status = 4;

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

    VAR
      v$element_state: [STATIC, READ, oss$job_paged_literal] array [cmt$element_state] of ost$name := ['ON',
            'OFF', 'DOWN'];

    VAR
      element: cmt$element_descriptor,
      element_definition: ^cmt$element_definition,
      element_info: array [1 .. 2] of cmt$element_info_item,
      index_state: cmt$element_state,
      initial_processor_value: 0 .. 255,
      iou_name: cmt$element_name,
      processor_index: ost$processor_id,
      processor_name: cmt$element_name,
      state: cmt$element_state,
      status_p: ^ost$status,
      tape_element: boolean;

    status.normal := TRUE;
    IF NOT avp$capabilities_active_any ($avt$conditional_capabilities
          [avc$cc_configuration_admin, avc$cc_removable_media_operator, avc$cc_system_operator]) THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active,
            'configuration_administration, removable_media_operation ' CAT 'or system_operation', status);
      RETURN; {----->
    IFEND;

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

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

  /translate_to_cmt$element_state/
    FOR index_state := LOWERVALUE (cmt$element_state) TO UPPERVALUE (cmt$element_state) DO
      IF pvt [p$state].value^.keyword_value = v$element_state [index_state] THEN
        state := index_state;
        EXIT /translate_to_cmt$element_state/; {----->
      IFEND;
    FOREND /translate_to_cmt$element_state/;

{Process CP state changes.
    IF (pvt [p$element].value^.name_value (1, 2) = 'CP') AND
          (clp$trimmed_string_size (pvt [p$element].value^.name_value) = 3) THEN
      processor_name := pvt [p$element].value^.name_value;
      initial_processor_value := $INTEGER (processor_name (3)) - $INTEGER ('0');
      IF (initial_processor_value < LOWERVALUE (ost$processor_id)) OR
            (initial_processor_value > UPPERVALUE (ost$processor_id)) THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcm_element_not_found, processor_name,
              status);
        RETURN; {----->
      IFEND;

      processor_index := initial_processor_value;
      cmp$change_cpu_element_state (processor_index, state, status);
      RETURN; {----->
    IFEND;

{Not a CP
    PUSH element_definition;

    cmp$get_element_r3 (pvt [p$element].value^.name_value, iou_name, element_definition, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    element.element_type := element_definition^.element_type;

    CASE element.element_type OF
    = cmc$data_channel_element =
      element.channel_descriptor.iou := iou_name;
      element.channel_descriptor.use_logical_identification := TRUE;
      element.channel_descriptor.name := pvt [p$element].value^.name_value;

    = cmc$channel_adapter_element, cmc$communications_element, cmc$controller_element,
          cmc$external_processor_element, cmc$storage_device_element =
      element.peripheral_descriptor.use_logical_identification := TRUE;
      element.peripheral_descriptor.element_name := pvt [p$element].value^.name_value;

    = cmc$central_processor_element =
      element.name := pvt [p$element].value^.name_value;
    ELSE
      osp$set_status_abnormal (cmc$configuration_management_id, cme$lcm_not_available,
            'Invalid state change request for given element type', status);
      RETURN; {----->
    CASEND;

    cmp$determine_tape_element (element, tape_element);
    IF NOT tape_element
{ } AND NOT (avp$configuration_administrator () OR avp$system_operator ()) THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration or system_operation',
            status);
      RETURN; {----->
    IFEND;

    element_info [1].selector := cmc$system_critical_element;
    element_info [2].selector := cmc$element_status;
    cmp$get_element_information (element, element_info, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF element_info [1].item_returned AND element_info [1].system_critical_element AND
          (element.element_type = cmc$storage_device_element) AND (state <> cmc$on) THEN
      osp$set_status_abnormal (cmc$configuration_management_id, cme$lcm_system_critical_element,
            pvt [p$element].value^.name_value, status);
      RETURN; {----->
    IFEND;

    cmp$lcu_process_state_change (tape_element, {system_caller=} FALSE, element,
          element_info [1].system_critical_element, element_info [2].element_status.state, state,
v$lcu_lock_control,
status);

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND change_element_state;
?? OLDTITLE ??
?? NEWTITLE := '  CHANGE_MS_CLASS', EJECT ??

  PROCEDURE change_ms_class
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (cmm$lcu_chamc) change_ms_class, change_ms_classes, chamc, chamsc (
{   recorded_vsn, recorded_vsns, rvsn, rv: any of
{       key
{         all
{       keyend
{       list of name 1..6
{     anyend = $required
{   delete_class, delete_classes, dc: any of
{       key
{         all
{       keyend
{       list of name 1..1
{     anyend = $optional
{   add_class, add_classes, ac: any of
{       key
{         all
{       keyend
{       list of name 1..1
{     anyend = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 11] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [101, 9, 20, 17, 33, 6, 182],
    clc$command, 11, 4, 1, 0, 0, 0, 4, 'CMM$LCU_CHAMC'], [
    ['AC                             ',clc$abbreviation_entry, 3],
    ['ADD_CLASS                      ',clc$nominal_entry, 3],
    ['ADD_CLASSES                    ',clc$alias_entry, 3],
    ['DC                             ',clc$abbreviation_entry, 2],
    ['DELETE_CLASS                   ',clc$nominal_entry, 2],
    ['DELETE_CLASSES                 ',clc$alias_entry, 2],
    ['RECORDED_VSN                   ',clc$nominal_entry, 1],
    ['RECORDED_VSNS                  ',clc$alias_entry, 1],
    ['RV                             ',clc$abbreviation_entry, 1],
    ['RVSN                           ',clc$alias_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ PARAMETER 1
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 85, clc$required_parameter,
  0, 0],
{ PARAMETER 2
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 85, clc$optional_parameter,
  0, 0],
{ PARAMETER 3
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 85, clc$optional_parameter,
  0, 0],
{ PARAMETER 4
    [11, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, 6]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, 1]]
      ]
    ],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, 1]]
      ]
    ],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$recorded_vsn = 1,
      p$delete_class = 2,
      p$add_class = 3,
      p$status = 4;

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

    TYPE
      recorded_vsn_list = record
        recorded_vsn: rmt$recorded_vsn,
        valid: boolean,
      recend;

    VAR
      add_class: dmt$class,
      class: char,
      delete_class: dmt$class,
      element_status: iot$unit_status,
      ignore_status: ost$status,
      i: integer,
      j: integer,
      max_ms_volumes: integer,
      ms_volumes: ^array [1 .. * ] of cmt$mass_storage_volume,
      rvsn_count: clt$list_size,
      rvsn_list: ^array [1 .. * ] of recorded_vsn_list,
      scan_p: ^clt$data_value,
      state: cmt$element_state,
      status_p: ^ost$status,
      system_device_rec_vsn: rmt$recorded_vsn;

    status.normal := TRUE;
    IF (NOT avp$configuration_administrator ()) THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration', status);
      RETURN; {----->
    IFEND;
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    IF pvt [p$recorded_vsn].value^.kind <> clc$keyword THEN
      rvsn_count := clp$count_list_elements (pvt [p$recorded_vsn].value);
      scan_p := pvt [p$recorded_vsn].value;
      PUSH rvsn_list: [1 .. rvsn_count];
      FOR i := 1 TO rvsn_count DO
        rvsn_list^ [i].recorded_vsn := scan_p^.element_value^.name_value;
        rvsn_list^ [i].valid := FALSE;
        scan_p := scan_p^.link;
      FOREND;

{ Need to ensure that every VSN is specified not more than once. Otherwise we get the very irritating error
{ message cme$lcu_invalid_recorded_vsn (Volume +P does not exist or not initialized.), as we set valid to TRUE
{ for the first instance, only!

      FOR i := 1 TO rvsn_count DO
        FOR j := i + 1 TO rvsn_count DO
          IF rvsn_list^ [i].recorded_vsn = rvsn_list^ [j].recorded_vsn THEN
            IF status.normal THEN
              osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_duplicate_vsn_spec,
                    rvsn_list^ [i].recorded_vsn, status);
            ELSE
              osp$append_status_parameter (' ', rvsn_list^ [i].recorded_vsn, status);
            IFEND;
          IFEND;
        FOREND;
      FOREND;
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
    IFEND;

{ Obtain the class membership of each volume in the configuration which is ON and ENABLED.

    cmp$get_ms_volumes (max_ms_volumes);
    PUSH ms_volumes: [1 .. max_ms_volumes];
    cmp$get_ms_volume_info (ms_volumes^);


{ Go through ALL ACTIVE VOLUMES and validate the ones specified as parameter.
    FOR i := 1 TO max_ms_volumes DO

{ Check if any of the volumes identified by RECORDED_VSN parameter is not ON.
      cmp$get_element_state_via_lun (ms_volumes^ [i].lun, state);
      IF state <> cmc$on THEN
        IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN
          osp$set_status_abnormal (cmc$configuration_management_id, cme$element_state_not_proper,
                ms_volumes^ [i].recorded_vsn, status);
          RETURN; {----->
        ELSE
          FOR j := 1 TO rvsn_count DO
            IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
              osp$set_status_abnormal (cmc$configuration_management_id, cme$element_state_not_proper,
                    ms_volumes^ [i].recorded_vsn, status);
              RETURN; {----->
            IFEND;
          FOREND;
        IFEND;
      IFEND;

{ Check if any of the volumes identified by RECORDED_VSN parameter is disabled.
      cmp$get_ms_status_via_lun (ms_volumes^ [i].lun, element_status);
      IF element_status.disabled THEN
        IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN
          osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_element_status,
                ms_volumes^ [i].recorded_vsn, status);
          RETURN; {----->
        ELSE
          FOR j := 1 TO rvsn_count DO
            IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
              osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_element_status,
                    ms_volumes^ [i].recorded_vsn, status);
              RETURN; {----->
            IFEND;
          FOREND;
        IFEND;
      IFEND;

      ms_volumes^ [i].on_and_enabled := (state = cmc$on) AND (NOT element_status.disabled);

      IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN
        IF ms_volumes^ [i].on_and_enabled THEN
          ms_volumes^ [i].changed := TRUE;
        IFEND;
      ELSE
        ms_volumes^ [i].changed := FALSE;

      /volume_loop_0/
        FOR j := 1 TO rvsn_count DO
          IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
            rvsn_list^ [j].valid := TRUE;
            IF ms_volumes^ [i].on_and_enabled THEN
              ms_volumes^ [i].changed := TRUE;
            IFEND;
            EXIT /volume_loop_0/; {----->
          IFEND;
        FOREND /volume_loop_0/;
      IFEND;
    FOREND;

{ Check if a volume identified by RECORDED_VSN parameter invalid or not initialized.
    IF pvt [p$recorded_vsn].value^.kind <> clc$keyword THEN
      FOR j := 1 TO rvsn_count DO
        IF NOT rvsn_list^ [j].valid THEN
          osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_recorded_vsn,
                rvsn_list^ [j].recorded_vsn, status);
          RETURN; {----->
        IFEND;
      FOREND;
    IFEND;

    add_class := $dmt$class [];
    IF pvt [p$add_class].specified THEN
      IF pvt [p$add_class].value^.kind = clc$keyword THEN
        add_class := -add_class;
      ELSE
        scan_p := pvt [p$add_class].value;
        WHILE scan_p <> NIL DO
          add_class := add_class + $dmt$class [scan_p^.element_value^.name_value];
          scan_p := scan_p^.link;
        WHILEND;
      IFEND;
    IFEND;

    delete_class := $dmt$class [];
    IF pvt [p$delete_class].specified THEN
      IF pvt [p$delete_class].value^.kind = clc$keyword THEN
        delete_class := -$dmt$class ['A'];
      ELSE
        scan_p := pvt [p$delete_class].value;
        WHILE scan_p <> NIL DO
          delete_class := delete_class + $dmt$class [scan_p^.element_value^.name_value];
          scan_p := scan_p^.link;
        WHILEND;
      IFEND;
    IFEND;

    FOR i := 1 TO max_ms_volumes DO
      IF ms_volumes^ [i].on_and_enabled THEN
        IF ms_volumes^ [i].changed THEN

{ DELETE_CLASSES must be processed before ADD_CLASSES is processed.
          ms_volumes^ [i].class := ms_volumes^ [i].class - delete_class;
          ms_volumes^ [i].class := ms_volumes^ [i].class + add_class;
        IFEND;
      IFEND
    FOREND;

{ Verify that every volume belongs to class A.
    FOR i := 1 TO max_ms_volumes DO
      IF ms_volumes^ [i].on_and_enabled THEN
        IF NOT ('A' IN ms_volumes^ [i].class) THEN
          osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_cannot_delete_class_a, ' ',
                status);
          RETURN; {----->
        IFEND;
      IFEND;
    FOREND;

{ Verify that the system device belongs to class A or Q.

    cmp$get_sys_dev_rec_vsn (system_device_rec_vsn, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  /volume_loop_1/
    FOR i := 1 TO max_ms_volumes DO
      IF ms_volumes^ [i].recorded_vsn = system_device_rec_vsn THEN
        IF NOT ($dmt$class ['A', 'Q'] <= ms_volumes^ [i].class) THEN
          osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_sys_dev_class,
                ms_volumes^ [i].recorded_vsn, status);
          RETURN; {----->
        IFEND;
        EXIT /volume_loop_1/; {----->
      IFEND;
    FOREND /volume_loop_1/;

{ Write the new membership to AVT and the volume table.
    FOR i := 1 TO max_ms_volumes DO
      IF ms_volumes^ [i].on_and_enabled THEN
        IF ms_volumes^ [i].changed THEN
          cmp$add_class_to_element (i, ms_volumes^ [i].class, ms_volumes^ [i].write_status);
        IFEND;
      IFEND;
    FOREND;

{ Issue error message if an error occurs when writing the volume label.

  /volume_loop_3/
    FOR i := 1 TO max_ms_volumes DO
      IF ms_volumes^ [i].on_and_enabled AND ms_volumes^ [i].changed AND
(NOT ms_volumes^ [i].write_status.normal) THEN
            osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_cannot_write_vol_label,
                  'Not all volumes processed due to peripheral failure', status);
            exit /volume_loop_3/;
      IFEND;
    FOREND /volume_loop_3/;

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND change_ms_class;
?? OLDTITLE ??
?? NEWTITLE := '  CHANGE_MS_VOLUME', EJECT ??

  PROCEDURE change_ms_volume
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{  PROCEDURE (cmm$lcu_chamsv) change_ms_volume, chamv, chamsv (
{    recorded_vsn, recorded_vsns, rvsn, rv: any of
{        key
{          all
{        keyend
{        list of name 1..6
{      anyend = $required
{    allocation_size, as: key
{        $16k, $32k, $64k, $128k, $256k, $512k
{        (cylinder, c)
{      keyend = $optional
{    transfer_size, ts: key
{        $16k, $32k, $64k, $128k, $256k, $512k
{        (cylinder, c)
{      keyend = $optional
{    status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 9] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 8] of clt$keyword_specification,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 8] of clt$keyword_specification,
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [91, 5, 24, 9, 27, 42, 812],
    clc$command, 9, 4, 1, 0, 0, 0, 4, 'CMM$LCU_CHAMSV'], [
    ['ALLOCATION_SIZE                ',clc$nominal_entry, 2],
    ['AS                             ',clc$abbreviation_entry, 2],
    ['RECORDED_VSN                   ',clc$nominal_entry, 1],
    ['RECORDED_VSNS                  ',clc$alias_entry, 1],
    ['RV                             ',clc$abbreviation_entry, 1],
    ['RVSN                           ',clc$alias_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 4],
    ['TRANSFER_SIZE                  ',clc$nominal_entry, 3],
    ['TS                             ',clc$abbreviation_entry, 3]],
    [
{ PARAMETER 1
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 85, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 303, clc$optional_parameter, 0, 0],
{ PARAMETER 3
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 303, clc$optional_parameter, 0, 0],
{ PARAMETER 4
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type,
    clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, 6]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [8], [
    ['$128K                          ', clc$nominal_entry,
  clc$normal_usage_entry, 4],
    ['$16K                           ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['$256K                          ', clc$nominal_entry,
  clc$normal_usage_entry, 5],
    ['$32K                           ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
    ['$512K                          ', clc$nominal_entry,
  clc$normal_usage_entry, 6],
    ['$64K                           ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['C                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 7],
    ['CYLINDER                       ', clc$nominal_entry,
  clc$normal_usage_entry, 7]]
    ],
{ PARAMETER 3
    [[1, 0, clc$keyword_type], [8], [
    ['$128K                          ', clc$nominal_entry,
  clc$normal_usage_entry, 4],
    ['$16K                           ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['$256K                          ', clc$nominal_entry,
  clc$normal_usage_entry, 5],
    ['$32K                           ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
    ['$512K                          ', clc$nominal_entry,
  clc$normal_usage_entry, 6],
    ['$64K                           ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['C                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 7],
    ['CYLINDER                       ', clc$nominal_entry,
  clc$normal_usage_entry, 7]]
    ],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$recorded_vsn = 1,
      p$allocation_size = 2,
      p$transfer_size = 3,
      p$status = 4;

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

    TYPE
      recorded_vsn_list = record
        recorded_vsn: rmt$recorded_vsn,
        valid: boolean,
      recend;

    VAR
      allocation_size: dmt$allocation_size,
      element_status: iot$unit_status,
      ignore_status: ost$status,
      i: integer,
      index: integer,
      j: integer,
      max_ms_volumes: integer,
      ms_volumes: ^array [1 .. * ] of cmt$mass_storage_volume,
      rvsn_list: ^array [1 .. * ] of recorded_vsn_list,
      scan_p: ^clt$data_value,
      state: cmt$element_state,
      status_p: ^ost$status,
      transfer_size: dmt$transfer_size,
      volume_attributes_p: ^dmt$volume_attributes,
      volume_count: 0 .. 7fffffff(16);

    status.normal := TRUE;

  /main_program/
    BEGIN

      IF (NOT avp$configuration_administrator ()) THEN
        osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration', status);
        RETURN;
      IFEND;
      clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      IF pvt [p$recorded_vsn].value^.kind <> clc$keyword THEN
        volume_count := clp$count_list_elements (pvt [p$recorded_vsn].value);
        PUSH rvsn_list: [1 .. volume_count];
        scan_p := pvt [p$recorded_vsn].value;
        FOR i := 1 TO volume_count DO
          rvsn_list^ [i].recorded_vsn := scan_p^.element_value^.name_value;
          rvsn_list^ [i].valid := FALSE;
          scan_p := scan_p^.link;
        FOREND;
      IFEND;

      cmp$get_ms_volumes (max_ms_volumes);
      PUSH ms_volumes: [1 .. max_ms_volumes];
      cmp$get_ms_volume_info (ms_volumes^);

      FOR i := 1 TO max_ms_volumes DO

{ Check if any of the volumes identified by RECORDED_VSN parameter is not ON.

        cmp$get_element_state_via_lun (ms_volumes^ [i].lun, state);
        IF state <> cmc$on THEN
          IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN
            osp$set_status_abnormal (cmc$configuration_management_id, cme$element_state_not_proper,
                  ms_volumes^ [i].recorded_vsn, status);
            EXIT /main_program/;
          ELSE
            FOR j := 1 TO volume_count DO
              IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
                osp$set_status_abnormal (cmc$configuration_management_id, cme$element_state_not_proper,
                      ms_volumes^ [i].recorded_vsn, status);
                EXIT /main_program/;
              IFEND;
            FOREND;
          IFEND;
        IFEND;

{ Check if any of the volumes identified by RECORDED_VSN parameter is disabled.

        cmp$get_ms_status_via_lun (ms_volumes^ [i].lun, element_status);
        IF element_status.disabled THEN
          IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN
            osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_element_status,
                  ms_volumes^ [i].recorded_vsn, status);
            EXIT /main_program/;
          ELSE
            FOR j := 1 TO volume_count DO
              IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
                osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_element_status,
                      ms_volumes^ [i].recorded_vsn, status);
                EXIT /main_program/;
              IFEND;
            FOREND;
          IFEND;
        IFEND;

        ms_volumes^ [i].on_and_enabled := (state = cmc$on) AND (NOT element_status.disabled);

        IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN
          IF ms_volumes^ [i].on_and_enabled THEN
            ms_volumes^ [i].changed := TRUE;
          IFEND;
        ELSE
          ms_volumes^ [i].changed := FALSE;

        /volume_loop_0/
          FOR j := 1 TO volume_count DO
            IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
              rvsn_list^ [j].valid := TRUE;
              IF ms_volumes^ [i].on_and_enabled THEN
                ms_volumes^ [i].changed := TRUE;
              IFEND;
              EXIT /volume_loop_0/;
            IFEND;
          FOREND /volume_loop_0/;
        IFEND;

      FOREND;

{ Check if a volume identified by RECORDED_VSN parameter invalid or not initialized.

      IF pvt [p$recorded_vsn].value^.kind <> clc$keyword THEN
        FOR j := 1 TO volume_count DO
          IF NOT rvsn_list^ [j].valid THEN
            osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_recorded_vsn,
                  rvsn_list^ [j].recorded_vsn, status);
            EXIT /main_program/;
          IFEND;
        FOREND;
      IFEND;

      IF pvt [p$allocation_size].specified THEN
        IF pvt [p$allocation_size].value^.keyword_value = 'CYLINDER' THEN
          allocation_size := dmc$max_bytes_per_allocation;
        ELSEIF pvt [p$allocation_size].value^.keyword_value = '$16K' THEN
          allocation_size := 16 * dmc$k_multiplier;
        ELSEIF pvt [p$allocation_size].value^.keyword_value = '$32K' THEN
          allocation_size := 32 * dmc$k_multiplier;
        ELSEIF pvt [p$allocation_size].value^.keyword_value = '$64K' THEN
          allocation_size := 64 * dmc$k_multiplier;
        ELSEIF pvt [p$allocation_size].value^.keyword_value = '$128K' THEN
          allocation_size := 128 * dmc$k_multiplier;
        ELSEIF pvt [p$allocation_size].value^.keyword_value = '$256K' THEN
          allocation_size := 256 * dmc$k_multiplier;
        ELSEIF pvt [p$allocation_size].value^.keyword_value = '$512K' THEN
          allocation_size := 512 * dmc$k_multiplier;
        IFEND;
      ELSE
        allocation_size := dmc$unspecified_allocation_size;
      IFEND;

      IF pvt [p$transfer_size].specified THEN
        IF pvt [p$transfer_size].value^.keyword_value = 'CYLINDER' THEN
          transfer_size := dmc$max_transfer_size;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$16K' THEN
          transfer_size := 16 * dmc$k_multiplier;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$32K' THEN
          transfer_size := 32 * dmc$k_multiplier;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$64K' THEN
          transfer_size := 64 * dmc$k_multiplier;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$128K' THEN
          transfer_size := 128 * dmc$k_multiplier;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$256K' THEN
          transfer_size := 256 * dmc$k_multiplier;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$512K' THEN
          transfer_size := 512 * dmc$k_multiplier;
        IFEND;
      ELSE
        transfer_size := dmc$unspecified_transfer_size;
      IFEND;

      PUSH volume_attributes_p: [1 .. 2];

      volume_attributes_p^ [1].keyword := dmc$vol_default_allocation_size;
      volume_attributes_p^ [1].default_allocation_size := allocation_size;
      volume_attributes_p^ [2].keyword := dmc$vol_default_transfer_size;
      volume_attributes_p^ [2].default_transfer_size := transfer_size;

      FOR index := 1 TO max_ms_volumes DO
        IF ms_volumes^ [index].on_and_enabled THEN
          IF ms_volumes^ [index].changed THEN
            cmp$change_volume_attributes (ms_volumes^ [index].lun, volume_attributes_p,
                  ms_volumes^ [index].write_status);
          IFEND;
        IFEND;
      FOREND;

{ Issue error message if an error occurs when writing.

    /volume_loop_3/
      FOR i := 1 TO max_ms_volumes DO
        IF ms_volumes^ [i].on_and_enabled THEN
          IF ms_volumes^ [i].changed THEN
            IF NOT ms_volumes^ [i].write_status.normal THEN
              IF ms_volumes^ [i].write_status.condition = dme$avt_entry_not_found THEN
                osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_recorded_vsn_not_found,
                      ms_volumes^ [i].recorded_vsn, status);
              ELSE
                osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_cannot_write_vol_label,
                      ms_volumes^ [i].recorded_vsn, status);
                osp$append_status_parameter (':', 'Not processed due to peripheral failure', status);
              IFEND;
            IFEND;
          IFEND;
        IFEND;
      FOREND /volume_loop_3/;

    END /main_program/;

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND change_ms_volume;

?? OLDTITLE ??
?? NEWTITLE := '  CREATE_SET', EJECT ??

  PROCEDURE create_set
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (cmm$lcu_cres) create_set, cres (
{   set_name, sn: name = $required
{   master_vsn, mvsn, mv: name 1..6 = $required
{   recover_set, rs: boolean = FALSE
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 8] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [105, 9, 30, 13, 48, 0, 124],
    clc$command, 8, 4, 2, 0, 0, 0, 4, 'CMM$LCU_CRES'], [
    ['MASTER_VSN                     ',clc$nominal_entry, 2],
    ['MV                             ',clc$abbreviation_entry, 2],
    ['MVSN                           ',clc$alias_entry, 2],
    ['RECOVER_SET                    ',clc$nominal_entry, 3],
    ['RS                             ',clc$abbreviation_entry, 3],
    ['SET_NAME                       ',clc$nominal_entry, 1],
    ['SN                             ',clc$abbreviation_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ PARAMETER 1
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$required_parameter, 0
  , 0],
{ PARAMETER 3
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 5],
{ PARAMETER 4
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, 6]],
{ PARAMETER 3
    [[1, 0, clc$boolean_type],
    'FALSE'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$set_name = 1,
      p$master_vsn = 2,
      p$recover_set = 3,
      p$status = 4;

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

    VAR
      logical_unit: iot$logical_unit,
      master_vsn: rmt$recorded_vsn,
      owner: ost$user_identification,
      recover_set: boolean,
      status_p: ^ost$status,
      set_name: stt$set_name;

    IF (NOT avp$configuration_administrator ()) THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration', status);
      RETURN;
    IFEND;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    master_vsn := pvt [p$master_vsn].value^.name_value;
    owner.family := jmc$system_family;
    owner.user := jmc$system_user;
    recover_set := pvt [p$recover_set].value^.boolean_value.value;
    set_name := pvt [p$set_name].value^.name_value;

    stp$create_set (set_name, master_vsn, owner, stc$allow_access, recover_set, status);
    IF status.normal THEN
      cmp$get_unit_number_via_vsn (master_vsn, logical_unit, status);
      IF status.normal THEN
        cmp$activate_volume (logical_unit, status);
      IFEND;
      IF NOT status.normal THEN
        IF status.condition = dme$volume_already_active THEN
          status.normal := TRUE;
        IFEND;
      IFEND;
    IFEND;

    IF status.normal THEN
      pfp$overhaul_set (set_name, $pft$set_overhaul_choices [], status);
    IFEND;

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND create_set;

?? OLDTITLE ??
?? NEWTITLE := '  DEFINE_MS_FLAW', EJECT ??

  PROCEDURE define_ms_flaw
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{  PROCEDURE (cmm$lcu_defmsf) define_ms_flaw, defmf, defmsf (
{    recorded_vsn, rvsn, rv: name 1..6 = $required
{    cylinder, c: integer 0..281474976710655 = $required
{    track, t: integer 0..281474976710655 = $optional
{    sector, s: integer 0..281474976710655 = $optional
{    status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 10] of clt$pdt_parameter_name,
      parameters: array [1 .. 5] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 8, 29, 13, 51, 24, 407],
    clc$command, 10, 5, 2, 0, 0, 0, 5, 'CMM$LCU_DEFMSF'], [
    ['C                              ',clc$abbreviation_entry, 2],
    ['CYLINDER                       ',clc$nominal_entry, 2],
    ['RECORDED_VSN                   ',clc$nominal_entry, 1],
    ['RV                             ',clc$abbreviation_entry, 1],
    ['RVSN                           ',clc$alias_entry, 1],
    ['S                              ',clc$abbreviation_entry, 4],
    ['SECTOR                         ',clc$nominal_entry, 4],
    ['STATUS                         ',clc$nominal_entry, 5],
    ['T                              ',clc$abbreviation_entry, 3],
    ['TRACK                          ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 20, clc$required_parameter, 0, 0],
{ PARAMETER 3
    [10, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 20, clc$optional_parameter, 0, 0],
{ PARAMETER 4
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 20, clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, 6]],
{ PARAMETER 2
    [[1, 0, clc$integer_type], [0, 281474976710655, 10]],
{ PARAMETER 3
    [[1, 0, clc$integer_type], [0, 281474976710655, 10]],
{ PARAMETER 4
    [[1, 0, clc$integer_type], [0, 281474976710655, 10]],
{ PARAMETER 5
    [[1, 0, clc$status_type]]];

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

    CONST
      p$recorded_vsn = 1,
      p$cylinder = 2,
      p$track = 3,
      p$sector = 4,
      p$status = 5;

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

    CONST
      command_name = 'DEFINE_MS_FLAW';

    VAR
      physical_flaw_address_p: ^dmt$physical_flaw_address,
      status_p: ^ost$status,
      recorded_vsn: rmt$recorded_vsn;

    IF (NOT avp$configuration_administrator ()) THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration', status);
      RETURN;
    IFEND;
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    PUSH physical_flaw_address_p;

    recorded_vsn := pvt [p$recorded_vsn].value^.name_value;
    physical_flaw_address_p^.cylinder := pvt [p$cylinder].value^.integer_value.value;
    IF pvt [p$track].specified THEN
      physical_flaw_address_p^.track := pvt [p$track].value^.integer_value.value;
    IFEND;
    IF pvt [p$sector].specified THEN
      physical_flaw_address_p^.sector := pvt [p$sector].value^.integer_value.value;
    IFEND;

    dmp$define_remove_ms_flaw (recorded_vsn, physical_flaw_address_p, pvt [p$track].specified,
          pvt [p$sector].specified, dmc$oc_flaw_define, dmc$ic_operator_initiated, status);
    IF NOT status.normal THEN
      CASE status.condition OF
      = dme$avt_entry_not_found, dme$recorded_vsn_not_in_lun =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_recorded_vsn_not_found,
              command_name, status);

      = dme$cylinder_limit_exceeded =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_cylinder_limit_exceeded,
              command_name, status);

      = dme$track_limit_exceeded =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_track_limit_exceeded, command_name,
              status);

      = dme$flawing_deferred =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_save_flaw_warning, recorded_vsn,
              status);

      = dme$sector_limit_exceeded =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_sector_limit_exceeded, command_name,
              status);

      = dme$logging_unavailable =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_logging_not_active, command_name,
              status);

      = dme$address_already_flawed =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_address_already_flawed,
              command_name, status);

      = dme$unaddressable_sector =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_unaddressable_sector, command_name,
              status);
      ELSE
        ;
      CASEND;
    IFEND;

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND define_ms_flaw;

?? OLDTITLE ??
?? NEWTITLE := '  DISPLAY_MAINFRAME_CONFIGURATION', EJECT ??

*block

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

{ PROCEDURE (cmm$lcu_dismc) cmp$display_mf_configuration, dismc (
{   elements, element, e: any of
{       key
{         all
{       keyend
{       list of key
{         $channel
{         ($channel_adapter, $ca)
{         ($communications_element, $ce)
{         $controller
{         ($external_processor, $ep)
{         ($storage_device, $sd)
{       keyend
{       list of name
{     anyend = ALL
{   display_options, display_option, do: any of
{       key
{         all
{       keyend
{       list of key
{         (active_paths, ap)
{         (application_information, ai)
{         (connection_status, cs)
{         (disabled_paths, dp)
{         (element_identification, ei)
{         (inactive_paths, ip)
{         (iou_program_name, ioupn, ipn)
{         (ms_class, msc, mc)
{         (parity_status, ps)
{         (physical_connections, pc)
{         (physical_paths, pp)
{         (recorded_vsn, rvsn, rv)
{         (serial_number, sn)
{         (site_information, si)
{         (state, s)
{       keyend
{     anyend = all
{   iou, i: name = IOU0
{   output, o: file = $OUTPUT
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 11] of clt$pdt_parameter_name,
      parameters: array [1 .. 5] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 10] of clt$keyword_specification,
          recend,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
        default_value: string (3),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 33] of clt$keyword_specification,
          recend,
        recend,
        default_value: string (3),
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [105, 12, 19, 12, 44, 21, 167],
    clc$command, 11, 5, 0, 0, 0, 0, 5, 'CMM$LCU_DISMC'], [
    ['DISPLAY_OPTION                 ',clc$alias_entry, 2],
    ['DISPLAY_OPTIONS                ',clc$nominal_entry, 2],
    ['DO                             ',clc$abbreviation_entry, 2],
    ['E                              ',clc$abbreviation_entry, 1],
    ['ELEMENT                        ',clc$alias_entry, 1],
    ['ELEMENTS                       ',clc$nominal_entry, 1],
    ['I                              ',clc$abbreviation_entry, 3],
    ['IOU                            ',clc$nominal_entry, 3],
    ['O                              ',clc$abbreviation_entry, 4],
    ['OUTPUT                         ',clc$nominal_entry, 4],
    ['STATUS                         ',clc$nominal_entry, 5]],
    [
{ PARAMETER 1
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 482,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 2
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 1308,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 3
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 4
    [10, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 5
    [11, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 3],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    393, [[1, 0, clc$list_type], [377, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [10], [
        ['$CA                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['$CE                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['$CHANNEL                       ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['$CHANNEL_ADAPTER               ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['$COMMUNICATIONS_ELEMENT        ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['$CONTROLLER                    ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['$EP                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['$EXTERNAL_PROCESSOR            ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['$SD                            ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
        ['$STORAGE_DEVICE                ', clc$nominal_entry, clc$normal_usage_entry, 6]]
        ]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ,
    'ALL'],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    1244, [[1, 0, clc$list_type], [1228, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [33], [
        ['ACTIVE_PATHS                   ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['AI                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['AP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['APPLICATION_INFORMATION        ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['CONNECTION_STATUS              ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['CS                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['DISABLED_PATHS                 ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['DP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['EI                             ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['ELEMENT_IDENTIFICATION         ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['INACTIVE_PATHS                 ', clc$nominal_entry, clc$normal_usage_entry, 6],
        ['IOUPN                          ', clc$alias_entry, clc$normal_usage_entry, 7],
        ['IOU_PROGRAM_NAME               ', clc$nominal_entry, clc$normal_usage_entry, 7],
        ['IP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
        ['IPN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
        ['MC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 8],
        ['MSC                            ', clc$alias_entry, clc$normal_usage_entry, 8],
        ['MS_CLASS                       ', clc$nominal_entry, clc$normal_usage_entry, 8],
        ['PARITY_STATUS                  ', clc$nominal_entry, clc$normal_usage_entry, 9],
        ['PC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 10],
        ['PHYSICAL_CONNECTIONS           ', clc$nominal_entry, clc$normal_usage_entry, 10],
        ['PHYSICAL_PATHS                 ', clc$nominal_entry, clc$normal_usage_entry, 11],
        ['PP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 11],
        ['PS                             ', clc$abbreviation_entry, clc$normal_usage_entry, 9],
        ['RECORDED_VSN                   ', clc$nominal_entry, clc$normal_usage_entry, 12],
        ['RV                             ', clc$abbreviation_entry, clc$normal_usage_entry, 12],
        ['RVSN                           ', clc$alias_entry, clc$normal_usage_entry, 12],
        ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 15],
        ['SERIAL_NUMBER                  ', clc$nominal_entry, clc$normal_usage_entry, 13],
        ['SI                             ', clc$abbreviation_entry, clc$normal_usage_entry, 14],
        ['SITE_INFORMATION               ', clc$nominal_entry, clc$normal_usage_entry, 14],
        ['SN                             ', clc$abbreviation_entry, clc$normal_usage_entry, 13],
        ['STATE                          ', clc$nominal_entry, clc$normal_usage_entry, 15]]
        ]
      ]
    ,
    'all'],
{ PARAMETER 3
    [[1, 0, clc$name_type], [1, osc$max_name_size],
    'IOU0'],
{ PARAMETER 4
    [[1, 0, clc$file_type],
    '$OUTPUT'],
{ PARAMETER 5
    [[1, 0, clc$status_type]]];

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

    CONST
      p$elements = 1,
      p$display_options = 2,
      p$iou = 3,
      p$output = 4,
      p$status = 5;

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

*copyc clv$display_variables
*copyc cmc$minimum_page_size

    CONST
      command_name = 'DISPLAY_MAINFRAME_CONFIGURATION';

    VAR
      caller_id: ost$caller_identifier,
      display_control: clt$display_control,
      display_option: cmt$display_option,
      element_count: integer,
      element_option_key: cmt$lcu_display_option_key,
      file: clt$file,
      header: string (50),
      i: integer,
      ignore_status: ost$status,
      iou_name: cmt$element_name,
      lc_element: ^array [1 .. * ] of cmt$element_definition,
      keyword: clt$keyword,
      output_open: boolean,
      scan_p: ^clt$data_value;

?? NEWTITLE := '    abort_handler', EJECT ??

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

      IF output_open THEN
        clp$close_display (display_control, ignore_status);
        output_open := FALSE;
      IFEND;

    PROCEND abort_handler;

*copyc clp$new_page_procedure

?? OLDTITLE ??
?? NEWTITLE := '    put_subtitle', EJECT ??

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

      clp$put_partial_display (display_control, header, clc$trim, amc$continue, status);

    PROCEND put_subtitle;

?? OLDTITLE, EJECT ??

    #caller_id (caller_id);
    status.normal := TRUE;
    header := 'ACTIVE PHYSICAL CONFIGURATION';
    output_open := FALSE;
    osp$establish_block_exit_hndlr (^abort_handler);

  /main_program/
    BEGIN

      validate_command_usage (status);
      IF caller_id.ring > 6 THEN
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
      IFEND;
      clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      cmp$get_number_of_element (element_count, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      IF element_count = 0 THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_eoi_not_returned,
              'Zero element count returned by CMP$GET_NUMBER_OF_ELEMENT', status);
        EXIT /main_program/;
      IFEND;

      PUSH lc_element: [1 .. element_count];

      cmp$copy_active_configuration (lc_element, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      clp$convert_string_to_file (pvt [p$output].value^.file_value^, file, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      clp$open_display (file, ^clp$new_page_procedure, display_control, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      output_open := TRUE;

      IF display_control.page_width < cmc$minimum_page_size THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_illegal_output_file,
              file.local_file_name, status);
        osp$append_status_integer (osc$status_parameter_delimiter, cmc$minimum_page_size, 10, FALSE, status);
        EXIT /main_program/;
      IFEND;

      clv$titles_built := FALSE;
      clv$command_name := command_name;

      display_option := $cmt$display_option [];
      IF pvt [p$display_options].value^.kind = clc$keyword THEN
        IF pvt [p$display_options].value^.keyword_value = 'ALL' THEN
          display_option := display_option + $cmt$display_option [cmc$all_kw];
        IFEND;
      ELSE
        scan_p := pvt [p$display_options].value;
        WHILE scan_p <> NIL DO
          keyword := scan_p^.element_value^.keyword_value;
          IF keyword = 'ACTIVE_PATHS' THEN
            display_option := display_option + $cmt$display_option [cmc$active_paths_kw];
          ELSEIF keyword = 'APPLICATION_INFORMATION' THEN
            display_option := display_option + $cmt$display_option [cmc$application_info_kw];
          ELSEIF keyword = 'CONNECTION_STATUS' THEN
            display_option := display_option + $cmt$display_option [cmc$connection_status_kw];
          ELSEIF keyword = 'DISABLED_PATHS' THEN
            display_option := display_option + $cmt$display_option [cmc$disabled_paths_kw];
          ELSEIF keyword = 'ELEMENT_IDENTIFICATION' THEN
            display_option := display_option + $cmt$display_option [cmc$element_id_kw];
          ELSEIF keyword = 'INACTIVE_PATHS' THEN
            display_option := display_option + $cmt$display_option [cmc$inactive_paths_kw];
          ELSEIF keyword = 'IOU_PROGRAM_NAME' THEN
            display_option := display_option + $cmt$display_option [cmc$ioupn_kw];
          ELSEIF keyword = 'MS_CLASS' THEN
            display_option := display_option + $cmt$display_option [cmc$ms_class_kw];
          ELSEIF keyword = 'PARITY_STATUS' THEN
            display_option := display_option + $cmt$display_option [cmc$parity_status_kw];
          ELSEIF keyword = 'PHYSICAL_CONNECTIONS' THEN
            display_option := display_option + $cmt$display_option [cmc$physical_connection_kw];
          ELSEIF keyword = 'PHYSICAL_PATHS' THEN
            display_option := display_option + $cmt$display_option [cmc$physical_paths_kw];
          ELSEIF keyword = 'RECORDED_VSN' THEN
            display_option := display_option + $cmt$display_option [cmc$recorded_vsn_kw];
          ELSEIF keyword = 'SERIAL_NUMBER' THEN
            display_option := display_option + $cmt$display_option [cmc$serial_number_kw];
          ELSEIF keyword = 'SITE_INFORMATION' THEN
            display_option := display_option + $cmt$display_option [cmc$site_info_kw];
          ELSEIF keyword = 'STATE' THEN
            display_option := display_option + $cmt$display_option [cmc$state_kw];
          ELSE
            ;
          IFEND;
          scan_p := scan_p^.link;
        WHILEND;
      IFEND;
      iou_name := pvt [p$iou].value^.name_value;
      IF pvt [p$elements].value^.kind = clc$keyword THEN
        IF pvt [p$elements].value^.keyword_value = 'ALL' THEN

{ Since some device types may not be present on all mainframes, use IGNORE_STATUS for DO=ALL.

          cmp$display_type_elements (cmc$data_channel_element, display_option, element_count, lc_element,
                  display_control, ignore_status);
          cmp$display_type_elements (cmc$channel_adapter_element, display_option, element_count, lc_element,
                  display_control, ignore_status);
          cmp$display_type_elements (cmc$communications_element, display_option, element_count, lc_element,
                  display_control, ignore_status);
          cmp$display_type_elements (cmc$controller_element, display_option, element_count, lc_element,
                  display_control, ignore_status);
          cmp$display_type_elements (cmc$storage_device_element, display_option, element_count, lc_element,
                  display_control, ignore_status);
          cmp$display_type_elements (cmc$external_processor_element, display_option, element_count,
                  lc_element, display_control, ignore_status);
        IFEND;
      ELSE
        scan_p := pvt [p$elements].value;
        WHILE scan_p <> NIL DO
          CASE scan_p^.element_value^.kind OF
          = clc$name =
            cmp$display_named_element (scan_p^.element_value^.name_value, iou_name, display_option,
                  element_count, lc_element, display_control, status);
            IF NOT status.normal THEN
              EXIT /main_program/;
            IFEND;
          = clc$keyword =
            keyword := scan_p^.element_value^.keyword_value;
            IF keyword = '$CHANNEL' THEN
              cmp$display_type_elements (cmc$data_channel_element, display_option, element_count, lc_element,
                    display_control, status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
            ELSEIF keyword = '$CHANNEL_ADAPTER' THEN
              cmp$display_type_elements (cmc$channel_adapter_element, display_option, element_count,
                    lc_element, display_control, status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
            ELSEIF keyword = '$COMMUNICATIONS_ELEMENT' THEN
              cmp$display_type_elements (cmc$communications_element, display_option, element_count,
                  lc_element, display_control, status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
            ELSEIF keyword = '$CONTROLLER' THEN
              cmp$display_type_elements (cmc$controller_element, display_option, element_count, lc_element,
                    display_control, status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
            ELSEIF keyword = '$EXTERNAL_PROCESSOR' THEN
              cmp$display_type_elements (cmc$external_processor_element, display_option, element_count,
                    lc_element, display_control, status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
            ELSEIF keyword = '$STORAGE_DEVICE' THEN
              cmp$display_type_elements (cmc$storage_device_element, display_option, element_count,
                   lc_element, display_control, status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
            ELSE
              ;
            IFEND;
          ELSE
            ;
          CASEND;
          scan_p := scan_p^.link;
        WHILEND;
      IFEND;
    END /main_program/;

    IF output_open THEN
      clp$close_display (display_control, ignore_status);
      output_open := FALSE;
    IFEND;

    osp$disestablish_cond_handler;

  PROCEND cmp$display_mf_configuration;
*blockend

?? OLDTITLE ??
?? NEWTITLE := '  DISPLAY_MS_CLASS', EJECT ??

*block
?? RIGHT := 110 ??

  PROCEDURE display_ms_class
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (cmm$lcu_dismsc) display_ms_class, display_ms_classes, dismsc (
{   recorded_vsn, recorded_vsns, rvsn, rv: any of
{       key
{         all
{       keyend
{       list of name 1..6
{     anyend = ALL
{   output, o: file = $OUTPUT
{   display_options, display_option, do: list of key
{       all
{       (set_name, sn)
{       (mass_storage_class, mass_storage_classes, msc)
{       (compact_mass_storage_class, compact_mass_storage_classes, cmsc)
{       (class_explanation, dce)
{     advanced_key
{       (internal_vsn, ivsn, iv)
{     keyend = cmd$dismsc_display_options, mass_storage_class
{   sort_option, so: key
{       (set_table_order, sto)
{       (recorded_vsn, rvsn, vsn)
{       (set_name_and_recorded_vsn, set_name_and_rvsn, snarv, set_name_and_vsn, snarvsn, snavsn)
{     keyend = recorded_vsn
{   selected_sets, ss: any of
{       key
{         all
{       keyend
{       list of name
{     anyend = all
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 14] of clt$pdt_parameter_name,
      parameters: array [1 .. 6] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
        default_value: string (3),
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 14] of clt$keyword_specification,
        recend,
        default_name: string (26),
        default_value: string (18),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 11] of clt$keyword_specification,
        default_value: string (12),
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
        default_value: string (3),
      recend,
      type6: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [105, 12, 19, 14, 0, 55, 68],
    clc$command, 14, 6, 0, 0, 0, 0, 6, 'CMM$LCU_DISMSC'], [
    ['DISPLAY_OPTION                 ',clc$alias_entry, 3],
    ['DISPLAY_OPTIONS                ',clc$nominal_entry, 3],
    ['DO                             ',clc$abbreviation_entry, 3],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['RECORDED_VSN                   ',clc$nominal_entry, 1],
    ['RECORDED_VSNS                  ',clc$alias_entry, 1],
    ['RV                             ',clc$abbreviation_entry, 1],
    ['RVSN                           ',clc$alias_entry, 1],
    ['SELECTED_SETS                  ',clc$nominal_entry, 5],
    ['SO                             ',clc$abbreviation_entry, 4],
    ['SORT_OPTION                    ',clc$nominal_entry, 4],
    ['SS                             ',clc$abbreviation_entry, 5],
    ['STATUS                         ',clc$nominal_entry, 6]],
    [
{ PARAMETER 1
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 85,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 2
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 3
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 541,
  clc$optional_default_parameter, 26, 18],
{ PARAMETER 4
    [12, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 414,
  clc$optional_default_parameter, 0, 12],
{ PARAMETER 5
    [10, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 85,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 6
    [14, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, 6]]
      ]
    ,
    'ALL'],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$OUTPUT'],
{ PARAMETER 3
    [[1, 0, clc$list_type], [525, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$keyword_type], [14], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['CLASS_EXPLANATION              ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['CMSC                           ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['COMPACT_MASS_STORAGE_CLASS     ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['COMPACT_MASS_STORAGE_CLASSES   ', clc$alias_entry, clc$normal_usage_entry, 4],
      ['DCE                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['INTERNAL_VSN                   ', clc$nominal_entry, clc$advanced_usage_entry, 6],
      ['IV                             ', clc$abbreviation_entry, clc$advanced_usage_entry, 6],
      ['IVSN                           ', clc$alias_entry, clc$advanced_usage_entry, 6],
      ['MASS_STORAGE_CLASS             ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['MASS_STORAGE_CLASSES           ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['MSC                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['SET_NAME                       ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['SN                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2]]
      ]
    ,
    'CMD$DISMSC_DISPLAY_OPTIONS',
    'mass_storage_class'],
{ PARAMETER 4
    [[1, 0, clc$keyword_type], [11], [
    ['RECORDED_VSN                   ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['RVSN                           ', clc$alias_entry, clc$normal_usage_entry, 2],
    ['SET_NAME_AND_RECORDED_VSN      ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['SET_NAME_AND_RVSN              ', clc$alias_entry, clc$normal_usage_entry, 3],
    ['SET_NAME_AND_VSN               ', clc$alias_entry, clc$normal_usage_entry, 3],
    ['SET_TABLE_ORDER                ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['SNARV                          ', clc$alias_entry, clc$normal_usage_entry, 3],
    ['SNARVSN                        ', clc$alias_entry, clc$normal_usage_entry, 3],
    ['SNAVSN                         ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['STO                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['VSN                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2]]
    ,
    'recorded_vsn'],
{ PARAMETER 5
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ,
    'all'],
{ PARAMETER 6
    [[1, 0, clc$status_type]]];

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

    CONST
      p$recorded_vsn = 1,
      p$output = 2,
      p$display_options = 3,
      p$sort_option = 4,
      p$selected_sets = 5,
      p$status = 6;

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

*copy clv$display_variables
*copy cmc$minimum_page_size

    TYPE
      t$display_options = set of t$display_option,
      t$display_option = (c$do_set_name, c$do_class, c$do_compact_class, c$do_class_explanation, c$do_ivsn),
      t$selected_sets = array [1 .. * ] of ost$name,
      t$sort_option = (c$so_none, c$so_vsn, c$so_set_and_vsn),
      t$vsn_entry = record
        vsn: rmt$recorded_vsn,
        displayed: boolean,
      recend,
      t$vsn_list = array [1 .. * ] of t$vsn_entry;

    VAR
      display_control: clt$display_control,
      display_options: t$display_options,
      header: string (50),
      i: integer,
      j: integer,
      number_of_vol: integer,
      ring_attributes: amt$ring_attributes,
      selected_sets_p: ^t$selected_sets,
      sort_option: t$sort_option,
      str: ost$string,
      value_p: ^clt$data_value,
      volume_list: ^stt$volume_list,
      vsn_list_p: ^t$vsn_list,
      vsn_found: boolean,
      vsn: rmt$recorded_vsn;

?? NEWTITLE := 'ABORT_HANDLER', EJECT ??

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

      IF display_control.file_id <> amv$nil_file_identifier THEN
        clp$close_display (display_control, status);
        display_control := clv$nil_display_control;
      IFEND;

    PROCEND abort_handler;

*copy clp$new_page_procedure

?? OLDTITLE ??
?? NEWTITLE := 'PUT_SUBTITLE', EJECT ??

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

      clp$put_partial_display (display_control, header, clc$trim, amc$continue, status);

    PROCEND put_subtitle;

?? OLDTITLE ??
?? NEWTITLE := 'F$GREATER', EJECT ??

    FUNCTION [INLINE] f$greater
      (    sort_option: t$sort_option;
           entry1: stt$volume_info;
           entry2: stt$volume_info): boolean;

      VAR
        str1: string (31 + 6),
        str2: string (31 + 6);

      CASE sort_option OF
      = c$so_vsn =
        f$greater := entry1.recorded_vsn > entry2.recorded_vsn;
      = c$so_set_and_vsn =
        str1 := entry1.set_name;
        str1 (32, 6) := entry1.recorded_vsn;
        str2 := entry2.set_name;
        str2 (32, 6) := entry2.recorded_vsn;
        f$greater := str1 > str2;
      CASEND;

    FUNCEND f$greater;
?? OLDTITLE ??
?? NEWTITLE := 'F$SET_SELECTED', EJECT ??

    FUNCTION [INLINE] f$set_selected
      (    set_name: ost$name;
           selected_sets_p: ^t$selected_sets): boolean;

      VAR
        i: integer;

      IF selected_sets_p = NIL THEN
        f$set_selected := TRUE;
        RETURN; {----->
      IFEND;

      FOR i := 1 TO UPPERBOUND (selected_sets_p^) DO
        IF selected_sets_p^ [i] = set_name THEN
          f$set_selected := TRUE;
          RETURN; {----->
        IFEND;
      FOREND;

      f$set_selected := FALSE;

    FUNCEND f$set_selected;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_CLASSES', EJECT ??

    PROCEDURE p$put_classes
      (    display_options: t$display_options;
           volume_info: stt$volume_info;
       VAR display_control: clt$display_control);

      VAR
        ivsn: ost$name,
        local_status: ost$status,
        ms_class: cmt$ms_class_members,
        ms_class_info: cmt$ms_class_info,
        str: ost$string,
        volume_found: boolean;

      cmp$get_ms_class_on_volume (volume_info.recorded_vsn, volume_found, ms_class_info);
      IF NOT volume_found THEN
        RETURN; {----->
      IFEND;

      IF f$set_selected (volume_info.set_name, selected_sets_p) THEN
        fip#addl_initialize (str, ' ');
        fip#addl_string (str, volume_info.recorded_vsn);

        IF c$do_set_name IN display_options THEN
          fip#addl_string (str, '  ');
          fip#addl_string (str, volume_info.set_name (1, 15));
        IFEND;

        IF c$do_ivsn IN display_options THEN
          pmp$convert_binary_unique_name (volume_info.internal_vsn, ivsn, local_status);
          IF local_status.normal THEN
            fip#addl_string (str, '  ');
            fip#addl_string (str, ivsn);
          ELSE
            fip#addl_string (str, '                                 ');
          IFEND;
        IFEND;

        IF c$do_class IN display_options THEN
          fip#addl_string (str, '   ');

          FOR ms_class := LOWERBOUND (ms_class_info.classes) TO UPPERBOUND (ms_class_info.classes) DO
            IF ms_class_info.classes [ms_class] THEN
              str.value (str.size) := ms_class;
            IFEND;
            str.size := str.size + 2;
          FOREND;

        ELSEIF c$do_compact_class IN display_options THEN
          fip#addl_string (str, '   ');

          FOR ms_class := LOWERBOUND (ms_class_info.classes) TO UPPERBOUND (ms_class_info.classes) DO
            IF ms_class_info.classes [ms_class] THEN
              fip#addl_char (str, ms_class);
              fip#addl_string (str, ',');
            IFEND;
          FOREND;
          str.size := str.size - 1;
        IFEND;

        clp$put_display (display_control, str.value (1, str.size), clc$no_trim, status);
      IFEND;

    PROCEND p$put_classes;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_CLASSES', EJECT ??

    PROCEDURE p$put_volume_not_found
      (    vsn: rmt$recorded_vsn;
       VAR display_control: clt$display_control);

      VAR
        ms_class: cmt$ms_class_members,
        ms_class_info: cmt$ms_class_info,
        str: ost$string,
        volume_found: boolean;

      cmp$get_ms_class_on_volume (vsn, volume_found, ms_class_info);
      IF volume_found THEN
        fip#addl_initialize (str, ' ');
        fip#addl_string (str, vsn);

        IF c$do_set_name IN display_options THEN
          fip#addl_string (str, '  ');
          fip#addl_string (str, 'not in any set ');
        IFEND;

        IF c$do_ivsn IN display_options THEN
          fip#addl_string (str, '                                 ');
        IFEND;

        IF c$do_class IN display_options THEN
          fip#addl_string (str, '   ');

          FOR ms_class := LOWERBOUND (ms_class_info.classes) TO UPPERBOUND (ms_class_info.classes) DO
            IF ms_class_info.classes [ms_class] THEN
              str.value (str.size) := ms_class;
            IFEND;
            str.size := str.size + 2;
          FOREND;

        ELSEIF c$do_compact_class IN display_options THEN
          fip#addl_string (str, '   ');

          FOR ms_class := LOWERBOUND (ms_class_info.classes) TO UPPERBOUND (ms_class_info.classes) DO
            IF ms_class_info.classes [ms_class] THEN
              fip#addl_char (str, ms_class);
              fip#addl_string (str, ',');
            IFEND;
          FOREND;
          str.size := str.size - 1;
        IFEND;

        clp$put_display (display_control, str.value (1, str.size), clc$no_trim, status);
      ELSE
        fip#addl_initialize (str, ' ');
        fip#addl_string (str, vsn);
        fip#addl_string (str, '  -- not found');

        clp$put_display (display_control, str.value (1, str.size), clc$no_trim, status);
      IFEND;

    PROCEND p$put_volume_not_found;
?? OLDTITLE ??
?? NEWTITLE := 'P$PUT_DISPLAY', EJECT ??

    PROCEDURE p$put_display
      (    str: string ( * ));

      clp$put_display (display_control, str, clc$no_trim, status);
      IF NOT status.normal THEN
        EXIT display_ms_class; {----->
      IFEND;

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

    PROCEDURE [INLINE] p$sort_entries
      (    sort_option: t$sort_option;
           number_of_vol: integer;
       VAR entries: stt$volume_list);

      VAR
        current: integer,
        gap: integer,
        start: integer,
        swap: stt$volume_info;

      gap := number_of_vol;
      WHILE gap > 1 DO
        gap := 2 * (gap DIV 4) + 1;
        FOR start := 1 TO number_of_vol - gap DO
          current := start;
          WHILE (current > 0) AND f$greater (sort_option, entries [current], entries [current + gap]) 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 ??
    validate_command_usage (status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

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

{Evaluate Display_Options
    value_p := pvt [p$display_options].value;
    display_options := $t$display_options [];

    WHILE (value_p <> NIL) AND (value_p^.kind = clc$list) DO
      IF (value_p^.element_value <> NIL) AND (value_p^.element_value^.kind = clc$keyword) THEN
        IF value_p^.element_value^.keyword_value = 'ALL' THEN
          display_options := display_options + (-$t$display_options [c$do_compact_class]);
        ELSEIF value_p^.element_value^.keyword_value = 'SET_NAME' THEN
          display_options := display_options + $t$display_options [c$do_set_name];
        ELSEIF value_p^.element_value^.keyword_value = 'MASS_STORAGE_CLASS' THEN
          display_options := display_options + $t$display_options [c$do_class];
        ELSEIF value_p^.element_value^.keyword_value = 'COMPACT_MASS_STORAGE_CLASS' THEN
          display_options := display_options + $t$display_options [c$do_compact_class];
        ELSEIF value_p^.element_value^.keyword_value = 'CLASS_EXPLANATION' THEN
          display_options := display_options + $t$display_options [c$do_class_explanation];
        ELSEIF value_p^.element_value^.keyword_value = 'INTERNAL_VSN' THEN
          display_options := display_options + $t$display_options [c$do_ivsn];
        IFEND;
      IFEND;
      value_p := value_p^.link;
    WHILEND;

{Evaluate Sort_Options
    sort_option := c$so_none;
    IF (pvt [p$sort_option].value <> NIL) AND (pvt [p$sort_option].value^.kind = clc$keyword) THEN
      IF pvt [p$sort_option].value^.keyword_value = 'RECORDED_VSN' THEN
        sort_option := c$so_vsn;
      ELSEIF pvt [p$sort_option].value^.keyword_value = 'SET_NAME_AND_RECORDED_VSN' THEN
        sort_option := c$so_set_and_vsn;
      IFEND;
    IFEND;

{Evaluate Selected Sets
    IF (pvt [p$selected_sets].value <> NIL) AND (pvt [p$selected_sets].value^.kind = clc$keyword) THEN
      selected_sets_p := NIL;
    ELSE
      PUSH selected_sets_p: [1 .. clp$count_list_elements (pvt [p$selected_sets].value)];
      value_p := pvt [p$selected_sets].value;
      i := 1;

      WHILE (value_p <> NIL) AND (value_p^.kind = clc$list) DO
        selected_sets_p^ [i] := value_p^.element_value^.name_value;
        value_p := value_p^.link;
        i := i + 1;
      WHILEND;
    IFEND;

    header := ' MASS STORAGE CLASS ASSIGNMENTS';
    display_control := clv$nil_display_control;
    osp$establish_block_exit_hndlr (^abort_handler);

    ring_attributes.r1 := #RING (^ring_attributes);
    ring_attributes.r2 := #RING (^ring_attributes);
    ring_attributes.r3 := #RING (^ring_attributes);

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

    IF display_control.page_width < cmc$minimum_page_size THEN
      osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_illegal_output_file,
            pvt [p$output].value^.file_value^, status);
      osp$append_status_integer (osc$status_parameter_delimiter, cmc$minimum_page_size, 10, FALSE, status);
      RETURN; {----->
    IFEND;

    clv$titles_built := FALSE;
    clv$command_name := 'display_ms_class';

    IF (display_options * $t$display_options [c$do_set_name, c$do_ivsn, c$do_class,
          c$do_compact_class]) <> $t$display_options [] THEN

      fip#addl_initialize (str, ' Volume');
      IF c$do_set_name IN display_options THEN
        fip#addl_string (str, '  Set Name       ');
      IFEND;

      IF c$do_ivsn IN display_options THEN
        fip#addl_string (str, '  Internal VSN                   ');
      IFEND;

      IF c$do_class IN display_options THEN
        fip#addl_string (str, '                        Class');
      ELSEIF c$do_compact_class IN display_options THEN
        fip#addl_string (str, '   Class');
      IFEND;

      p$put_display (str.value (1, str.size));
      p$put_display (' ');

      IF c$do_class IN display_options THEN
        fip#addl_initialize (str, ' VSN   ');
        IF c$do_set_name IN display_options THEN
          fip#addl_string (str, '  Set Name       ');
        IFEND;
        fip#addl_string (str, '  A B C D E F G H I J K L M N O P Q R S T U V W X Y Z');
        p$put_display (str.value (1, str.size));
        p$put_display (' ');
        p$put_display (' ');
      IFEND;

      cmp$obtain_max_volume_index (number_of_vol);
      REPEAT
        PUSH volume_list: [1 .. number_of_vol];
        cmp$obtain_volumes (volume_list, number_of_vol);
      UNTIL number_of_vol <= UPPERBOUND (volume_list^);

      IF sort_option <> c$so_none THEN
        p$sort_entries (sort_option, number_of_vol, volume_list^);
      IFEND;

      IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN
        FOR i := 1 TO number_of_vol DO
          p$put_classes (display_options, volume_list^ [i], display_control);
        FOREND;

      ELSEIF sort_option = c$so_none THEN {output the VSNs in the specified order
        value_p := pvt [p$recorded_vsn].value;

        WHILE (value_p <> NIL) AND (value_p^.kind = clc$list) DO
          vsn := value_p^.element_value^.name_value;
          vsn_found := FALSE;

        /find_volume_1/
          FOR i := 1 TO number_of_vol DO
            IF vsn = volume_list^ [i].recorded_vsn THEN
              vsn_found := TRUE;
              p$put_classes (display_options, volume_list^ [i], display_control);
              EXIT /find_volume_1/; {----->
            IFEND
          FOREND /find_volume_1/;

          IF NOT vsn_found THEN
            p$put_volume_not_found (vsn, display_control);
          IFEND;

          value_p := value_p^.link;
        WHILEND;

      ELSE
        PUSH vsn_list_p: [1 .. clp$count_list_elements (pvt [p$recorded_vsn].value)];
        value_p := pvt [p$recorded_vsn].value;
        i := 1;

        WHILE (value_p <> NIL) AND (value_p^.kind = clc$list) DO
          vsn_list_p^ [i].vsn := value_p^.element_value^.name_value;
          vsn_list_p^ [i].displayed := FALSE;
          value_p := value_p^.link;
          i := i + 1;
        WHILEND /find_volume_2/;

        FOR i := 1 TO number_of_vol DO

        /find_volume_2/
          FOR j := 1 TO UPPERBOUND (vsn_list_p^) DO
            IF vsn_list_p^ [j].vsn = volume_list^ [i].recorded_vsn THEN
              vsn_list_p^ [j].displayed := TRUE;
              p$put_classes (display_options, volume_list^ [i], display_control);
              EXIT /find_volume_2/; {----->
            IFEND;
          FOREND /find_volume_2/;
        FOREND;

        FOR j := 1 TO UPPERBOUND (vsn_list_p^) DO
          IF NOT vsn_list_p^ [j].displayed THEN
            p$put_volume_not_found (vsn_list_p^ [j].vsn, display_control);
          IFEND;
        FOREND;
      IFEND;
    IFEND;

    IF c$do_class_explanation IN display_options THEN
      p$put_display ('     ');
      p$put_display (' Class C: System swap files.');
      p$put_display (' Class J: System catalogs and subcatalogs.');
      p$put_display (' Class K: System permanent files.');
      p$put_display (' Class L: User catalogs and subcatalogs.');
      p$put_display (' Class M: User permanent files.');
      p$put_display (' Class N: User temporary files.');
      p$put_display (' Class P: System product files.');
      p$put_display (' Class Q: System critical files.');
      p$put_display (' Class U to Z: Reserved for Site Analyst use.');
      p$put_display (' All other file classes are reserved for FIDES Information Services.');
    IFEND;

    IF display_control.file_id <> amv$nil_file_identifier THEN
      clp$close_display (display_control, status);
      display_control := clv$nil_display_control;
    IFEND;

    osp$disestablish_cond_handler;

  PROCEND display_ms_class;

*blockend

?? OLDTITLE ??
?? NEWTITLE := '  DISPLAY_MS_FLAW', EJECT ??

  PROCEDURE display_ms_flaw
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{   PROCEDURE (cmm$lcu_dismsf) display_ms_flaws, display_ms_flaw,dismf, dismsf (
{     recorded_vsn, recorded_vsns, rvsn, rv: any of
{         key
{           all
{         keyend
{         list of name 1..6
{       anyend = ALL
{     display_option, do: key
{         (effect, e)
{         (source, s)
{       keyend = EFFECT
{     output, o: file = $OUTPUT
{     status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 9] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
        default_value: string (3),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (6),
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 8, 29, 13, 59, 5, 832],
    clc$command, 9, 4, 0, 0, 0, 0, 4, 'CMM$LCU_DISMSF'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 2],
    ['DO                             ',clc$abbreviation_entry, 2],
    ['O                              ',clc$abbreviation_entry, 3],
    ['OUTPUT                         ',clc$nominal_entry, 3],
    ['RECORDED_VSN                   ',clc$nominal_entry, 1],
    ['RECORDED_VSNS                  ',clc$alias_entry, 1],
    ['RV                             ',clc$abbreviation_entry, 1],
    ['RVSN                           ',clc$alias_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ PARAMETER 1
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 85, clc$optional_default_parameter, 0, 3],
{ PARAMETER 2
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 155, clc$optional_default_parameter, 0, 6],
{ PARAMETER 3
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_default_parameter, 0, 7],
{ PARAMETER 4
    [9, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type,
    clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$name_type], [1, 6]]
      ]
    ,
    'ALL'],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [4], [
    ['E                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
    ['EFFECT                         ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['S                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
    ['SOURCE                         ', clc$nominal_entry,
  clc$normal_usage_entry, 2]]
    ,
    'EFFECT'],
{ PARAMETER 3
    [[1, 0, clc$file_type],
    '$OUTPUT'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

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

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

    CONST
      command_name = 'DISPLAY_MS_FLAW';

    VAR
      big_enough_array: boolean,
      close_status: ost$status,
      display_control: clt$display_control,
      file_contents: amt$file_contents,
      flaw_dau_information_p: ^array [1 .. * ] of dmt$flaw_dau_definition,
      flaw_duplication_index: integer,
      flaw_duplication_p: ^array [1 .. * ] of dmt$flaw_duplication,
      flaw_index: integer,
      i: integer,
      max_volume_index: integer,
      number_of_vol: integer,
      ring_attributes: amt$ring_attributes,
      scan_p: ^clt$data_value,
      str: ost$string,
      volume_count: clt$list_size,
      volume_list: ^stt$volume_list;

    validate_command_usage (status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

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

    IF pvt [p$display_option].value^.keyword_value = 'EFFECT' THEN
      file_contents := fsc$list;
    ELSEIF pvt [p$display_option].value^.keyword_value = 'SOURCE' THEN
      file_contents := fsc$legible_data;
    ELSE
      ;
    IFEND;

    ring_attributes.r1 := #RING (^ring_attributes);
    ring_attributes.r2 := #RING (^ring_attributes);
    ring_attributes.r3 := #RING (^ring_attributes);

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

    big_enough_array := FALSE;
    flaw_index := 0;
    flaw_duplication_index := 0;

  /display_open/
    BEGIN
      IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN
        cmp$obtain_max_volume_index (max_volume_index);
        PUSH volume_list: [1 .. max_volume_index];
        cmp$obtain_volumes (volume_list, number_of_vol);

      /all_volume_loop/
        FOR i := 1 TO number_of_vol DO
          REPEAT
            IF NOT big_enough_array THEN
              flaw_index := flaw_index + 50;
              flaw_duplication_index := flaw_index * 10;
              PUSH flaw_dau_information_p: [1 .. flaw_index];
              PUSH flaw_duplication_p: [1 .. flaw_duplication_index];
            IFEND;
            pmp$zero_out_table (flaw_duplication_p, #SIZE (flaw_duplication_p^));
            pmp$zero_out_table (flaw_dau_information_p, #SIZE (flaw_dau_information_p^));

            dmp$identify_flawed_daus (volume_list^ [i].recorded_vsn, flaw_dau_information_p,
                  flaw_duplication_p, big_enough_array, status);
            IF NOT status.normal THEN
              CASE status.condition OF
              = dme$recorded_vsn_not_in_lun, dme$avt_entry_not_found =
                CYCLE /all_volume_loop/;
              ELSE
                EXIT /display_open/;
              CASEND;
            IFEND;
          UNTIL big_enough_array = TRUE;

          display_flaw_list (volume_list^ [i].recorded_vsn, flaw_dau_information_p, flaw_duplication_p,
                pvt [p$display_option].value^.keyword_value, display_control, status);
          IF NOT status.normal THEN
            EXIT /display_open/;
          IFEND;

        FOREND /all_volume_loop/;

{ If a list of volumes was selected.

      ELSE
        scan_p := pvt [p$recorded_vsn].value;

        WHILE scan_p <> NIL DO
          REPEAT
            IF NOT big_enough_array THEN
              flaw_index := flaw_index + 50;
              flaw_duplication_index := flaw_index * 10;
              PUSH flaw_dau_information_p: [1 .. flaw_index];
              PUSH flaw_duplication_p: [1 .. flaw_duplication_index];
            IFEND;
            pmp$zero_out_table (flaw_duplication_p, #SIZE (flaw_duplication_p^));
            pmp$zero_out_table (flaw_dau_information_p, #SIZE (flaw_dau_information_p^));

            dmp$identify_flawed_daus (scan_p^.element_value^.name_value (1, rmc$recorded_vsn_size),
                  flaw_dau_information_p, flaw_duplication_p, big_enough_array, status);
            IF NOT status.normal THEN
              CASE status.condition OF
              = dme$recorded_vsn_not_in_lun, dme$avt_entry_not_found =
                osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_recorded_vsn_not_found,
                      command_name, status);
              ELSE
                ;
              CASEND;
              EXIT /display_open/;
            IFEND;
            flaw_index := flaw_index + 50;
            flaw_duplication_index := flaw_index * 10;
          UNTIL big_enough_array = TRUE;

          display_flaw_list (scan_p^.element_value^.name_value (1, rmc$recorded_vsn_size),
                flaw_dau_information_p, flaw_duplication_p, pvt [p$display_option].value^.keyword_value,
                display_control, status);
          IF NOT status.normal THEN
            EXIT /display_open/;
          IFEND;
          scan_p := scan_p^.link;
        WHILEND;
      IFEND;

    END /display_open/;

    clp$close_display (display_control, close_status);
    IF status.normal AND NOT close_status.normal THEN
      status := close_status;
    IFEND;

  PROCEND display_ms_flaw;

?? OLDTITLE ??
?? NEWTITLE := '  DISPLAY_MS_VOLUME', EJECT ??

*block

  PROCEDURE display_ms_volume
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{  PROCEDURE (cmm$lcu_dismsv) display_ms_volume, dismv, dismsv (
{    recorded_vsn, recorded_vsns, rvsn, rv: any of
{        key
{          all
{        keyend
{        list of name 1..6
{      anyend = ALL
{    display_options, display_option, do: any of
{       key
{        all
{      keyend
{      list of key
{        (allocation_size, as)
{        (transfer_size, ts)
{      keyend
{    anyend = all
{    output, o: file = $OUTPUT
{    status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 10] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
        default_value: string (3),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 4] of clt$keyword_specification,
          recend,
        recend,
        default_value: string (3),
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 8, 25, 9, 29, 55, 784],
    clc$command, 10, 4, 0, 0, 0, 0, 4, 'CMM$LCU_DISMSV'], [
    ['DISPLAY_OPTION                 ',clc$alias_entry, 2],
    ['DISPLAY_OPTIONS                ',clc$nominal_entry, 2],
    ['DO                             ',clc$abbreviation_entry, 2],
    ['O                              ',clc$abbreviation_entry, 3],
    ['OUTPUT                         ',clc$nominal_entry, 3],
    ['RECORDED_VSN                   ',clc$nominal_entry, 1],
    ['RECORDED_VSNS                  ',clc$alias_entry, 1],
    ['RV                             ',clc$abbreviation_entry, 1],
    ['RVSN                           ',clc$alias_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ PARAMETER 1
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 85, clc$optional_default_parameter, 0, 3],
{ PARAMETER 2
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 235, clc$optional_default_parameter, 0, 3],
{ PARAMETER 3
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_default_parameter, 0, 7],
{ PARAMETER 4
    [10, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type,
    clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$name_type], [1, 6]]
      ]
    ,
    'ALL'],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$keyword_type,
    clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    171, [[1, 0, clc$list_type], [155, 1, clc$max_list_size, FALSE],
        [[1, 0, clc$keyword_type], [4], [
        ['ALLOCATION_SIZE                ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
        ['AS                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
        ['TRANSFER_SIZE                  ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
        ['TS                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2]]
        ]
      ]
    ,
    'all'],
{ PARAMETER 3
    [[1, 0, clc$file_type],
    '$OUTPUT'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$recorded_vsn = 1,
      p$display_options = 2,
      p$output = 3,
      p$status = 4;

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


    TYPE
      recorded_vsn_list = record
        recorded_vsn: rmt$recorded_vsn,
        valid: boolean,
      recend;

    CONST
      blank_line = '                                           ';

*copy clv$display_variables
*copy cmc$minimum_page_size

    VAR
      allocation_size_specified: boolean,
      as_value: string (15),
      display_control: clt$display_control,
      display_line: string (44),
      do_value_count: clt$list_size,
      element_status: iot$unit_status,
      file: clt$file,
      header: string (46),
      i: integer,
      ignore_status: ost$status,
      index: integer,
      j: integer,
      max_ms_volumes: integer,
      ms_volumes: ^array [1 .. * ] of cmt$mass_storage_volume,
      output_open: boolean,
      rvsn_list: ^array [1 .. * ] of recorded_vsn_list,
      scan_p: ^clt$data_value,
      state: cmt$element_state,
      string_length: integer,
      transfer_size_specified: boolean,
      ts_value: string (13),
      volume_attribute_info: dmt$volume_attribute_info,
      volume_count: 0 .. 7fffffff(16);

?? NEWTITLE := '    abort_handler', EJECT ??

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

      IF output_open THEN
        clp$close_display (display_control, ignore_status);
        output_open := FALSE;
      IFEND;

    PROCEND abort_handler;

*copy clp$new_page_procedure

?? OLDTITLE ??
?? NEWTITLE := '    put_subtitle', EJECT ??

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

      clp$put_partial_display (display_control, header, clc$no_trim, amc$continue, status);

    PROCEND put_subtitle;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;
    header := '  RVSN     ALLOCATION SIZE     TRANSFER SIZE  ';
    output_open := FALSE;
    osp$establish_block_exit_hndlr (^abort_handler);

  /main_program/

    BEGIN

      validate_command_usage (status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

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

      IF pvt [p$recorded_vsn].value^.kind <> clc$keyword THEN
        volume_count := clp$count_list_elements (pvt [p$recorded_vsn].value);
        scan_p := pvt [p$recorded_vsn].value;
        PUSH rvsn_list: [1 .. volume_count];
        FOR i := 1 TO volume_count DO
          rvsn_list^ [i].recorded_vsn := scan_p^.element_value^.name_value;
          rvsn_list^ [i].valid := FALSE;
          scan_p := scan_p^.link;
        FOREND;
      IFEND;

      cmp$get_ms_volumes (max_ms_volumes);
      PUSH ms_volumes: [1 .. max_ms_volumes];
      cmp$get_ms_volume_info (ms_volumes^);

      FOR i := 1 TO max_ms_volumes DO

{ Check if any of the volumes identified by RECORDED_VSN parameter is not ON.

        cmp$get_element_state_via_lun (ms_volumes^ [i].lun, state);
        IF state <> cmc$on THEN
          IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN
            osp$set_status_abnormal (cmc$configuration_management_id, cme$element_state_not_proper,
                  ms_volumes^ [i].recorded_vsn, status);
            EXIT /main_program/;
          ELSE
            FOR j := 1 TO volume_count DO
              IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
                osp$set_status_abnormal (cmc$configuration_management_id, cme$element_state_not_proper,
                      ms_volumes^ [i].recorded_vsn, status);
                EXIT /main_program/;
              IFEND;
            FOREND;
          IFEND;
        IFEND;

{ Check if any of the volumes identified by RECORDED_VSN parameter is disabled.

        cmp$get_ms_status_via_lun (ms_volumes^ [i].lun, element_status);
        IF element_status.disabled THEN
          IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN
            osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_element_status,
                  ms_volumes^ [i].recorded_vsn, status);
            EXIT /main_program/;
          ELSE
            FOR j := 1 TO volume_count DO
              IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
                osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_element_status,
                      ms_volumes^ [i].recorded_vsn, status);
                EXIT /main_program/;
              IFEND;
            FOREND;
          IFEND;
        IFEND;

        ms_volumes^ [i].on_and_enabled := (state = cmc$on) AND (NOT element_status.disabled);

        IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN
          IF ms_volumes^ [i].on_and_enabled THEN
            ms_volumes^ [i].changed := TRUE;
          IFEND;
        ELSE
          ms_volumes^ [i].changed := FALSE;

        /volume_loop_0/
          FOR j := 1 TO volume_count DO
            IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
              rvsn_list^ [j].valid := TRUE;
              IF ms_volumes^ [i].on_and_enabled THEN
                ms_volumes^ [i].changed := TRUE;
              IFEND;
              EXIT /volume_loop_0/;
            IFEND;
          FOREND /volume_loop_0/;
        IFEND;

      FOREND;

{ Check if a volume identified by RECORDED_VSN parameter invalid or not initialized.

      IF pvt [p$recorded_vsn].value^.kind <> clc$keyword THEN
        FOR j := 1 TO volume_count DO
          IF NOT rvsn_list^ [j].valid THEN
            osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_recorded_vsn,
                  rvsn_list^ [j].recorded_vsn, status);
            EXIT /main_program/;
          IFEND;
        FOREND;
      IFEND;

      clp$convert_string_to_file (pvt [p$output].value^.file_value^, file, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      clp$open_display (file, ^clp$new_page_procedure, display_control, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      output_open := TRUE;

      IF display_control.page_width < cmc$minimum_page_size THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_illegal_output_file,
              pvt [p$output].value^.file_value^, status);
        osp$append_status_integer (osc$status_parameter_delimiter, cmc$minimum_page_size, 10, FALSE, status);
        EXIT /main_program/;
      IFEND;

      clv$titles_built := FALSE;
      clv$command_name := 'display_ms_volume';

      allocation_size_specified := FALSE;
      transfer_size_specified := FALSE;
      IF pvt [p$display_options].value^.kind = clc$keyword THEN
        IF pvt [p$display_options].value^.keyword_value = 'ALL' THEN
          allocation_size_specified := TRUE;
          transfer_size_specified := TRUE;
        IFEND;
      ELSE
        do_value_count := clp$count_list_elements (pvt [p$display_options].value);
        scan_p := pvt [p$display_options].value;
        FOR i := 1 TO do_value_count DO
          IF scan_p^.element_value^.keyword_value = 'ALLOCATION_SIZE' THEN
            allocation_size_specified := TRUE;
          ELSEIF scan_p^.element_value^.keyword_value = 'TRANSFER_SIZE' THEN
            transfer_size_specified := TRUE;
          IFEND;
          scan_p := scan_p^.link;
        FOREND;
      IFEND;
      IF display_control.page_format = amc$continuous_form THEN
        clp$put_display (display_control, header, clc$no_trim, status);
        clp$new_display_line (display_control, 1, status);
      IFEND;

    /display_loop/
      FOR index := 1 TO max_ms_volumes DO
        IF ms_volumes^ [index].on_and_enabled THEN
          IF ms_volumes^ [index].changed THEN

            cmp$get_volume_attributes (ms_volumes^ [index].lun, volume_attribute_info,
                  ms_volumes^ [index].write_status);

            IF NOT ms_volumes^ [index].write_status.normal THEN
              CYCLE /display_loop/;
            IFEND;

            display_line := blank_line;
            display_line (3, 6) := ms_volumes^ [index].recorded_vsn;

            IF allocation_size_specified AND transfer_size_specified THEN
              STRINGREP (as_value, string_length, volume_attribute_info.default_allocation_size);
              display_line (12, string_length) := as_value;
              STRINGREP (ts_value, string_length, volume_attribute_info.default_transfer_size);
              display_line (32, string_length) := ts_value;
            ELSEIF allocation_size_specified AND NOT transfer_size_specified THEN
              STRINGREP (as_value, string_length, volume_attribute_info.default_allocation_size);
              display_line (12, string_length) := as_value;
            ELSEIF transfer_size_specified AND NOT allocation_size_specified THEN
              STRINGREP (ts_value, string_length, volume_attribute_info.default_transfer_size);
              display_line (32, string_length) := ts_value;
            IFEND;
            clp$put_display (display_control, display_line, clc$no_trim, status);
          IFEND;
        IFEND;
      FOREND /display_loop/;

      FOR i := 1 TO max_ms_volumes DO
        IF ms_volumes^ [i].on_and_enabled THEN
          IF ms_volumes^ [i].changed THEN
            IF NOT ms_volumes^ [i].write_status.normal THEN
              osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_recorded_vsn_not_found,
                    ms_volumes^ [index].recorded_vsn, status);
            IFEND;
          IFEND;
        IFEND;
      FOREND;

    END /main_program/;

  PROCEND display_ms_volume;
*blockend

?? OLDTITLE ??
?? NEWTITLE := '  DISPLAY_NETWORK_CONFIGURATION', EJECT ??

*block

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


{   PROCEDURE (cmm$lcu_disnc) cmp$display_netw_configuration, disnc (
{     display_options, display_option, do: key
{         (networks, network, n)
{         all
{       keyend = ALL
{     output, o: file = $output
{     status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 6] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (3),
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 5, 22, 10, 18, 2, 561],
    clc$command, 6, 3, 0, 0, 0, 0, 3, 'CMM$LCU_DISNC'], [
    ['DISPLAY_OPTION                 ',clc$alias_entry, 1],
    ['DISPLAY_OPTIONS                ',clc$nominal_entry, 1],
    ['DO                             ',clc$abbreviation_entry, 1],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 2
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 3
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$keyword_type], [4], [
    ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['NETWORK                        ', clc$alias_entry, clc$normal_usage_entry, 1],
    ['NETWORKS                       ', clc$nominal_entry, clc$normal_usage_entry, 1]]
    ,
    'ALL'],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

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

    VAR
      pvt: array [1 .. 3] of clt$parameter_value;
*copyc clv$display_variables
*copyc cmc$minimum_page_size

    CONST
      command_name = 'DISPLAY_NETWORK_CONFIGURATION';

    VAR
      caller_id: ost$caller_identifier,
      display_control: clt$display_control,
      display_option: nat$display_option,
      header: string (50),
      file: clt$file,
      ignore_status: ost$status,
      output_open: boolean;

?? NEWTITLE := '    abort_handler', EJECT ??

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

      IF output_open THEN
        clp$close_display (display_control, ignore_status);
        output_open := FALSE;
      IFEND;

    PROCEND abort_handler;

*copyc clp$new_page_procedure

?? OLDTITLE ??
?? NEWTITLE := '    put_subtitle', EJECT ??

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

      clp$put_partial_display (display_control, header, clc$trim, amc$continue, status);

    PROCEND put_subtitle;

?? OLDTITLE, EJECT ??

    #caller_id (caller_id);
    status.normal := TRUE;
    output_open := FALSE;
    osp$establish_block_exit_hndlr (^abort_handler);

  /main_program/
    BEGIN
      validate_command_usage (status);
      IF caller_id.ring > 6 THEN
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
      IFEND;

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

{ Currently there is only one display_option, namely NETWORKS.

      display_option := nac$display_networks;

      clp$convert_string_to_file (pvt [p$output].value^.file_value^, file, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      header := ' ACTIVE NETWORK CONFIGURATION ';
      clp$open_display (file, ^clp$new_page_procedure, display_control, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      output_open := TRUE;

      IF display_control.page_width < cmc$minimum_page_size THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_illegal_output_file,
              file.local_file_name, status);
        osp$append_status_integer (osc$status_parameter_delimiter, cmc$minimum_page_size, 10, FALSE, status);
        EXIT /main_program/;
      IFEND;

      clv$titles_built := FALSE;
      clv$command_name := command_name;

      nap$display_network_config (display_option, display_control, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

    END /main_program/;

    IF output_open THEN
      clp$close_display (display_control, ignore_status);
      output_open := FALSE;
    IFEND;

    osp$disestablish_cond_handler;

  PROCEND cmp$display_netw_configuration;
*blockend

?? OLDTITLE ??
?? NEWTITLE := 'display_processor_state', EJECT ??

{ PURPOSE:
{   This procedure is the command processor for the command 'DISPLAY_PROCESSOR_STATE'.  It generates a display
{   detailing some useful information about the CPUs configured on the mainframe and sends it to the screen or
{   to an output file.

*block

  PROCEDURE display_processor_state
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (cmm$lcu_disps) display_processor_state, disps (
{   processors, processor, p: any of
{       key
{         (all, a)
{       keyend
{       list of key cp0 cp1 keyend
{     anyend = ALL
{   output, o: file = $OUTPUT
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??
  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 6] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 2] of clt$keyword_specification,
          recend,
        recend,
        default_value: string (3),
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [91, 9, 30, 11, 11, 51, 706],
    clc$command, 6, 3, 0, 0, 0, 0, 3, 'CMM$LCU_DISPS'], [
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['P                              ',clc$abbreviation_entry, 1],
    ['PROCESSOR                      ',clc$alias_entry, 1],
    ['PROCESSORS                     ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 198,
  clc$optional_default_parameter, 0, 3],
{ PARAMETER 2
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 3
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    81, [[1, 0, clc$keyword_type], [2], [
      ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    97, [[1, 0, clc$list_type], [81, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [2], [
        ['CP0                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['CP1                            ', clc$nominal_entry, clc$normal_usage_entry, 2]]
        ]
      ]
    ,
    'ALL'],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$OUTPUT'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];
?? FMT (FORMAT := ON) ??
?? POP ??

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

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

    TYPE
      t$cpu_data = RECORD
        display_data: boolean,
        physically_configured: boolean,
        element_p: ^cmt$cpu_element_definition,
      RECEND,

      t$line = RECORD
        CASE boolean OF
        = TRUE =
          line: string (80),
        = FALSE =
          cpu_number: string (27),
          element_number: string (7),
          space_1: string (2),
          model_number: string (6),
          space_2: string (2),
          serial_number: string (6),
          space_3: string (2),
          state: string (5),
          space_4: string (2),
          reason_for_current_state: string (21),
        CASEND,
      RECEND;

*copyc clv$display_variables
*copyc cmc$minimum_page_size

    VAR
      cpu_data: ARRAY [0 .. 1] OF t$cpu_data,
      cpu_index: ost$processor_id,
      display_control: clt$display_control,
      header: string (50),
      list_p: ^clt$data_value,
      local_status: ost$status,
      option_p: ^clt$data_value,
      output_line: t$line,
      ring_attributes: amt$ring_attributes,
      string_1: string (1),
      string_2: string (2),
      string_4: string (4);

?? NEWTITLE := 'abort_handler', EJECT ??

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

      clp$close_display (display_control, local_status);

    PROCEND abort_handler;

*copyc clp$new_page_procedure

?? OLDTITLE ??
?? NEWTITLE := 'put_subtitle', EJECT ??

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

      clp$put_partial_display (display_control, header, clc$trim, amc$continue, status);

    PROCEND put_subtitle;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;
    header := 'PROCESSOR CONFIGURATION';
    validate_command_usage (status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

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

    osp$establish_block_exit_hndlr (^abort_handler);
    ring_attributes.r1 := #RING (^ring_attributes);
    ring_attributes.r2 := #RING (^ring_attributes);
    ring_attributes.r3 := #RING (^ring_attributes);
    clp$open_display_reference (pvt [p$output].value^.file_value^, ^clp$new_page_procedure, fsc$list,
          ring_attributes, display_control, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    IF display_control.page_width < cmc$minimum_page_size THEN
      osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_illegal_output_file,
            pvt [p$output].value^.file_value^, status);
      osp$append_status_integer (osc$status_parameter_delimiter, cmc$minimum_page_size, 10, FALSE, status);
      clp$close_display (display_control, local_status);
      RETURN;
    IFEND;

    clv$titles_built := FALSE;
    clv$command_name := 'DISPLAY_PROCESSOR_STATE';

    FOR cpu_index := LOWERBOUND (cpu_data) TO UPPERBOUND (cpu_data) DO
      cpu_data [cpu_index].display_data := FALSE;
      PUSH cpu_data [cpu_index].element_p;
      cmp$get_cpu_element_r3 (cpu_index, cpu_data [cpu_index].element_p, local_status);
      cpu_data [cpu_index].physically_configured := local_status.normal;
    FOREND;

    IF (pvt [p$processors].value^.kind = clc$keyword) AND
          (pvt [p$processors].value^.keyword_value = 'ALL') THEN
      FOR cpu_index := LOWERBOUND (cpu_data) TO UPPERBOUND (cpu_data) DO
        IF cpu_data [cpu_index].physically_configured THEN
          cpu_data [cpu_index].display_data := TRUE;
        IFEND;
      FOREND;
    ELSE
      list_p := pvt [p$processors].value;
      WHILE list_p <> NIL DO
        option_p := list_p^.element_value;
        list_p := list_p^.link;
        IF option_p^.keyword_value = 'CP0' THEN
          cpu_data [0].display_data := TRUE;
        ELSEIF option_p^.keyword_value = 'CP1' THEN
          cpu_data [1].display_data := TRUE;
        IFEND;
      WHILEND;
    IFEND;

    output_line.line := ' ';
    output_line.cpu_number := 'Central Processor Unit #';
    output_line.element_number := 'Element';
    output_line.model_number := 'Model';
    output_line.serial_number := 'Serial';
    output_line.state := 'State';
    output_line.reason_for_current_state := 'Reason for';
    clp$put_display (display_control, output_line.line, clc$trim, local_status);
    output_line.line := ' ';
    output_line.element_number := 'Number';
    output_line.model_number := 'Number';
    output_line.serial_number := 'Number';
    output_line.reason_for_current_state := 'Current State';
    clp$put_display (display_control, output_line.line, clc$trim, local_status);

    FOR cpu_index := LOWERBOUND (cpu_data) TO UPPERBOUND (cpu_data) DO
      IF cpu_data [cpu_index].display_data THEN
        clp$convert_integer_to_rjstring (cpu_index, 10, FALSE, '0', string_1, local_status);
        IF cpu_data [cpu_index].physically_configured THEN
          output_line.line := ' ';

          output_line.cpu_number := string_1;

          clp$convert_integer_to_rjstring (cpu_data [cpu_index].element_p^.element_number, 16, FALSE, '0',
                string_2, local_status);
          output_line.element_number := string_2;
          clp$convert_integer_to_rjstring (cpu_data [cpu_index].element_p^.model_number, 16, FALSE, '0',
                string_2, local_status);
          output_line.model_number := string_2;
          clp$convert_integer_to_rjstring (cpu_data [cpu_index].element_p^.serial_number, 16, FALSE, '0',
                string_4, local_status);
          output_line.serial_number := string_4;

          CASE cpu_data [cpu_index].element_p^.processor_state OF
          = cmc$on =
            output_line.state := 'ON';
          = cmc$off =
            output_line.state := 'OFF';
          ELSE {= cmc$down =}
            output_line.state := 'DOWN';
          CASEND;

          CASE cpu_data [cpu_index].element_p^.reason_for_current_state OF
          = osc$cdsr_null =
            output_line.reason_for_current_state := ' ';
          = osc$cdsr_downed_by_dft =
            output_line.reason_for_current_state := 'Downed by DFT';
          = osc$cdsr_due_threshold_exceeded =
            output_line.reason_for_current_state := 'DUE level exceeded';
          = osc$cdsr_cpu_timeout =
            output_line.reason_for_current_state := 'CPU Timeout';
          = osc$cdsr_downed_by_operator =
            output_line.reason_for_current_state := 'Downed by operator';
          ELSE {= osc$cdsr_downed_by_system =}
            output_line.reason_for_current_state := 'Downed by SYSTEM';
          CASEND;

        ELSE
          output_line.line := ' CPU n information could not be displayed.  It is not physically configured.';
          output_line.line (6) := string_1;
        IFEND;
        clp$put_display (display_control, output_line.line, clc$trim, local_status);
      IFEND;
    FOREND;

    clp$close_display (display_control, local_status);
    osp$disestablish_cond_handler;

  PROCEND display_processor_state;
*blockend
?? OLDTITLE ??
?? NEWTITLE := '  ENABLE_PRODUCTION', EJECT ??

{ PURPOSE:
{ This procedure is the command processor for the command 'ENABLE_PRODUCTION'.  It makes a call to ring 3 to
{ enable production of a processor which has just been reinstated.

*block

  PROCEDURE enable_production
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{   PROCEDURE (cmm$lcu_enap) enable_production, enap (
{     status)

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

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 1] of clt$pdt_parameter_name,
        parameters: array [1 .. 1] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
      recend := [
      [1,
      [91, 3, 18, 15, 3, 14, 704],
      clc$command, 1, 1, 0, 0, 0, 0, 1, 'CMM$LCU_ENAP'], [
      ['STATUS                         ',clc$nominal_entry, 1]],
      [
{ PARAMETER 1
      [1, clc$normal_usage_entry, clc$non_secure_parameter,
      $clt$parameter_spec_methods[clc$specify_by_name],
      clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
    clc$optional_parameter, 0, 0]],
{ PARAMETER 1
      [[1, 0, clc$status_type]]];

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

    CONST
      p$status = 1;

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

    status.normal := TRUE;

    IF NOT (avp$system_operator () OR avp$configuration_administrator () OR
          avp$removable_media_operator ()) THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active,
            'configuration_administration, removable_media_operation or system_operation', status);
      RETURN;
    IFEND;

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

    cmp$enable_production_r3 (status);

  PROCEND enable_production;
*blockend
?? OLDTITLE ??
?? NEWTITLE := '  FORMAT_REINSTATED_PARITY_UNIT', EJECT ??

  PROCEDURE format_reinstated_parity_unit
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{   PROCEDURE format_reinstated_parity_unit, forrpu (
{     element, e: name = $required
{     force_format_on_reinstatement, ffor: boolean = FALSE
{     status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 5] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (5),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [91, 4, 10, 14, 26, 58, 587],
    clc$command, 5, 3, 1, 0, 0, 0, 3, ''], [
    ['E                              ',clc$abbreviation_entry, 1],
    ['ELEMENT                        ',clc$nominal_entry, 1],
    ['FFOR                           ',clc$abbreviation_entry, 2],
    ['FORCE_FORMAT_ON_REINSTATEMENT  ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_default_parameter, 0, 5],
{ PARAMETER 3
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$boolean_type],
    'FALSE'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

    CONST
      p$element = 1,
      p$force_format_on_reinstatement = 2,
      p$status = 3;

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

    VAR
      element_definition: ^cmt$element_definition,
      element: cmt$element_name,
      force_format: boolean,
      logical_unit_number: iot$logical_unit,
      product_id: cmt$product_identification,
      state: cmt$element_state,
      status_p: ^ost$status,
      unused_iou_name: cmt$element_name;

  /main_program/
    BEGIN

{ Valdate user for 'configuration_administrator' capability.
    IF (NOT avp$configuration_administrator ()) THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration', status);
      EXIT /main_program/;
    IFEND;

{ Validate parameters.
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      EXIT /main_program/;
    IFEND;

{ Manage LCU lock.
    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control, status);
    IF NOT status.normal THEN
      EXIT /main_program/;
    IFEND;

    element := pvt [p$element].value^.name_value;
    force_format := pvt [p$force_format_on_reinstatement].value^.boolean_value.value;

{ Get definition for element.
    PUSH element_definition;
    cmp$get_element_r3 (element, unused_iou_name, element_definition, status);
    IF NOT status.normal THEN
      EXIT /main_program/;
    IFEND;
    product_id := element_definition^.product_id;

{ Get logical unit number.
    cmp$get_logical_unit_number_r3 (element, logical_unit_number, status);
    IF NOT status.normal THEN
      EXIT /main_program/;
    IFEND;
    IF logical_unit_number = 0 THEN
      osp$set_status_abnormal (cmc$configuration_management_id, cme$lcm_element_not_found, element, status);
      EXIT /main_program/;
    IFEND;

{ Insure that the element state is 'ON'.
      cmp$get_element_state_via_lun (logical_unit_number, state);
      IF state <> cmc$on THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_device_not_active, element, status);
        EXIT /main_program/;
      IFEND;


    cmp$process_force_format (product_id, element, logical_unit_number, force_format, status);
    IF NOT status.normal THEN
      EXIT /main_program/;
    IFEND

  END /main_program/;

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND format_reinstated_parity_unit;
?? OLDTITLE ??
?? NEWTITLE := '  INITIALIZE_MS_VOLUME', EJECT ??

  PROCEDURE initialize_ms_volume
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (cmm$lcu_inimsv) initialize_ms_volume, inimv, inimsv (
{   element, e: name = $required
{   recorded_vsn, rvsn, rv: name 1..6 = $required
{   retain_device_flaws, rdf: boolean = TRUE
{   format_volume, fv: any of
{       boolean
{       key
{         (format_at_all_costs, faac)
{       keyend
{     anyend = false
{   allocation_size, as: key
{       $16k, $32k, $64k, $128k, $256k, $512k
{       (cylinder, c)
{     keyend = $16K
{   transfer_size, ts: key
{       $16k, $32k, $64k, $128k, $256k, $512k
{       (cylinder, c)
{     keyend = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 14] of clt$pdt_parameter_name,
      parameters: array [1 .. 7] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        default_value: string (5),
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 8] of clt$keyword_specification,
        default_value: string (4),
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 8] of clt$keyword_specification,
      recend,
      type7: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [103, 2, 11, 9, 23, 31, 769],
    clc$command, 14, 7, 2, 0, 0, 0, 7, 'CMM$LCU_INIMSV'], [
    ['ALLOCATION_SIZE                ',clc$nominal_entry, 5],
    ['AS                             ',clc$abbreviation_entry, 5],
    ['E                              ',clc$abbreviation_entry, 1],
    ['ELEMENT                        ',clc$nominal_entry, 1],
    ['FORMAT_VOLUME                  ',clc$nominal_entry, 4],
    ['FV                             ',clc$abbreviation_entry, 4],
    ['RDF                            ',clc$abbreviation_entry, 3],
    ['RECORDED_VSN                   ',clc$nominal_entry, 2],
    ['RETAIN_DEVICE_FLAWS            ',clc$nominal_entry, 3],
    ['RV                             ',clc$abbreviation_entry, 2],
    ['RVSN                           ',clc$alias_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 7],
    ['TRANSFER_SIZE                  ',clc$nominal_entry, 6],
    ['TS                             ',clc$abbreviation_entry, 6]],
    [
{ PARAMETER 1
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$required_parameter, 0
  , 0],
{ PARAMETER 3
    [9, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 4
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 104,
  clc$optional_default_parameter, 0, 5],
{ PARAMETER 5
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 303,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 6
    [13, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 303,
  clc$optional_parameter, 0, 0],
{ PARAMETER 7
    [12, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$name_type], [1, 6]],
{ PARAMETER 3
    [[1, 0, clc$boolean_type],
    'TRUE'],
{ PARAMETER 4
    [[1, 0, clc$union_type], [[clc$boolean_type, clc$keyword_type],
    FALSE, 2],
    3, [[1, 0, clc$boolean_type]],
    81, [[1, 0, clc$keyword_type], [2], [
      ['FAAC                           ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['FORMAT_AT_ALL_COSTS            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ]
    ,
    'false'],
{ PARAMETER 5
    [[1, 0, clc$keyword_type], [8], [
    ['$128K                          ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['$16K                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['$256K                          ', clc$nominal_entry, clc$normal_usage_entry, 5],
    ['$32K                           ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['$512K                          ', clc$nominal_entry, clc$normal_usage_entry, 6],
    ['$64K                           ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
    ['CYLINDER                       ', clc$nominal_entry, clc$normal_usage_entry, 7]]
    ,
    '$16K'],
{ PARAMETER 6
    [[1, 0, clc$keyword_type], [8], [
    ['$128K                          ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['$16K                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['$256K                          ', clc$nominal_entry, clc$normal_usage_entry, 5],
    ['$32K                           ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['$512K                          ', clc$nominal_entry, clc$normal_usage_entry, 6],
    ['$64K                           ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
    ['CYLINDER                       ', clc$nominal_entry, clc$normal_usage_entry, 7]]
    ],
{ PARAMETER 7
    [[1, 0, clc$status_type]]];

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

    CONST
      p$element = 1,
      p$recorded_vsn = 2,
      p$retain_device_flaws = 3,
      p$format_volume = 4,
      p$allocation_size = 5,
      p$transfer_size = 6,
      p$status = 7;

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

    VAR
      access_code: ost$name,
      allocation_size: dmt$allocation_size,
      allow_to_continue: boolean,
      continue_initialization: boolean,
      converted_parameter: clt$integer,
      cylinder_allocation_size: boolean,
      cylinder_transfer_size: boolean,
      element: cmt$element_name,
      initialization_options: dmt$initialize_ms_vol_options,
      initialize_status_info: dmt$initialize_status_info,
      logical_attributes_p: ^dmt$logical_device_attributes,
      logical_unit_number: iot$logical_unit,
      mainframe_element: ^cmt$element_definition,
      number_of_digits: integer,
      owner_id: ost$user_identification,
      physical_attributes_p: ^dmt$physical_device_attributes,
      product_id: cmt$product_identification,
      recorded_vsn: rmt$recorded_vsn,
      set_name: stt$set_name,
      state: cmt$element_state,
      status_p: ^ost$status,
      transfer_size: dmt$transfer_size,
      transfer_size_specified: boolean,
      unused_iou_name: cmt$element_name,
      volume_label_attributes_p: ^dmt$volume_label_attributes;

    status.normal := TRUE;
    cylinder_allocation_size := FALSE;
    cylinder_transfer_size := FALSE;
    transfer_size_specified := FALSE;
    set_name := 'INIMV ATTEMPTED';

  /main_program/
    BEGIN
      IF (NOT avp$configuration_administrator ()) THEN
        osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration', status);
        EXIT /main_program/;
      IFEND;
      clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

{note: allowed_to_overwrite_volume  must be false for the first and true for the second call
      initialization_options.allowed_to_overwrite_volume := FALSE;
      initialization_options.retain_device_flaws := pvt [p$retain_device_flaws].value^.boolean_value.value;

      IF pvt [p$format_volume].value^.kind = clc$keyword THEN
        initialization_options.format_option := dmc$fmvo_format_at_all_costs;  {only keyword
      ELSEIF pvt [p$format_volume].value^.boolean_value.value THEN
        initialization_options.format_option := dmc$fmvo_force_format;
      ELSE
        initialization_options.format_option := dmc$fmvo_no_format;
      IFEND;

      cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      cylinder_allocation_size := FALSE;
      cylinder_transfer_size := FALSE;

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

      IF pvt [p$allocation_size].value^.keyword_value = 'CYLINDER' THEN
        cylinder_allocation_size := TRUE;
      ELSEIF pvt [p$allocation_size].value^.keyword_value = '$16K' THEN
        allocation_size := 16 * dmc$k_multiplier;
      ELSEIF pvt [p$allocation_size].value^.keyword_value = '$32K' THEN
        allocation_size := 32 * dmc$k_multiplier;
      ELSEIF pvt [p$allocation_size].value^.keyword_value = '$64K' THEN
        allocation_size := 64 * dmc$k_multiplier;
      ELSEIF pvt [p$allocation_size].value^.keyword_value = '$128K' THEN
        allocation_size := 128 * dmc$k_multiplier;
      ELSEIF pvt [p$allocation_size].value^.keyword_value = '$256K' THEN
        allocation_size := 256 * dmc$k_multiplier;
      ELSEIF pvt [p$allocation_size].value^.keyword_value = '$512K' THEN
        allocation_size := 512 * dmc$k_multiplier;
      IFEND;

      IF pvt [p$transfer_size].specified THEN
        IF pvt [p$transfer_size].value^.keyword_value = 'CYLINDER' THEN
          cylinder_transfer_size := TRUE;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$16K' THEN
          transfer_size := 16 * dmc$k_multiplier;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$32K' THEN
          transfer_size := 32 * dmc$k_multiplier;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$64K' THEN
          transfer_size := 64 * dmc$k_multiplier;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$128K' THEN
          transfer_size := 128 * dmc$k_multiplier;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$256K' THEN
          transfer_size := 256 * dmc$k_multiplier;
        ELSEIF pvt [p$transfer_size].value^.keyword_value = '$512K' THEN
          transfer_size := 512 * dmc$k_multiplier;
        IFEND;
      ELSE
        transfer_size := dmc$unspecified_transfer_size;
      IFEND;

      cmp$get_logical_unit_number_r3 (element, logical_unit_number, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      IF logical_unit_number = cmc$job_template_unit_ordinal THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_illegal_inimv, '  ', status);
        EXIT /main_program/;
      ELSEIF logical_unit_number = 0 THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcm_element_not_found, element, status);
        EXIT /main_program/;
      IFEND;
      cmp$get_element_state_via_lun (logical_unit_number, state);
      IF state <> cmc$on THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_device_not_active, element, status);
        EXIT /main_program/;
      IFEND;

      PUSH mainframe_element;
      cmp$get_element_r3 (element, unused_iou_name, mainframe_element, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      cmp$validate_cip_path (logical_unit_number, continue_initialization);
      IF NOT continue_initialization THEN
        EXIT /main_program/;
      IFEND;

      product_id := mainframe_element^.product_id;

      PUSH physical_attributes_p: [1 .. 8];

      physical_attributes_p^ [1].keyword := dmc$bytes_per_mau;
      physical_attributes_p^ [2].keyword := dmc$cylinders_per_device;
      physical_attributes_p^ [3].keyword := dmc$maus_per_cylinder;
      physical_attributes_p^ [4].keyword := dmc$maus_per_dau;
      physical_attributes_p^ [5].keyword := dmc$sectors_per_mau;
      physical_attributes_p^ [6].keyword := dmc$sectors_per_track;
      physical_attributes_p^ [7].keyword := dmc$flaw_map_locations;
      physical_attributes_p^ [8].keyword := dmc$pda_max_label_size;

      cmp$get_physical_attributes (product_id, physical_attributes_p, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      PUSH volume_label_attributes_p: [1 .. 3];

      volume_label_attributes_p^ [1].keyword := dmc$label_access_code;
      volume_label_attributes_p^ [1].access_code := dmc$default_vol_access_code;
      volume_label_attributes_p^ [2].keyword := dmc$label_expiration_days;
      volume_label_attributes_p^ [2].expiration_days := dmc$max_expiration_days;
      volume_label_attributes_p^ [3].keyword := dmc$label_recorded_vsn;
      volume_label_attributes_p^ [3].recorded_vsn := recorded_vsn;

      PUSH logical_attributes_p: [1 .. 6];

      logical_attributes_p^ [1].keyword := dmc$volume_dfl_entries;
      logical_attributes_p^ [2].keyword := dmc$volume_directory_entries;
      logical_attributes_p^ [3].keyword := dmc$logical_flaws;
      logical_attributes_p^ [4].keyword := dmc$volume_default_transfer_sz;
      logical_attributes_p^ [5].keyword := dmc$volume_default_alloc_sz;
      logical_attributes_p^ [6].keyword := dmc$cylinder_allocation_size;

      cmp$get_logical_attributes (product_id, logical_attributes_p, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      IF cylinder_allocation_size THEN
        logical_attributes_p^ [5].volume_default_allocation_size :=
              logical_attributes_p^ [6].bytes_per_cylinder;
      ELSE
        logical_attributes_p^ [5].volume_default_allocation_size := allocation_size;
      IFEND;

      IF pvt [p$transfer_size].specified THEN
        IF cylinder_transfer_size THEN
          logical_attributes_p^ [4].volume_default_transfer_size :=
                logical_attributes_p^ [6].bytes_per_cylinder;
        ELSE
          logical_attributes_p^ [4].volume_default_transfer_size := transfer_size;
        IFEND;
      IFEND;

      access_code := dmc$default_vol_access_code;
      owner_id.family := jmc$system_family;
      owner_id.user := jmc$system_user;

      cmp$initialize_ms_volume (access_code, product_id, owner_id, physical_attributes_p,
            logical_attributes_p, volume_label_attributes_p, logical_unit_number, initialization_options,
            initialize_status_info, status);
      IF NOT status.normal THEN
        IF status.condition = mme$volume_unavailable THEN
          osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_device_not_active,
                element, status);
          EXIT /main_program/;
        IFEND;

        cmp$check_init_status (status, initialize_status_info, element, continue_initialization);
        IF continue_initialization THEN
          IF status.condition = dme$vol_label_date_not_expired THEN
            cmp$validate_set_membership (recorded_vsn, set_name, allow_to_continue, status);
            IF NOT status.normal THEN
              EXIT /main_program/;
            IFEND;
            IF NOT allow_to_continue THEN
              EXIT /main_program/;
            IFEND;
          IFEND;
          cmp$get_element_state_via_lun (logical_unit_number, state);
          IF state <> cmc$on THEN
            osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_device_not_active,
                  element, status);
            EXIT /main_program/;
          IFEND;

          initialization_options.allowed_to_overwrite_volume := TRUE;
          cmp$initialize_ms_volume (access_code, product_id, owner_id, physical_attributes_p,
                logical_attributes_p, volume_label_attributes_p, logical_unit_number, initialization_options,
                initialize_status_info, status);
          IF NOT status.normal THEN
            EXIT /main_program/;
          IFEND;
        ELSE
          EXIT /main_program/;
        IFEND;
      IFEND;

      cmp$volume_online (logical_unit_number, physical_attributes_p, status);
      IF NOT status.normal THEN
        IF status.condition = mme$volume_unavailable THEN
          osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_device_not_active,
                element, status);
        IFEND;
        EXIT /main_program/;
      IFEND;

    END /main_program/;

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND initialize_ms_volume;

?? OLDTITLE ??
?? NEWTITLE := '  INITIATE_DAS_RESTORE', EJECT ??

  PROCEDURE initiate_das_restore
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);


{     PROCEDURE initiate_das_restore, inidr (
{       element, e: name = $required
{       status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [94, 4, 14, 10, 23, 3, 603],
    clc$command, 3, 2, 1, 0, 0, 0, 2, ''], [
    ['E                              ',clc$abbreviation_entry, 1],
    ['ELEMENT                        ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

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

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

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

    VAR
      element_definition: ^cmt$element_definition,
      element: cmt$element_name,
      logical_unit_number: iot$logical_unit,
      product_id: cmt$product_identification,
      state: cmt$element_state,
      status_p: ^ost$status,
      unused_iou_name: cmt$element_name;

  /main_program/
    BEGIN

{ Valdate user for 'configuration_administrator' capability.
    IF (NOT avp$configuration_administrator ()) THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration', status);
      EXIT /main_program/;
    IFEND;

{ Validate parameters.
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      EXIT /main_program/;
    IFEND;

{ Manage LCU lock.
    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control, status);
    IF NOT status.normal THEN
      EXIT /main_program/;
    IFEND;

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

{ Get definition for element.
    PUSH element_definition;
    cmp$get_element_r3 (element, unused_iou_name, element_definition, status);
    IF NOT status.normal THEN
      EXIT /main_program/;
    IFEND;
    product_id := element_definition^.product_id;

{ Get logical unit number.
    cmp$get_logical_unit_number_r3 (element, logical_unit_number, status);
    IF NOT status.normal THEN
      EXIT /main_program/;
    IFEND;
    IF logical_unit_number = 0 THEN
      osp$set_status_abnormal (cmc$configuration_management_id, cme$lcm_element_not_found, element, status);
      EXIT /main_program/;
    IFEND;

{ Insure that the element state is 'ON'.
      cmp$get_element_state_via_lun (logical_unit_number, state);
      IF state <> cmc$on THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_device_not_active, element, status);
        EXIT /main_program/;
      IFEND;

    cmp$process_das_restore (product_id, element, logical_unit_number, status);
    IF NOT status.normal THEN
      EXIT /main_program/;
    IFEND

  END /main_program/;

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND initiate_das_restore;
?? OLDTITLE ??
?? NEWTITLE := '  INSTALL_NETWORK_CONFIGURATION', EJECT ??

  PROCEDURE install_network_configuration
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (cmm$lcu_insnc) install_network_configuration, insnc (
{   input, i: file = $required
{   errors, error, e: file = $ERRORS
{   retain_high_cycles, retain_high_cycle, rhc: any of
{       key
{         all
{       keyend
{       integer 1..pfc$maximum_cycle_number
{     anyend = 2
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 9] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (1),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [105, 10, 28, 16, 44, 21, 734],
    clc$command, 9, 4, 1, 0, 0, 0, 4, 'CMM$LCU_INSNC'], [
    ['E                              ',clc$abbreviation_entry, 2],
    ['ERROR                          ',clc$alias_entry, 2],
    ['ERRORS                         ',clc$nominal_entry, 2],
    ['I                              ',clc$abbreviation_entry, 1],
    ['INPUT                          ',clc$nominal_entry, 1],
    ['RETAIN_HIGH_CYCLE              ',clc$alias_entry, 3],
    ['RETAIN_HIGH_CYCLES             ',clc$nominal_entry, 3],
    ['RHC                            ',clc$abbreviation_entry, 3],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ PARAMETER 1
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 3
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 84,
  clc$optional_default_parameter, 0, 1],
{ PARAMETER 4
    [9, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$file_type]],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$ERRORS'],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [1, pfc$maximum_cycle_number, 10]]
    ,
    '2'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

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

    CONST
      p$input = 1,
      p$errors = 2,
      p$retain_high_cycles = 3,
      p$status = 4;

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

    CONST
      command_name = 'INSTALL_NETWORK_CONFIGURATION';

    VAR
      access_selections: [STATIC, READ, oss$job_paged_literal] array [1 .. 2] of fst$attachment_option :=
            [[fsc$open_position, amc$open_at_boi], [fsc$access_and_share_modes,
            [fsc$specific_access_modes, [fsc$read, fsc$shorten, fsc$append, fsc$modify]],
            [fsc$determine_from_access_modes]]],
      config_file_path: [STATIC, READ, oss$job_paged_literal] array [1 .. 4] of pft$name :=
            [nac$network_family, nac$network_master_catalog, nac$network_subcatalog, nac$configuration_file],
      highest_cycle: [STATIC, READ, oss$job_paged_literal] pft$cycle_selector := [pfc$highest_cycle],
      lowest_cycle: [STATIC, READ, oss$job_paged_literal] pft$cycle_selector := [pfc$lowest_cycle],
      maximum_retention: [STATIC, READ, oss$job_paged_literal] pft$retention := pfc$maximum_retention,
      network_config_high_cycle: [READ, oss$job_paged_literal] string (35) :=
            '$SYSTEM.NETWORK.CONFIGURATION.$HIGH',
      password: [STATIC, READ, oss$job_paged_literal] pft$password := ' ',
      system_network_catalog: [STATIC, READ, oss$job_paged_literal] array [1 .. 3] of pft$name :=
            [nac$network_family, nac$network_master_catalog, nac$network_subcatalog];

    VAR
      access_sel: array [1 .. 1] of fst$attachment_option,
      byte_address: amt$file_byte_address,
      command_line: string (256),
      config_cycles: 0 .. pfc$maximum_cycle_number,
      contains_data: boolean,
      continuation_string: array [1 .. 50] of ost$string,
      done: boolean,
      echoed_string: ost$string,
      error_fid: amt$file_identifier,
      error_file_name: amt$local_file_name,
      error_string: ost$string,
      existing_file: boolean,
      file: clt$file,
      file_position: amt$file_position,
      get_attr: array [1 .. 1] of amt$get_item,
      i: 0 .. 50,
      ignore_status: ost$status,
      input_fid: amt$file_identifier,
      input_file_name: amt$local_file_name,
      line: string (256),
      line_continues: boolean,
      local_file: boolean,
      local_status: ost$status,
      local_status_identifier: ost$status_identifier,
      name: ost$name,
      network_config_file_$high: clt$file,
      network_configuration_file: clt$file,
      new_file_fid: amt$file_identifier,
      number_of_lines: 0 .. 50,
      pos: integer,
      retain_cycle_count: 1 .. pfc$maximum_cycle_number,
      status_p: ^ost$status,
      size: integer,
      transfer_count: amt$transfer_count;

    status.normal := TRUE;

  /main_program/
    BEGIN
      IF (NOT avp$configuration_administrator ()) THEN
        osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration', status);
        EXIT /main_program/;
      IFEND;

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

      cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      IF pvt [p$retain_high_cycles].value^.kind = clc$keyword THEN
        retain_cycle_count := pfc$maximum_cycle_number;
      ELSEIF pvt [p$retain_high_cycles].value^.kind = clc$integer THEN
        retain_cycle_count := pvt [p$retain_high_cycles].value^.integer_value.value;
      ELSE
        ;
      IFEND;

      clp$convert_string_to_file (pvt [p$input].value^.file_value^, file, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      input_file_name := file.local_file_name;

      get_attr [1].key := amc$null_attribute;
      amp$get_file_attributes (input_file_name, get_attr, local_file, existing_file, contains_data, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      IF NOT (existing_file AND contains_data) THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_empty_input_on_vernc,
              pvt [p$input].value^.file_value^, status);
        EXIT /main_program/;
      IFEND;

      access_sel [1].selector := fsc$access_and_share_modes;
      access_sel [1].access_modes.selector := fsc$specific_access_modes;
      access_sel [1].access_modes.value := $fst$file_access_options [fsc$read, fsc$execute];
      access_sel [1].share_modes.selector := fsc$required_share_modes;

      fsp$open_file (input_file_name, amc$record, ^access_sel, NIL, NIL, NIL, NIL, input_fid, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      clp$convert_string_to_file (pvt [p$errors].value^.file_value^, file, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      error_file_name := file.local_file_name;

      cmp$open_scratch_err_file (status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      REPEAT
        line := '   ';
        command_line := ' ';
        amp$get_next (input_fid, ^line, #SIZE (line), transfer_count, byte_address, file_position, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
        line_continues := FALSE;
        echoed_string.value := line;
        echoed_string.size := transfer_count;
        pos := continuation_line_pos (line, transfer_count);
        IF pos <> 0 THEN
          line_continues := TRUE;
          command_line (1, pos) := line (1, pos);
          size := pos;
          number_of_lines := 0;
          REPEAT
            line := '  ';
            amp$get_next (input_fid, ^line, #SIZE (line), transfer_count, byte_address, file_position,
                  status);
            IF NOT status.normal THEN
              EXIT /main_program/;
            IFEND;
            number_of_lines := number_of_lines + 1;
            continuation_string [number_of_lines].value := line;
            continuation_string [number_of_lines].size := transfer_count;
            pos := continuation_line_pos (line, transfer_count);
            IF pos <> 0 THEN
              command_line (size + 1, * ) := line (1, pos);
              size := size + pos + 1;
              done := FALSE;
            ELSE
              command_line (size + 1, * ) := line;
              done := TRUE;
              size := size + transfer_count + 1;
            IFEND;

          UNTIL (file_position = amc$eoi) OR (number_of_lines = 10) OR done OR (size > 256);

        ELSE
          command_line := line;
        IFEND;
        clp$scan_command_line (command_line, local_status);
        IF NOT local_status.normal THEN
          cmp$echo_command (echoed_string, status);
          IF NOT status.normal THEN
            EXIT /main_program/;
          IFEND;
          IF line_continues THEN
            FOR i := 1 TO number_of_lines DO
              cmp$echo_command (continuation_string [i], status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
            FOREND;
          IFEND;
          osp$unpack_status_identifier (local_status.condition, local_status_identifier);
          IF (local_status_identifier = cmc$configuration_management_id) AND
                (local_status.condition = cme$lcu_duplicate_system_id) THEN
            cmp$echo_errors (FALSE, local_status);
          ELSE
            cmp$echo_errors (TRUE, local_status);
          IFEND;

        IFEND;
      UNTIL file_position = amc$eoi;

      IF cmv$error_count = 0 THEN
        cmp$validate_network_config (cmv$network_descriptor_p, local_status);
        IF NOT local_status.normal THEN
          cmp$echo_errors (FALSE, local_status);
        IFEND;
      IFEND;

      IF cmv$error_count > 0 THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_vernc_error, command_name, status);
        osp$append_status_integer (osc$status_parameter_delimiter, cmv$error_count, 10, FALSE, status);
        IF error_file_name <> clc$null_file THEN
          cmp$generate_error_listing (error_file_name, local_status);
          IF NOT local_status.normal THEN
            EXIT /main_program/;
          IFEND;
        IFEND;
      ELSE
        clp$convert_string_to_file (network_config_high_cycle, network_config_file_$high, ignore_status);
        clp$convert_string_to_file (network_config_high_cycle (1, (STRLENGTH (network_config_high_cycle) -
              6)), network_configuration_file, ignore_status);
        IF (input_file_name <> network_config_file_$high.local_file_name) AND
              (input_file_name <> network_configuration_file.local_file_name) THEN

{ Input file was NOT the highest cycle of $SYSTEM.NETWORK.CONFIGURATION, so a new cycle
{ will be created.

          pfp$define_catalog (system_network_catalog, status);
          IF NOT status.normal AND (status.condition <> pfe$name_already_subcatalog) THEN
            EXIT /main_program/;
          IFEND;

          pmp$get_unique_name (name, ignore_status);
          pfp$define (name, config_file_path, highest_cycle, password, maximum_retention, pfc$no_log, status);
          IF NOT status.normal THEN
            EXIT /main_program/;
          IFEND;

          fsp$open_file (name, amc$record, ^access_selections, NIL, NIL, NIL, NIL, new_file_fid, status);
          IF NOT status.normal THEN
            pfp$purge (config_file_path, highest_cycle, password, local_status);
            EXIT /main_program/;
          IFEND;

          amp$copy_file (input_file_name, name, status);
          fsp$close_file (new_file_fid, ignore_status);
          amp$return (name, ignore_status);
          IF NOT status.normal THEN
            pfp$purge (config_file_path, highest_cycle, password, local_status);
            EXIT /main_program/;
          IFEND;

          nap$get_file_cycle_count (config_file_path, config_cycles, local_status);
          IF NOT local_status.normal THEN
            EXIT /main_program/;
          IFEND;

          WHILE config_cycles > retain_cycle_count DO
            pfp$purge (config_file_path, lowest_cycle, password, local_status);
            IF NOT local_status.normal THEN
              EXIT /main_program/;
            IFEND;
            config_cycles := config_cycles - 1;
          WHILEND;
        IFEND;
      IFEND;

    END /main_program/;
    fsp$close_file (input_fid, ignore_status);
    cmp$clean_up_error_count;
    cmp$clean_up_network_list (ignore_status);

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND install_network_configuration;
?? OLDTITLE ??
?? NEWTITLE := '  INVOKE_SPACE_MANAGER', EJECT ??

  PROCEDURE invoke_space_manager
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (cmm$lcu_invsm) invoke_space_manager (
{   recorded_vsn, recorded_vsns, rvsn, rv: any of
{       key
{         all
{       keyend
{       list of name 1..6
{     anyend = $required
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 5] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [105, 1, 18, 14, 28, 44, 171],
    clc$command, 5, 2, 1, 0, 0, 0, 2, 'CMM$LCU_INVSM'], [
    ['RECORDED_VSN                   ',clc$nominal_entry, 1],
    ['RECORDED_VSNS                  ',clc$alias_entry, 1],
    ['RV                             ',clc$abbreviation_entry, 1],
    ['RVSN                           ',clc$alias_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 85, clc$required_parameter,
  0, 0],
{ PARAMETER 2
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, 6]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

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

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

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

    TYPE
      recorded_vsn_list = record
        recorded_vsn: rmt$recorded_vsn,
        valid: boolean,
      recend;

    VAR
      element_status: iot$unit_status,
      i: integer,
      index: integer,
      j: integer,
      max_ms_volumes: integer,
      ms_volumes: ^array [1 .. * ] of cmt$mass_storage_volume,
      rvsn_list: ^array [1 .. * ] of recorded_vsn_list,
      scan_p: ^clt$data_value,
      state: cmt$element_state,
      status_p: ^ost$status,
      volume_count: 0 .. 7fffffff(16);

  /main_program/
    BEGIN
      IF (NOT avp$configuration_administrator ()) AND (NOT avp$system_operator ()) THEN
        osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration or system_operation',
              status);
        EXIT /main_program/; {----->
      IFEND;

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

      cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control, status);
      IF NOT status.normal THEN
        EXIT /main_program/; {----->
      IFEND;

      IF pvt [p$recorded_vsn].value^.kind = clc$keyword THEN {ALL Volumes
        dmp$invoke_space_manager (0 {=all volumes} , status);
      ELSE {List of Volumes
        volume_count := clp$count_list_elements (pvt [p$recorded_vsn].value);
        PUSH rvsn_list: [1 .. volume_count];
        scan_p := pvt [p$recorded_vsn].value;
        FOR i := 1 TO volume_count DO
          rvsn_list^ [i].recorded_vsn := scan_p^.element_value^.name_value;
          rvsn_list^ [i].valid := FALSE;
          scan_p := scan_p^.link;
        FOREND;

        cmp$get_ms_volumes (max_ms_volumes);
        PUSH ms_volumes: [1 .. max_ms_volumes];
        cmp$get_ms_volume_info (ms_volumes^);

        FOR i := 1 TO max_ms_volumes DO

{ Check if any of the volumes identified by RECORDED_VSN parameter is not ON.
          cmp$get_element_state_via_lun (ms_volumes^ [i].lun, state);
          IF state <> cmc$on THEN
            FOR j := 1 TO volume_count DO
              IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
                osp$set_status_abnormal (cmc$configuration_management_id, cme$element_state_not_proper,
                      ms_volumes^ [i].recorded_vsn, status);
                EXIT /main_program/; {----->
              IFEND;
            FOREND;
          IFEND;

{ Check if any of the volumes identified by RECORDED_VSN parameter is disabled.
          cmp$get_ms_status_via_lun (ms_volumes^ [i].lun, element_status);
          IF element_status.disabled THEN
            FOR j := 1 TO volume_count DO
              IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
                osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_element_status,
                      ms_volumes^ [i].recorded_vsn, status);
                EXIT /main_program/; {----->
              IFEND;
            FOREND;
          IFEND;

          ms_volumes^ [i].on_and_enabled := (state = cmc$on) AND (NOT element_status.disabled);
          ms_volumes^ [i].changed := FALSE;

        /volume_loop_0/
          FOR j := 1 TO volume_count DO
            IF rvsn_list^ [j].recorded_vsn = ms_volumes^ [i].recorded_vsn THEN
              rvsn_list^ [j].valid := TRUE;
              ms_volumes^ [i].changed := ms_volumes^ [i].on_and_enabled;
              EXIT /volume_loop_0/; {----->
            IFEND;
          FOREND /volume_loop_0/;
        FOREND;

{ Check if a volume identified by RECORDED_VSN parameter invalid or not initialized.
        FOR j := 1 TO volume_count DO
          IF NOT rvsn_list^ [j].valid THEN
            osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_recorded_vsn,
                  rvsn_list^ [j].recorded_vsn, status);
            EXIT /main_program/; {----->
          IFEND;
        FOREND;

        FOR index := 1 TO max_ms_volumes DO
          IF ms_volumes^ [index].on_and_enabled AND ms_volumes^ [index].changed THEN
            dmp$invoke_space_manager (index, ms_volumes^ [index].write_status);
          IFEND;
        FOREND;

{ Issue error message if an error occurs when writing.

      /volume_loop_3/
        FOR i := 1 TO max_ms_volumes DO
          IF ms_volumes^ [i].on_and_enabled AND ms_volumes^ [i].changed AND
                (NOT ms_volumes^ [i].write_status.normal) THEN
            osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_recorded_vsn_not_found,
                  ms_volumes^ [i].recorded_vsn, status);
          IFEND;
        FOREND /volume_loop_3/;
      IFEND;
    END /main_program/;

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND invoke_space_manager;
?? OLDTITLE ??
?? NEWTITLE := '  QUIT', EJECT ??

  PROCEDURE quit
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);


{ PROCEDURE (cmm$lcu_qui) quit, qui

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
      recend := [[1, [88, 11, 2, 12, 34, 56, 789], clc$command, 0, 0, 0, 0, 0, 0, 0, 'CMM$LCU_QUI']];

?? POP ??

    VAR
      local_status: ost$status;

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

  /main_program/
    BEGIN
      local_status.normal := TRUE;
      IF avp$configuration_administrator () OR avp$system_operator () THEN
        cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control,
              local_status);

        IF local_status.normal THEN

{ Activate all volumes redundantly.

          cmp$get_volumes_active (local_status);

{ If a class does not have member,
{ then return abnormal status and do not allow the utility to exit.
{ This is done to ensure that operator has to correct the problem and
{ is able to stay in the utility to do so (via CHAMSC command).

          cmp$validate_ms_class (status);
          IF status.normal THEN
            cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_clear_lock,
                  v$lcu_lock_control, local_status);
          ELSE
            EXIT /main_program/;
          IFEND;
        IFEND;
      IFEND;
      cmp$manage_lock_r3 (cmc$removable_media_operation, cmc$llo_clear_lock, v$lcu_lock_control,
            local_status);

      IF (avp$configuration_administrator () OR avp$system_operator () OR
             avp$removable_media_operator ()) THEN
        cmp$process_outstanding_sc_req (v$lcu_lock_control, local_status);
      IFEND;

      clp$end_scan_command_file (cmv$utility_name, local_status);
      cmp$free_command_list;
    END /main_program/;

  PROCEND quit;

?? OLDTITLE ??
?? NEWTITLE := '  REMOVE_MS_FLAW', EJECT ??

  PROCEDURE remove_ms_flaw
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{  PROCEDURE (cmm$lcu_remmsf) remove_ms_flaw, remmf, remmsf (
{    recorded_vsn, rvsn, rv: name 1..6 = $required
{    cylinder, c: integer 0..281474976710655 = $required
{    track, t: integer 0..281474976710655 = $optional
{    sector, s: integer 0..281474976710655 = $optional
{    status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 10] of clt$pdt_parameter_name,
      parameters: array [1 .. 5] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 8, 29, 14, 0, 41, 256],
    clc$command, 10, 5, 2, 0, 0, 0, 5, 'CMM$LCU_REMMSF'], [
    ['C                              ',clc$abbreviation_entry, 2],
    ['CYLINDER                       ',clc$nominal_entry, 2],
    ['RECORDED_VSN                   ',clc$nominal_entry, 1],
    ['RV                             ',clc$abbreviation_entry, 1],
    ['RVSN                           ',clc$alias_entry, 1],
    ['S                              ',clc$abbreviation_entry, 4],
    ['SECTOR                         ',clc$nominal_entry, 4],
    ['STATUS                         ',clc$nominal_entry, 5],
    ['T                              ',clc$abbreviation_entry, 3],
    ['TRACK                          ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 20, clc$required_parameter, 0, 0],
{ PARAMETER 3
    [10, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 20, clc$optional_parameter, 0, 0],
{ PARAMETER 4
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 20, clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, 6]],
{ PARAMETER 2
    [[1, 0, clc$integer_type], [0, 281474976710655, 10]],
{ PARAMETER 3
    [[1, 0, clc$integer_type], [0, 281474976710655, 10]],
{ PARAMETER 4
    [[1, 0, clc$integer_type], [0, 281474976710655, 10]],
{ PARAMETER 5
    [[1, 0, clc$status_type]]];

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

    CONST
      p$recorded_vsn = 1,
      p$cylinder = 2,
      p$track = 3,
      p$sector = 4,
      p$status = 5;

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

    CONST
      command_name = 'REMOVE_MS_FLAW';

    VAR
      physical_flaw_address_p: ^dmt$physical_flaw_address,
      status_p: ^ost$status,
      recorded_vsn: rmt$recorded_vsn;

    status.normal := TRUE;

    IF (NOT avp$configuration_administrator ()) THEN
      osp$set_status_abnormal ('OF', ofe$sou_not_active, 'configuration_administration', status);
      RETURN;
    IFEND;
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_set_lock, v$lcu_lock_control, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    PUSH physical_flaw_address_p;

    recorded_vsn := pvt [p$recorded_vsn].value^.name_value;
    physical_flaw_address_p^.cylinder := pvt [p$cylinder].value^.integer_value.value;
    IF pvt [p$track].specified THEN
      physical_flaw_address_p^.track := pvt [p$track].value^.integer_value.value;
    IFEND;
    IF pvt [p$sector].specified THEN
      physical_flaw_address_p^.sector := pvt [p$sector].value^.integer_value.value;
    IFEND;

    dmp$define_remove_ms_flaw (recorded_vsn, physical_flaw_address_p, pvt [p$track].specified,
          pvt [p$sector].specified, dmc$oc_flaw_remove, dmc$ic_operator_initiated, status);
    IF NOT status.normal THEN
      CASE status.condition OF
      = dme$avt_entry_not_found, dme$recorded_vsn_not_in_lun =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_recorded_vsn_not_found,
              command_name, status);

      = dme$cylinder_limit_exceeded =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_cylinder_limit_exceeded,
              command_name, status);

      = dme$track_limit_exceeded =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_track_limit_exceeded, command_name,
              status);

      = dme$sector_limit_exceeded =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_sector_limit_exceeded, command_name,
              status);

      = dme$logging_unavailable =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_logging_not_active, command_name,
              status);

      = dme$address_not_sw_flawed =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_address_not_sw_flawed, command_name,
              status);

      = dme$unaddressable_sector =
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_unaddressable_sector, command_name,
              status);
      ELSE
        ;
      CASEND;
    IFEND;

    IF status.normal THEN
      status_p := ^status;
    ELSE
      PUSH status_p;
    IFEND;

    cmp$manage_lock_r3 (cmc$configuration_administrator, cmc$llo_end_system_activity, v$lcu_lock_control,
          status_p^);

  PROCEND remove_ms_flaw;

?? OLDTITLE ??
?? NEWTITLE := '  VERIFY_NETWORK_CONFIGURATION', EJECT ??

  PROCEDURE verify_network_configuration
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (cmm$lcu_vernc) verify_network_configuration, vernc (
{   input, i: file = $required
{   errors, error, e: file = $ERRORS
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 6] of clt$pdt_parameter_name,
        parameters: array [1 .. 3] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
        type2: record
          header: clt$type_specification_header,
          default_value: string (7),
        recend,
        type3: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 11, 2, 12, 34, 56, 789], clc$command, 6, 3, 1, 0, 0, 0, 3, 'CMM$LCU_VERNC'],
            [['E                              ', clc$abbreviation_entry, 2],
            ['ERROR                          ', clc$alias_entry, 2],
            ['ERRORS                         ', clc$nominal_entry, 2],
            ['I                              ', clc$abbreviation_entry, 1],
            ['INPUT                          ', clc$nominal_entry, 1],
            ['STATUS                         ', clc$nominal_entry, 3]], [

{ INPUT, I

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

{ ERRORS, ERROR, E

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

{ STATUS

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

{ INPUT, I

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

{ ERRORS, ERROR, E

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

{ STATUS

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

?? POP ??

    CONST
      p$input = 1,
      p$errors = 2,
      p$status = 3;

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

    CONST
      command_name = 'VERIFY_NETWORK_CONFIGURATION';

    VAR
      access_sel: array [1 .. 1] of fst$attachment_option,
      byte_address: amt$file_byte_address,
      command_line: string (256),
      contains_data: boolean,
      continuation_string: array [1 .. 50] of ost$string,
      count: clt$list_size,
      done: boolean,
      echoed_string: ost$string,
      error_file_attr: array [1 .. 2] of amt$access_selection,
      error_file_id: amt$file_identifier,
      error_file_name: amt$local_file_name,
      error_string: ost$string,
      existing_file: boolean,
      file: clt$file,
      file_position: amt$file_position,
      get_attr: array [1 .. 1] of amt$get_item,
      i: 0 .. 50,
      ignore_status: ost$status,
      input_fid: amt$file_identifier,
      input_file_name: amt$local_file_name,
      line: string (256),
      line_continues: boolean,
      local_file: boolean,
      local_status: ost$status,
      local_status_identifier: ost$status_identifier,
      number_of_lines: 0 .. 50,
      pos: integer,
      size: integer,
      transfer_count: amt$transfer_count;

    status.normal := TRUE;

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

      clp$convert_string_to_file (pvt [p$input].value^.file_value^, file, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      input_file_name := file.local_file_name;

      clp$convert_string_to_file (pvt [p$errors].value^.file_value^, file, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      error_file_name := file.local_file_name;
      cmp$open_scratch_err_file (status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      get_attr [1].key := amc$ring_attributes;
      amp$get_file_attributes (input_file_name, get_attr, local_file, existing_file, contains_data, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

  /error_check/
    BEGIN
      IF NOT (existing_file AND contains_data) THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_empty_input_on_vernc,
              pvt [p$input].value^.file_value^, local_status);
        cmp$echo_errors (FALSE, local_status);
        EXIT /error_check/;
      IFEND;

      access_sel [1].selector := fsc$access_and_share_modes;
      access_sel [1].access_modes.selector := fsc$specific_access_modes;
      access_sel [1].access_modes.value := $fst$file_access_options [fsc$read, fsc$execute];
      access_sel [1].share_modes.selector := fsc$required_share_modes;

      fsp$open_file (input_file_name, amc$record, ^access_sel, NIL, NIL, NIL, NIL, input_fid, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      REPEAT
        line := '   ';
        command_line := ' ';
        amp$get_next (input_fid, ^line, #SIZE (line), transfer_count, byte_address, file_position, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
        line_continues := FALSE;
        echoed_string.value := line;
        echoed_string.size := transfer_count;
        pos := continuation_line_pos (line, transfer_count);
        IF pos <> 0 THEN
          line_continues := TRUE;
          command_line (1, pos) := line (1, pos);
          size := pos;
          number_of_lines := 0;
          REPEAT
            line := '  ';
            amp$get_next (input_fid, ^line, #SIZE (line), transfer_count, byte_address, file_position,
                  status);
            IF NOT status.normal THEN
              EXIT /main_program/;
            IFEND;
            number_of_lines := number_of_lines + 1;
            continuation_string [number_of_lines].value := line;
            continuation_string [number_of_lines].size := transfer_count;

            pos := continuation_line_pos (line, transfer_count);
            IF pos <> 0 THEN
              command_line (size + 1, * ) := line (1, pos);
              done := FALSE;
              size := size + pos + 1;
            ELSE
              done := TRUE;
              command_line (size + 1, * ) := line;
              size := size + transfer_count + 1;
            IFEND;
          UNTIL (file_position = amc$eoi) OR (number_of_lines = 10) OR done OR (size > 256);

        ELSE
          command_line := line;
        IFEND;
        clp$scan_command_line (command_line, local_status);
        IF NOT local_status.normal THEN
          cmp$echo_command (echoed_string, status);
          IF NOT status.normal THEN
            EXIT /main_program/;
          IFEND;
          IF line_continues THEN
            FOR i := 1 TO number_of_lines DO
              cmp$echo_command (continuation_string [i], status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
            FOREND;
          IFEND;
          osp$unpack_status_identifier (local_status.condition, local_status_identifier);
          IF (local_status_identifier = cmc$configuration_management_id) AND
                (local_status.condition = cme$lcu_duplicate_system_id) THEN
            cmp$echo_errors (FALSE, local_status);
          ELSE
            cmp$echo_errors (TRUE, local_status);
          IFEND;

        IFEND;

      UNTIL file_position = amc$eoi;

    END /error_check/;

      IF cmv$error_count = 0 THEN
        cmp$validate_network_config (cmv$network_descriptor_p, local_status);
        IF NOT local_status.normal THEN
          cmp$echo_errors (FALSE, local_status);
        IFEND;
      IFEND;
      IF cmv$error_count > 0 THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_vernc_error, command_name, status);
        osp$append_status_integer (osc$status_parameter_delimiter, cmv$error_count, 10, FALSE, status);
        IF error_file_name <> clc$null_file THEN
          cmp$generate_error_listing (error_file_name, local_status);
          IF NOT local_status.normal THEN
            EXIT /main_program/;
          IFEND;
        IFEND;
      IFEND;

    END /main_program/;

    fsp$close_file (input_fid, ignore_status);
    cmp$clean_up_error_count;
    cmp$clean_up_network_list (ignore_status);

  PROCEND verify_network_configuration;

?? OLDTITLE, OLDTITLE ??
?? NEWTITLE := 'Network Configuration Subcommands' ??
?? NEWTITLE := '  CMP$DEFINE_HOST_NETWORK', EJECT ??

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

{ PROCEDURE (cmm$lcu_defhn) define_host_network, defhn (
{   network, n: integer 1..65535 = $required
{   )

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 2] of clt$pdt_parameter_name,
        parameters: array [1 .. 1] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend := [[1, [88, 11, 2, 12, 34, 56, 789], clc$command, 2, 1, 1, 0, 0, 0, 0, 'CMM$LCU_DEFHN'],
            [['N                              ', clc$abbreviation_entry, 1],
            ['NETWORK                        ', clc$nominal_entry, 1]], [

{ NETWORK, N

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

{ NETWORK, N

      [[1, 0, clc$integer_type], [1, 65535, 10]]];

?? POP ??

    CONST
      p$network = 1;

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

    VAR
      network_descriptor: ^nat$network_descriptor;

    status.normal := TRUE;

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

      check_for_dup_host_network_defn (cmv$network_descriptor_p, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      PUSH network_descriptor;
      network_descriptor^.kind := nac$host_subnet;
      network_descriptor^.network := pvt [p$network].value^.integer_value.value;

      cmp$form_network_list (network_descriptor, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

    END /main_program/;

  PROCEND cmp$define_host_network;

?? OLDTITLE ??
?? NEWTITLE := '  CMP$DEFINE_NETWORK_CONNECTION', EJECT ??

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


{   PROCEDURE (cmm$lcu_defnc) define_network_connection, defnc (
{     connected_system, cs: name = $required
{     system_identifier, si: integer 4194561..5242879 = $optional
{     )

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 4] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
    recend := [
    [1,
    [88, 11, 9, 8, 45, 4, 580],
    clc$command, 4, 2, 1, 0, 0, 0, 0, 'CMM$LCU_DEFNC'], [
    ['CONNECTED_SYSTEM               ',clc$nominal_entry, 1],
    ['CS                             ',clc$abbreviation_entry, 1],
    ['SI                             ',clc$abbreviation_entry, 2],
    ['SYSTEM_IDENTIFIER              ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 5, clc$required_parameter, 0
  , 0],
{ PARAMETER 2
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter,
  0, 0]],
{ PARAMETER 1
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 2
    [[1, 0, clc$integer_type], [4194561, 5242879, 10]]];

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

    CONST
      p$connected_system = 1,
      p$system_identifier = 2;

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

    CONST
      ica_2_system_id_prefix = 080025(16);

    VAR
      network_descriptor: ^nat$network_descriptor;

    status.normal := TRUE;

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

      PUSH network_descriptor;
      network_descriptor^.kind := nac$network_device;
      network_descriptor^.access.element := pvt [p$connected_system].value^.name_value;

      check_unique_element (cmv$network_descriptor_p, network_descriptor^.access.element, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      IF pvt [p$system_identifier].specified THEN
        network_descriptor^.system_identifier := pvt [p$system_identifier].value^.integer_value.value +
              (ica_2_system_id_prefix * 1000000(16));
        check_unique_system_id (cmv$network_descriptor_p, network_descriptor^.system_identifier, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
      ELSE
        network_descriptor^.system_identifier := 0;
      IFEND;

      cmp$form_network_list (network_descriptor, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

    END /main_program/;

  PROCEND cmp$define_network_connection;

?? OLDTITLE ??
?? NEWTITLE := '  CMP$VALIDATE_NETWORK_CONFIG', EJECT ??

*copyc cmh$validate_network_config

  PROCEDURE [XDCL, #GATE] cmp$validate_network_config
    (    network_descriptor_list: ^nat$network_descriptor;
     VAR status: ost$status);

    VAR
      device_defined: boolean,
      host_subnet_defined: boolean,
      network_descriptor: ^nat$network_descriptor;

    status.normal := TRUE;
    device_defined := FALSE;
    host_subnet_defined := FALSE;
    network_descriptor := network_descriptor_list;

    WHILE (network_descriptor <> NIL) AND ((device_defined = FALSE) OR (host_subnet_defined = FALSE)) DO
      IF network_descriptor^.kind = nac$network_device THEN
        device_defined := TRUE;
      ELSEIF network_descriptor^.kind = nac$host_subnet THEN
        host_subnet_defined := TRUE;
      IFEND;
      network_descriptor := network_descriptor^.next_descriptor;
    WHILEND;

    IF NOT host_subnet_defined THEN
      osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_no_host_network_defn, '', status);
    ELSEIF NOT device_defined THEN
      osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_no_netw_device_defn, '', status);
    IFEND;

  PROCEND cmp$validate_network_config;

?? OLDTITLE ??
?? NEWTITLE := '  cmp$define_tcpip_host', EJECT ??

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

{ PROCEDURE (cmm$lcu_defth) define_tcpip_host, defth (
{   host_name, hn: string 1 .. 255 = $required
{   forward_search_range, fsr: integer 1 .. 16 = 4
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 5] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$string_type_qualifier,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
        default_value: string (1),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 8, 22, 9, 22, 57, 541],
    clc$command, 5, 3, 1, 0, 0, 0, 3, 'CMM$LCU_DEFTH'], [
    ['FORWARD_SEARCH_RANGE           ',clc$nominal_entry, 2],
    ['FSR                            ',clc$abbreviation_entry, 2],
    ['HN                             ',clc$abbreviation_entry, 1],
    ['HOST_NAME                      ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 8, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 20, clc$optional_default_parameter, 0, 1],
{ PARAMETER 3
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$string_type], [1, 255, FALSE]],
{ PARAMETER 2
    [[1, 0, clc$integer_type], [1, 16, 10],
    '4'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

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

    CONST
      p$host_name = 1,
      p$forward_search_range = 2,
      p$status = 3;

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

    VAR
      network_descriptor: ^nat$network_descriptor;

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

      check_for_dup_tcpip_host_defn (cmv$network_descriptor_p, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      PUSH network_descriptor;
      network_descriptor^.kind := nac$define_tcpip_host;
      PUSH network_descriptor^.tcpip.host_name: [#SIZE(pvt [p$host_name].value^.string_value^)];
      network_descriptor^.tcpip.host_name^ :=
           pvt [p$host_name].value^.string_value^(1,#SIZE(pvt [p$host_name].value^.string_value^));
      network_descriptor^.tcpip.forward_search_range :=
          pvt [p$forward_search_range].value^.integer_value.value;

      validate_tcpip_host_name (network_descriptor^.tcpip.host_name^, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      cmp$form_network_list (network_descriptor, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

    END /main_program/;

  PROCEND cmp$define_tcpip_host;

?? OLDTITLE, OLDTITLE ??
?? NEWTITLE := 'Miscellaneous Procedures' ??
?? NEWTITLE := '  check_for_dup_host_network_defn', EJECT ??

{ PURPOSE:
{   The purpose of this procedure is to check that the host network id has not
{   been previously specified via a prior DEFINE_HOST_NETWORK command.

  PROCEDURE [INLINE] check_for_dup_host_network_defn
    (    network_descriptor_list: ^nat$network_descriptor;
     VAR status: ost$status);

    VAR
      network_descriptor: ^nat$network_descriptor;

    status.normal := TRUE;
    network_descriptor := network_descriptor_list;
    WHILE (network_descriptor <> NIL) AND (network_descriptor^.kind <> nac$host_subnet) DO
      network_descriptor := network_descriptor^.next_descriptor;
    WHILEND;
    IF network_descriptor <> NIL THEN
      osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_dup_host_network_defn, '', status);
    IFEND;

  PROCEND check_for_dup_host_network_defn;

?? OLDTITLE ??
?? NEWTITLE := '  check_for_dup_tcpip_host_defn', EJECT ??

{ PURPOSE:
{   The purpose of this procedure is to check that the TCP/IP host has not
{   been previously defined via a prior DEFINE_TCPIP_HOST command.

  PROCEDURE [INLINE] check_for_dup_tcpip_host_defn
    (    network_descriptor_list: ^nat$network_descriptor;
     VAR status: ost$status);

    VAR
      network_descriptor: ^nat$network_descriptor;

    status.normal := TRUE;
    network_descriptor := network_descriptor_list;
    WHILE (network_descriptor <> NIL) AND (network_descriptor^.kind <> nac$define_tcpip_host) DO
      network_descriptor := network_descriptor^.next_descriptor;
    WHILEND;
    IF network_descriptor <> NIL THEN
      osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_dup_tcpip_host_defn, '', status);
    IFEND;

  PROCEND check_for_dup_tcpip_host_defn;

?? OLDTITLE ??
?? NEWTITLE := '[INLINE] check_unique_element', EJECT ??

{
{ PURPOSE:
{   The purpose of this request is to check that the element name
{   specified is unique for all defined network devices.
{

  PROCEDURE [INLINE] check_unique_element
    (    network_descriptor_list: ^nat$network_descriptor;
         element_name: cmt$element_name;
     VAR status: ost$status);

    VAR
      network_descriptor: ^nat$network_descriptor;

    status.normal := TRUE;
    network_descriptor := network_descriptor_list;

  /search/
    WHILE network_descriptor <> NIL DO
      IF (network_descriptor^.kind = nac$network_device) AND
            (network_descriptor^.access.element = element_name) THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_duplicate_element,
                element_name, status);
        EXIT /search/;
      IFEND;
      network_descriptor := network_descriptor^.next_descriptor;
    WHILEND /search/;

  PROCEND check_unique_element;

?? OLDTITLE ??
?? NEWTITLE := ' [INLINE] check_unique_system_id', EJECT ??

{ PURPOSE:
{  The purpose of this request is to check that the system identifier
{ specified is unique for all defined network devices.

  PROCEDURE [INLINE] check_unique_system_id
    (    network_descriptor_list: ^nat$network_descriptor;
         system_id: nat$system_identifier;
     VAR status: ost$status);

    VAR
      network_descriptor: ^nat$network_descriptor;

    status.normal := TRUE;
    network_descriptor := network_descriptor_list;

  /search/
    WHILE network_descriptor <> NIL DO
      IF (network_descriptor^.kind = nac$network_device) AND
            (network_descriptor^.system_identifier = system_id) THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_duplicate_system_id, '', status);
        osp$append_status_integer (osc$status_parameter_delimiter, system_id, 16, TRUE, status);
        EXIT /search/;
      IFEND;
      network_descriptor := network_descriptor^.next_descriptor;
    WHILEND /search/;

  PROCEND check_unique_system_id;

?? OLDTITLE ??
?? NEWTITLE := '  continuation_line_pos', EJECT ??

  FUNCTION continuation_line_pos
    (    line: string ( * );
         transfer_count: amt$transfer_count): integer;

    VAR
      i: integer;

    continuation_line_pos := 0;
    i := transfer_count;

  /loop/
    WHILE i > 1 DO
      IF line (i - 1, 2) = '..' THEN
        continuation_line_pos := i - 2;
        EXIT /loop/;
      IFEND;
      i := i - 1;
    WHILEND /loop/;

  FUNCEND continuation_line_pos;

?? OLDTITLE ??
?? NEWTITLE := '  display_flaw_list', EJECT ??

{ PURPOSE:
{   This procedure will format the data from the correct array and put it into
{   the output file.

  PROCEDURE display_flaw_list
    (    vsn: rmt$recorded_vsn;
         flaw_dau_information_p: ^array [1 .. * ] of dmt$flaw_dau_definition;
         flaw_duplication_p: ^array [1 .. * ] of dmt$flaw_duplication;
         display_option: clt$keyword;
     VAR display_control: clt$display_control;
     VAR status: ost$status);

    VAR
      i: integer,
      stl: integer,
      str: string (80),
      str_el_1: string (3),
      str_el_2: string (32),
      str_el_3: string (3),
      str_el_4: string (3),
      str_el_5: string (10),
      str_el_6: string (18);

{ If the DISPLAY_OPTION of EFFECT was selected.

    IF display_option = 'EFFECT' THEN
      clp$new_display_line (display_control, 2, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      str (1, * ) := ' ';
      str_el_2 := '          MEDIA FLAWS FOR VSN - ';
      STRINGREP (str, stl, str_el_2, vsn);

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

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

      str (1, * ) := '    CYL  TRK SEC  THROUGH  CYL  TRK SEC  TYPE      FIRST DAU  LAST DAU';
      clp$put_display (display_control, str, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      clp$new_display_line (display_control, 1, status);
      str (1, * ) := ' ';

      IF flaw_dau_information_p^ [1].entry_initialized = FALSE THEN
        str (1, * ) := '      NO FLAWS WERE FOUND.            ';
        clp$put_display (display_control, str, clc$trim, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      IFEND;

    /display_flaw/
      FOR i := LOWERBOUND (flaw_dau_information_p^) TO UPPERBOUND (flaw_dau_information_p^) DO

        IF flaw_dau_information_p^ [i].entry_initialized = FALSE THEN
          EXIT /display_flaw/;
        IFEND;

        IF flaw_dau_information_p^ [i].reserved THEN
          str_el_5 := '  RESERVED';
        ELSE
          str_el_5 := '          ';
        IFEND;

        STRINGREP (str, stl, ' ', flaw_dau_information_p^ [i].first.cylinder: 6,
              flaw_dau_information_p^ [i].first.track: 5, flaw_dau_information_p^ [i].first.sector: 4,
              flaw_dau_information_p^ [i].last.cylinder: 14, flaw_dau_information_p^ [i].last.track: 5,
              flaw_dau_information_p^ [i].last.sector: 4, str_el_5, flaw_dau_information_p^ [i].first_dau: 10,
              flaw_dau_information_p^ [i].last_dau: 10);

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

{ If the DISPLAY_OPTION of SOURCE was selected.

    ELSE
      str_el_6 := 'DEFINE_MS_FLAW RV=';
      str_el_1 := ' C=';
      str_el_3 := ' T=';
      str_el_4 := ' S=';

    /display_flaw_command/
      FOR i := LOWERBOUND (flaw_duplication_p^) TO UPPERBOUND (flaw_duplication_p^) DO
        IF flaw_duplication_p^ [i].entry_initialized = FALSE THEN
          EXIT /display_flaw_command/;
        IFEND;

        str (1, * ) := ' ';

        IF flaw_duplication_p^ [i].sector_specified = TRUE THEN
          STRINGREP (str, stl, str_el_6, vsn, str_el_1, flaw_duplication_p^ [i].cylinder, str_el_3,
                flaw_duplication_p^ [i].track, str_el_4, flaw_duplication_p^ [i].sector);
        ELSEIF flaw_duplication_p^ [i].track_specified = TRUE THEN
          STRINGREP (str, stl, str_el_6, vsn, str_el_1, flaw_duplication_p^ [i].cylinder, str_el_3,
                flaw_duplication_p^ [i].track);
        ELSE
          STRINGREP (str, stl, str_el_6, vsn, str_el_1, flaw_duplication_p^ [i].cylinder);
        IFEND;

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

      FOREND /display_flaw_command/;
    IFEND;
  PROCEND display_flaw_list;

?? OLDTITLE ??
?? NEWTITLE := '  validate_command_usage', EJECT ??

{ PURPOSE:
{   This procedure checks user capability. If user has Configuration Administration,
{   Removable Media Operation, System displays, System Operation then normal status
{   is returned , Else Status will be set to abnormal.

  PROCEDURE validate_command_usage
    (VAR status: ost$status);

    VAR
      valid: boolean;

    status.normal := TRUE;
    IF (avp$configuration_administrator () OR avp$system_operator () OR avp$removable_media_operator () OR
          avp$system_displays ()) THEN
      RETURN; {----->
    IFEND;

    osp$set_status_abnormal ('OF', ofe$sou_not_active,
          'configuration_administration, removable_media_operation ' CAT
          'system_displays or system_operation', status);

  PROCEND validate_command_usage;

?? OLDTITLE ??
?? NEWTITLE := 'validate_tcpip_host_name', EJECT ??

{ PURPOSE:
{   The purpose of this procedure is to parse a TCP/IP host name.
{   The domain name is a string of 255 bytes or less.  The domain name
{   is subdivided into domain labels.  The domain labels are
{   separated by periods.  Domain labels can be up to 63 bytes in
{   length.  Domain labels must begin with a letter (A..Z or a..z)
{   and may be followed with 0 to 62 more letters, digits,
{   hyphens(-), or underscores (_) with the exception of the last
{   character which must be a letter or a digit.  For example,
{   arh.cdc.q---___5 is a valid host name.

  PROCEDURE validate_tcpip_host_name
    (    host_name: string ( * );
     VAR status: ost$status);

    CONST
      nlc$tcpip_max_domain_label = 63,
      nlc$tcpip_domain_seperator = '.';

    TYPE
      nlt$tcpip_valid_characters = set of '-' .. 'z';

    VAR
      alphanumeric: [STATIC, READ] nlt$tcpip_valid_characters := ['0', '1', '2', '3', '4', '5', '6', '7', '8',
            '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
            'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
            'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'],
      domain_index: 1 .. nac$sk_max_host_name_size,
      host_name_length: integer,
      string_index: 0 .. nac$sk_max_host_name_size,
      valid_letters: [STATIC, READ] nlt$tcpip_valid_characters := ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
            'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a',
            'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
            'u', 'v', 'w', 'x', 'y', 'z'],
      valid_special_characters: [STATIC, READ] nlt$tcpip_valid_characters := ['-', '_'];

    status.normal := TRUE;
    host_name_length := #SIZE (host_name);
    IF host_name_length <= nac$sk_max_host_name_size THEN
      string_index := 0;

    /parse_host_name/
      WHILE string_index < host_name_length DO
        string_index := string_index + 1;

{ The first character of the domain labels may only be alphabetic.

        IF (host_name (string_index, 1) IN valid_letters) AND (string_index < host_name_length) THEN
          domain_index := 1;

        /parse_domain_label/
          WHILE domain_index <= nlc$tcpip_max_domain_label DO
            string_index := string_index + 1;
            domain_index := domain_index + 1;
            IF domain_index <= nlc$tcpip_max_domain_label THEN
              IF (host_name (string_index, 1) IN alphanumeric) OR
                    (host_name (string_index, 1) IN valid_special_characters) THEN
                IF string_index = host_name_length THEN
                  IF NOT (host_name (string_index, 1) IN alphanumeric) THEN
                    osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_last_host_name_char,
                          host_name (string_index, 1), status);
                  IFEND;
                  EXIT /parse_host_name/;
                IFEND;
              ELSEIF host_name (string_index, 1) = nlc$tcpip_domain_seperator THEN
                IF string_index = host_name_length THEN
                  osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_last_host_name_char,
                        host_name (string_index, 1), status);
                  EXIT /parse_host_name/;
                ELSEIF NOT (host_name (string_index - 1, 1) IN alphanumeric) THEN
                  osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_last_char_domain_label,
                        host_name (string_index - 1, 1), status);
                  EXIT /parse_host_name/;
                IFEND;
                EXIT /parse_domain_label/;
              ELSE { Invalid character.
                osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_invalid_domain_label_ch,
                      host_name (string_index, 1), status);
                EXIT /parse_host_name/;
              IFEND;
            ELSEIF (string_index <= host_name_length) AND (host_name (string_index,
                  1) <> nlc$tcpip_domain_seperator) THEN
              osp$set_status_condition (cme$lcu_domain_label_too_long, status);
              EXIT /parse_host_name/;
            IFEND;
          WHILEND /parse_domain_label/;
        ELSEIF (host_name (string_index, 1) IN valid_letters) AND (string_index = host_name_length) THEN
          EXIT /parse_host_name/;
        ELSE { IF NOT valid_character(host_name (string_index,1)) THEN
          osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_first_domain_label_char,
                host_name (string_index, 1), status);
          EXIT /parse_host_name/;
        IFEND;
      WHILEND /parse_host_name/;
    ELSE { IF host_name_length > nac$sk_max_host_name_size THEN
      osp$set_status_condition (cme$lcu_tcpip_host_name_length, status);
    IFEND;
  PROCEND validate_tcpip_host_name;

?? OLDTITLE ??
?? NEWTITLE := ' DISPLAY_ELEMENT_STATUS', EJECT ??

  PROCEDURE display_element_status
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{    PROCEDURE (cmm$lcu_dises) display_element_status, dises (
{      elements, element, e: any of
{          key
{            all
{          keyend
{          list of key
{            $channel, $channel_adapter, $communications_element, $controller
{              $external_processor, $storage_device
{          keyend
{          list of name
{        anyend = ALL
{      display_options, display_option, do: any of
{          key
{            all
{          keyend
{          list of key
{            (element_identification, ei)
{            (iou_program_name, ioupn, ipn)
{            (serial_number, sn)
{            (state, s)
{          keyend
{        anyend = all
{      iou, i: name = IOU0
{      output, o: file = $OUTPUT
{      status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 11] of clt$pdt_parameter_name,
      parameters: array [1 .. 5] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 6] of clt$keyword_specification,
          recend,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
        default_value: string (3),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 9] of clt$keyword_specification,
          recend,
        recend,
        default_value: string (3),
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
        default_value: string (4),
      recend,
      type4: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type5: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [94, 8, 12, 0, 46, 55, 314],
    clc$command, 11, 5, 0, 0, 0, 0, 5, 'CMM$LCU_DISES'], [
    ['DISPLAY_OPTION                 ',clc$alias_entry, 2],
    ['DISPLAY_OPTIONS                ',clc$nominal_entry, 2],
    ['DO                             ',clc$abbreviation_entry, 2],
    ['E                              ',clc$abbreviation_entry, 1],
    ['ELEMENT                        ',clc$alias_entry, 1],
    ['ELEMENTS                       ',clc$nominal_entry, 1],
    ['I                              ',clc$abbreviation_entry, 3],
    ['IOU                            ',clc$nominal_entry, 3],
    ['O                              ',clc$abbreviation_entry, 4],
    ['OUTPUT                         ',clc$nominal_entry, 4],
    ['STATUS                         ',clc$nominal_entry, 5]],
    [
{ PARAMETER 1
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 334, clc$optional_default_parameter, 0, 3],
{ PARAMETER 2
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 420, clc$optional_default_parameter, 0, 3],
{ PARAMETER 3
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$optional_default_parameter, 0, 4],
{ PARAMETER 4
    [10, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_default_parameter, 0, 7],
{ PARAMETER 5
    [11, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$keyword_type,
    clc$list_type],
    FALSE, 3],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    245, [[1, 0, clc$list_type], [229, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [6], [
        ['$CHANNEL                       ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
        ['$CHANNEL_ADAPTER               ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
        ['$COMMUNICATIONS_ELEMENT        ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
        ['$CONTROLLER                    ', clc$nominal_entry,
  clc$normal_usage_entry, 4],
        ['$EXTERNAL_PROCESSOR            ', clc$nominal_entry,
  clc$normal_usage_entry, 5],
        ['$STORAGE_DEVICE                ', clc$nominal_entry,
  clc$normal_usage_entry, 6]]
        ]
      ],
    21, [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ,
    'ALL'],
{ PARAMETER 2
    [[1, 0, clc$union_type], [[clc$keyword_type,
    clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    356, [[1, 0, clc$list_type], [340, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [9], [
        ['EI                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
        ['ELEMENT_IDENTIFICATION         ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
        ['IOUPN                          ', clc$alias_entry,
  clc$normal_usage_entry, 2],
        ['IOU_PROGRAM_NAME               ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
        ['IPN                            ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
        ['S                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 4],
        ['SERIAL_NUMBER                  ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
        ['SN                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 3],
        ['STATE                          ', clc$nominal_entry,
  clc$normal_usage_entry, 4]]
        ]
      ]
    ,
    'all'],
{ PARAMETER 3
    [[1, 0, clc$name_type], [1, osc$max_name_size],
    'IOU0'],
{ PARAMETER 4
    [[1, 0, clc$file_type],
    '$OUTPUT'],
{ PARAMETER 5
    [[1, 0, clc$status_type]]];

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

    CONST
      p$elements = 1,
      p$display_options = 2,
      p$iou = 3,
      p$output = 4,
      p$status = 5;

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

*copy clv$display_variables
*copy cmc$minimum_page_size

    CONST
      command_name = 'DISPLAY_ELEMENT_STATUS';

    VAR
      display_control: clt$display_control,
      display_option: cmt$display_option,
      element_count: integer,
      element_index: integer,
      element_name: cmt$element_name,
      file: clt$file,
      found_element: boolean,
      header: string (26),
      iou_name: cmt$element_name,
      keyword: clt$keyword,
      lcu_element: ^array [1 .. *] of cmt$element_definition,
      local_status: ost$status,
      output_open: boolean,
      scan_p: ^clt$data_value,
      text: string (64);

?? NEWTITLE := '    abort_handler', EJECT ??

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

      IF output_open THEN
        clp$close_display (display_control, status);
        output_open := FALSE;
      IFEND;

    PROCEND abort_handler;

*copy clp$new_page_procedure

?? OLDTITLE ??
?? NEWTITLE := '    put_subtitle', EJECT ??

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

      clp$put_partial_display (display_control, header, clc$trim, amc$continue, status);

    PROCEND put_subtitle;

?? OLDTITLE, EJECT ??

    status.normal := TRUE;
    text := '   ';
    header := 'PERIPHERAL STATUS DISPLAY';
    found_element := FALSE;
    output_open := FALSE;
    #SPOIL(output_open);
    osp$establish_block_exit_hndlr (^abort_handler);

  /main_program/
    BEGIN
      validate_command_usage (status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

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

      clp$convert_string_to_file (pvt [p$output].value^.file_value^, file, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      clp$open_display (file, ^clp$new_page_procedure, display_control, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      output_open := TRUE;
      #SPOIL(output_open);

      IF display_control.page_width < cmc$minimum_page_size THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_illegal_output_file,
              pvt [p$output].value^.file_value^, status);
        osp$append_status_integer (osc$status_parameter_delimiter, cmc$minimum_page_size, 10, FALSE, status);
        EXIT /main_program/;
      IFEND;

      cmp$get_number_of_element (element_count, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      IF element_count = 0 THEN
        osp$set_status_abnormal (cmc$configuration_management_id, cme$lcu_eoi_not_returned,
              'Zero element count returned by CMP$GET_NUMBER_OF_ELEMENT', status);
        EXIT /main_program/;
      IFEND;

      PUSH lcu_element: [1 .. element_count];

      cmp$copy_active_configuration (lcu_element, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

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

      clv$titles_built := FALSE;
      clv$command_name := command_name;

      clp$put_partial_display (display_control,
            '=============================================================================== ',
             clc$trim, amc$terminate, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      clp$put_partial_display (display_control,
            'Element             Product    Iou/Channels            State Serial Iou Program ',
             clc$trim, amc$terminate, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      clp$put_partial_display (display_control,
            'Name (19 char)      Id                                       Number Name ',
             clc$trim, amc$terminate, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;
      clp$put_partial_display (display_control,
            '=============================================================================== ',
             clc$trim, amc$terminate, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      display_option := $cmt$display_option [];
      IF pvt [p$display_options].value^.kind = clc$keyword THEN
        IF pvt [p$display_options].value^.keyword_value = 'ALL' THEN
          display_option := display_option + $cmt$display_option [cmc$all_kw];
        IFEND;
      ELSE
        scan_p := pvt [p$display_options].value;
        WHILE scan_p <> NIL DO
          keyword := scan_p^.element_value^.keyword_value;
          IF keyword = 'ELEMENT_IDENTIFICATION' THEN
            display_option := display_option + $cmt$display_option [cmc$element_id_kw];
          ELSEIF keyword = 'IOU_PROGRAM_NAME' THEN
            display_option := display_option + $cmt$display_option [cmc$ioupn_kw];
          ELSEIF keyword = 'SERIAL_NUMBER' THEN
            display_option := display_option + $cmt$display_option [cmc$serial_number_kw];
          ELSEIF keyword = 'STATE' THEN
            display_option := display_option + $cmt$display_option [cmc$state_kw];
          IFEND;
          scan_p := scan_p^.link;
        WHILEND;
      IFEND;

      IF pvt [p$elements].value^.kind = clc$keyword THEN
        IF pvt [p$elements].value^.keyword_value = 'ALL' THEN
          FOR element_index := 1 TO element_count DO
            display_element (display_option, element_index, iou_name,
                               lcu_element, display_control, status);
          FOREND;
        IFEND;
      ELSE
        scan_p := pvt [p$elements].value;
        WHILE scan_p <> NIL DO
          found_element := FALSE;
          CASE scan_p^.element_value^.kind OF
          = clc$name =
            element_name := scan_p^.element_value^.name_value;

            /loop/
            FOR element_index := 1 TO element_count DO
              IF lcu_element^[element_index].element_name = element_name THEN
                IF (lcu_element^ [element_index].element_type = cmc$data_channel_element) THEN
                  IF NOT (lcu_element^ [element_index].data_channel.iou = iou_name) THEN
                    CYCLE /loop/;
                  IFEND;
                IFEND;
                display_element (display_option, element_index, iou_name,
                      lcu_element, display_control, status);
                IF NOT status.normal THEN
                  EXIT /main_program/;
                IFEND;
                found_element := TRUE;
              IFEND;
            FOREND /loop/;

            IF NOT found_element THEN
              IF cmp$valid_channel_name (element_name) THEN
                text (1, 5) := iou_name (1, 5);
                text (6, *) := element_name;
              ELSE
                text (1, *) := element_name;
              IFEND;
              osp$set_status_abnormal (cmc$configuration_management_id,
                   cme$lcm_element_not_found, text, status);
              EXIT /main_program/;
            IFEND;

          = clc$keyword =
            keyword := scan_p^.element_value^.keyword_value;

            IF keyword = '$CHANNEL' THEN
              FOR element_index := 1 TO element_count DO
                IF lcu_element^[element_index].element_type = cmc$data_channel_element THEN
                  display_element (display_option, element_index, iou_name,
                                     lcu_element, display_control, status);
                  IF NOT status.normal THEN
                    EXIT /main_program/;
                  IFEND;
                  found_element := TRUE;
                IFEND;
              FOREND;

            ELSEIF keyword = '$CHANNEL_ADAPTER' THEN
              FOR element_index := 1 TO element_count DO
                IF lcu_element^[element_index].element_type = cmc$channel_adapter_element THEN
                  display_element (display_option, element_index, iou_name,
                                     lcu_element, display_control, status);
                  IF NOT status.normal THEN
                    EXIT /main_program/;
                  IFEND;
                  found_element := TRUE;
                IFEND;
              FOREND;

            ELSEIF keyword = '$COMMUNICATIONS_ELEMENT' THEN
              FOR element_index := 1 TO element_count DO
                IF lcu_element^[element_index].element_type = cmc$communications_element THEN
                  display_element (display_option, element_index, iou_name,
                                     lcu_element, display_control, status);
                  IF NOT status.normal THEN
                    EXIT /main_program/;
                  IFEND;
                  found_element := TRUE;
                IFEND;
              FOREND;

            ELSEIF keyword = '$CONTROLLER' THEN
              FOR element_index := 1 TO element_count DO
                IF lcu_element^[element_index].element_type = cmc$controller_element THEN
                  display_element (display_option, element_index, iou_name,
                                     lcu_element, display_control, status);
                  IF NOT status.normal THEN
                    EXIT /main_program/;
                  IFEND;
                  found_element := TRUE;
                IFEND;
              FOREND;

            ELSEIF keyword = '$EXTERNAL_PROCESSOR' THEN
              FOR element_index := 1 TO element_count DO
                IF lcu_element^[element_index].element_type = cmc$external_processor_element THEN
                  display_element (display_option, element_index, iou_name,
                                     lcu_element, display_control, status);
                  IF NOT status.normal THEN
                    EXIT /main_program/;
                  IFEND;
                  found_element := TRUE;
                IFEND;
              FOREND;

            ELSEIF keyword = '$STORAGE_DEVICE' THEN
              FOR element_index := 1 TO element_count DO
                IF lcu_element^[element_index].element_type = cmc$storage_device_element THEN
                  display_element (display_option, element_index, iou_name,
                                     lcu_element, display_control, status);
                  IF NOT status.normal THEN
                    EXIT /main_program/;
                  IFEND;
                  found_element := TRUE;
                IFEND;
              FOREND;
            IFEND;
            IF NOT found_element THEN
              osp$set_status_abnormal (cmc$configuration_management_id,
                           cme$lcm_element_not_found, keyword, status);
              EXIT /main_program/;
            IFEND;
          ELSE
            ;
          CASEND;
        scan_p := scan_p^.link;
      WHILEND;
    IFEND;

    END /main_program/;

    IF output_open THEN
      clp$close_display (display_control, local_status);
      IF status.normal THEN
        status := local_status;
      IFEND;
      output_open := FALSE;
      #SPOIL(output_open);
    IFEND;

    osp$disestablish_cond_handler;

  PROCEND display_element_status;

?? TITLE := '    display_element', EJECT ??

{ PURPOSE:
{   The purpose of this procedure is to actually display the elements.
{   This is called from the procedure DISPLAY_ELEMENT_STATUS only.

  PROCEDURE display_element
    (    display_option: cmt$display_option;
         element_index: integer;
         iou_name: cmt$element_name;
         lcu_element: ^array [1 .. *] of cmt$element_definition;
     VAR display_control: clt$display_control;
     VAR status: ost$status);

    VAR
      ch_element: cmt$element_definition,
      cm_port: cmt$communications_port_number,
      ct_port: cmt$controller_port_number,
      char1: integer,
      char2: integer,
      count: integer,
      display_line: string (80),
      element: cmt$element_definition,
      element_definition: cmt$element_definition,
      eq: cmt$physical_equipment_number,
      local_status: ost$status,
      port: cmt$data_storage_port_number,
      posc: integer,
      start: integer,
      state: cmt$element_state,
      temp_str: ost$name;

    display_line (1, *) := '  ';
    display_line (1, 19) := lcu_element^[element_index].element_name(1, 19);

    IF ($cmt$display_option[cmc$all_kw] <= display_option) OR
       ($cmt$display_option[cmc$element_id_kw] <= display_option) THEN

      temp_str := osc$null_name;
      char2 := 0;
      FOR char1 := 1 TO 6 DO
        IF lcu_element^[element_index].product_id.product_number (char1, 1) <> ' ' THEN
          char2 := char2 + 1;
          temp_str (char2, 1) := lcu_element^[element_index].product_id.product_number (char1, 1);
        IFEND;
      FOREND;
      char2 := char2 + 1;
      temp_str (char2, 1) := lcu_element^[element_index].product_id.underscore;
      temp_str (char2 + 1, 3) := lcu_element^[element_index].product_id.model_number;

      display_line (21, 10) := temp_str (1, 10);
    IFEND;

    CASE lcu_element^[element_index].element_type OF
    = cmc$data_channel_element =
      display_line (32, 4) := lcu_element^[element_index].data_channel.iou (1, 4);
      display_line (36, 1) := '/';
      display_line (37, 6) := lcu_element^[element_index].element_name (1, 6);

    = cmc$controller_element =
      start := 1;
      posc := 0;
      /loop/
      FOR cm_port := LOWERVALUE(cmt$controller_port_number) TO
               UPPERVALUE(cmt$controller_port_number) DO
        IF start > 2 THEN
          EXIT /loop/;
        IFEND;
        IF lcu_element^[element_index].controller.connection.port[cm_port].configured THEN
          display_line (32+posc, 4) :=
                lcu_element^[element_index].controller.connection.port[cm_port].iou (1,4);
          display_line (36+posc, 1) := '/';
          display_line (37+posc, 6) :=
                lcu_element^[element_index].controller.connection.port[cm_port].element_name (1,6);
          start := start + 1;
          posc := 12;
        IFEND;
      FOREND /loop/;

    = cmc$storage_device_element =
      start := 1;
      posc := 0;
      element_definition := lcu_element^[element_index];
      /loop1/
      FOR port := LOWERVALUE(cmt$data_storage_port_number) TO
            UPPERVALUE(cmt$data_storage_port_number) DO
        IF start > 2 THEN
          EXIT /loop1/;
        IFEND;
        IF element_definition.storage_device.connection.port[port].configured THEN
          /inner_loop1/
          FOR count := 1 TO UPPERBOUND (lcu_element^) DO
            element := lcu_element^[count];
            IF element.element_name =
                    element_definition.storage_device.connection.port[port].element_name THEN
              EXIT /inner_loop1/;
            IFEND;
          FOREND /inner_loop1/;
          IF element.element_type = cmc$controller_element THEN
            /inner_loop2/
            FOR ct_port := LOWERVALUE(cmt$controller_port_number) TO
                           UPPERVALUE(cmt$controller_port_number) DO
              IF element.controller.connection.port[ct_port].configured THEN
                /inner_loop3/
                FOR count := 1 TO UPPERBOUND (lcu_element^) DO
                  ch_element := lcu_element^[count];
                  IF ch_element.element_name =
                       element.controller.connection.port[ct_port].element_name THEN
                    EXIT /inner_loop3/;
                  IFEND;
                FOREND /inner_loop3/;
                IF ch_element.element_type = cmc$data_channel_element THEN
                  display_line (32+posc, 4) := ch_element.data_channel.iou (1, 4);
                  display_line (36+posc, 1) := '/';
                  display_line (37+posc, 6) := ch_element.element_name (1, 6);
                  start := start + 1;
                  posc := 12;
                IFEND;
              IFEND;
            FOREND /inner_loop2/;
          ELSE
            display_line (32+posc, 4) := element.data_channel.iou (1, 4);
            display_line (36+posc, 1) := '/';
            display_line (37+posc, 6) := element.element_name (1, 6);
            start := start + 1;
            posc := 12;
          IFEND;
        IFEND;
      FOREND /loop1/;

    = cmc$channel_adapter_element =
      IF lcu_element^[element_index].channel_adapter.connection.channel.configured THEN
        display_line (32, 4) := lcu_element^[element_index].channel_adapter.connection.channel.iou (1, 4);
        display_line (36, 1) := '/';
        display_line (37, 6) :=
              lcu_element^[element_index].channel_adapter.connection.channel.element_name (1, 6);
      IFEND;

    = cmc$communications_element =
      start := 1;
      posc := 0;
      /loop2/
      FOR cm_port := LOWERVALUE(cmt$communications_port_number) TO
               UPPERVALUE(cmt$communications_port_number) DO
        IF start > 2 THEN
          EXIT /loop2/;
        IFEND;
        IF lcu_element^[element_index].communications_element.connection.port[cm_port].configured THEN
          display_line (32+posc, 4) :=
                lcu_element^[element_index].communications_element.connection.port[cm_port].iou (1,4);
          display_line (36+posc, 1) := '/';
          display_line (37+posc, 6) :=
                lcu_element^[element_index].communications_element.connection.
                                              port[cm_port].element_name (1,6);
          start := start + 1;
          posc := 12;
        IFEND;
      FOREND /loop2/;

    = cmc$external_processor_element =
      start := 1;
      posc := 0;
      /loop3/
      FOR eq := LOWERVALUE(cmt$physical_equipment_number) TO
               UPPERVALUE(cmt$physical_equipment_number) DO
        IF start > 2 THEN
          EXIT /loop3/;
        IFEND;
        IF lcu_element^[element_index].external_processor.connection.io_port[eq].configured THEN
          display_line (32+posc, 4) :=
                lcu_element^[element_index].external_processor.connection.io_port[eq].iou (1,4);
          display_line (36+posc, 1) := '/';
          display_line (37+posc, 6) :=
                lcu_element^[element_index].external_processor.connection.io_port[eq].element_name (1,6);
          start := start + 1;
          posc := 12;
        IFEND;
      FOREND /loop3/;
    CASEND;

    IF ($cmt$display_option[cmc$all_kw] <= display_option) OR
       ($cmt$display_option[cmc$state_kw] <= display_option) THEN
      cmp$get_element_state (lcu_element^[element_index].element_name,
                               {unused} iou_name, state, local_status);
      CASE state OF
      = cmc$on =
        display_line (56, 4) := 'ON  ';
      = cmc$off =
        display_line (56, 4) := 'OFF ';
      = cmc$down =
        display_line (56, 4) := 'DOWN';
      CASEND;
    IFEND;

    IF ($cmt$display_option[cmc$all_kw] <= display_option) OR
       ($cmt$display_option[cmc$serial_number_kw] <= display_option) THEN
      display_line (62, 6) := lcu_element^[element_index].serial_number;
    IFEND;

    IF ($cmt$display_option[cmc$all_kw] <= display_option) OR
       ($cmt$display_option[cmc$ioupn_kw] <= display_option) THEN
      CASE lcu_element^[element_index].element_type OF
      = cmc$channel_adapter_element =
        display_line (69,10) := lcu_element^[element_index].channel_adapter.peripheral_driver_name(1, 10);
      = cmc$communications_element =
        display_line (69,10) :=
            lcu_element^[element_index].communications_element.peripheral_driver_name(1, 10);
      = cmc$controller_element =
        display_line (69,10) := lcu_element^[element_index].controller.peripheral_driver_name(1, 10);
      = cmc$external_processor_element =
        display_line (69,10) :=
            lcu_element^[element_index].external_processor.peripheral_driver_name(1, 10);
      ELSE
        ;
      CASEND;
    IFEND;

    clp$put_partial_display (display_control, display_line, clc$trim, amc$terminate, status);

  PROCEND display_element;

?? OLDTITLE, OLDTITLE ??
MODEND cmm$logical_configuration_util;
