PROCEDURE (osm$sysou) system_operator_utility, sysou, sou (
  capabilities, capability, c: list of key
      (accounting_administration, aa)
      (configuration_administration, ca)
      (family_administration, fa)
      (removable_media_administration, rma)
      (removable_media_operation, rmo)
      (system_administration, sa)
      (system_displays, sd)
      (system_operation, so)
    keyend = $optional
  input, i: file = $command
  status)

  VAR
    selected: record
      accounting_administration : boolean,
      configuration_administration : boolean,
      family_administration : boolean,
      removable_media_administration : boolean,
      removable_media_operation : boolean,
      system_administration : boolean,
      system_displays : boolean,
      system_operation : boolean,
    recend
    user_displays_enabled: boolean
    enaud_status: status
  VAREND

  TASK

    $system.osf$sou_library.ofp$evaluate_sou_capabilities selected capabilities

    UTILITY name=system_operator_utility prompt='sou' search_mode=global ..
          libraries=($system.osf$sou_library, $system.osf$builtin_library) ..
          termination_command_name=quit

" Add SOU support subcommands. These commands are available independent of
" the capabilities active.

      command (display_active_capabilities, display_active_capability, disac) ..
            processor=ofp$display_sou_capabilities
      command (quit, end_system_operator_utility, endsou, qui) processor=ofp$end_system_operator_utility

" Add commands that are available if only accounting_administration is active.

"     IF selected.accounting_administration THEN
"     IFEND

" Add commands that are available if only configuration_administration is active.

      IF selected.configuration_administration THEN
        command (activate_set, acts) processor=activate_set
        command (change_default_date_format, chaddf) processor=change_default_date_format
        command (change_default_time_format, chadtf) processor=change_default_time_format
        command (change_dual_state_environment, chadse) processor=change_dual_state_environment
        command (change_job_attribute_default, change_job_attribute_defaults, chajad) ..
              processor=change_job_attribute_default
        command (change_kill_job_action, chakja) processor=change_kill_job_action
        command (change_nam_attributes, change_nam_attribute, chana) processor=change_nam_attributes
        command (change_tape_scan_frequency, chatsf) processor=change_tape_scan_frequency
        command (change_tape_validation, chatv) processor=change_tape_validation
        command (manage_exception_policies, manep) processor=manage_exception_policies
        command (set_system_attribute, setsa) processor=set_system_attribute
        command (save_system_attributes, save_system_attribute, savsa) processor=save_system_attributes
        command (restore_system_attributes, restore_system_attribute, reset_system_attributes, ..
              reset_system_attribute, ressa) processor=restore_system_attributes
      IFEND

" Add commands that are available if only family_administration is active.

"     IF selected.family_administration THEN
"     IFEND

" Add commands that are available if only removable_media_administration is active.

"     IF selected.removable_media_administration THEN
"     IFEND

" Add commands that are available if only removable_media_operation is active.

      IF selected.removable_media_operation THEN
        command (assign_device, assd) processor=assign_device
        command (create_blank_labeled_volume, creblv) processor=create_blank_labeled_volume
        command (create_blank_unlabeled_volume, crebuv) processor=create_blank_unlabeled_volume
        command (initialize_tape_volume, initv) processor=initialize_tape_volume
        command (label_tape_volumes, label_tape_volume, labtv) processor=label_tape_volumes
        command (reassign_device, read) processor=reassign_device
        command (terminate_tape_assignment, terta) processor=terminate_tape_assignment
      IFEND

" Add commands that are available if only system_administration is active.

      IF selected.system_administration THEN
        command (activate_archive_ve, actav) processor=activate_archive_ve
        command (administer_security_audit, admsa) processor=administer_security_audit
        command (backup_job_files, bacjf) processor=jmp$backup_job_files
        command (backup_output_files, bacof) processor=jmp$backup_output_files
        command (change_family) processor=change_family
        command (change_operation_password chaop) processor=change_operation_password
        command (create_aged_file_backup, creafb, archive_files, arcf) processor=create_aged_file_backup
        command (create_catalog_backup, crecb, backup_catalogs, bacc) processor=create_catalog_backup
        command (create_family) processor=create_family
        command (create_full_backup, crefb, full_backup, fulb) processor=create_full_backup
        command (create_partial_backup, crepb, partial_backup, parb) processor=create_partial_backup
        command (deactivate_archive_ve, deaav) processor=deactivate_archive_ve
        command (delete_expired_files, delef) processor=delete_expired_files
        command (disable_main_operator_window, dismow) processor=disable_main_operator_window
        command (display_all_files, disaf) processor=display_all_files
        command (display_unreconciled_files, disuf) processor=display_unreconciled_files
        command (enable_main_operator_window, enamow) processor=enable_main_operator_window
        command pup$construct_volume_list processor=pup$construct_volume_list a=hidden
        command pup$generate_backup_listing processor=pup$generate_backup_listing a=hidden
        command (restore_cataloged_files, rescf, restore, res) processor=restore_cataloged_files
        command (restore_job_files, resjf) processor=jmp$restore_job_files
        command (restore_output_files, resof) processor=jmp$restore_output_files
        command (restore_unreconciled_catalogs, resuc, restore_missing_catalogs, resmc) ..
              processor=restore_unreconciled_catalogs
        command (restore_unreconciled_files, resuf, restore_lost_cycles, reslc) ..
              processor=restore_unreconciled_files
        command (set_operation_password, setop) processor=set_operation_password
        command (set_operation_interval, setoi) processor=set_operation_interval
      IFEND

" Add commands that are available if ENABLE_USER_DISPLAYS system attribute is active.

      $system.osf$sou_library.ofp$_get_system_attribute enable_user_displays user_displays_enabled ..
            status=enaud_status
      IF NOT enaud_status.normal THEN
        display_value value=enaud_status output=output
        put_line ' User display commands will not be available.' output=output
      ELSEIF user_displays_enabled THEN
        command (display_all_input, disai) processor=display_all_input
        command (display_all_output, disao) processor=display_all_output
        command (display_site_ved_names, dissvn) processor=display_site_ved_names
        command (vedisplay, ved) processor=vedisplay
        command (ved_utility, vedu) processor=ved_utility
      IFEND

" Add commands that are available if only system_operation is active.

      IF selected.system_operation THEN
        command (activate_btfs) processor=activate_btfs
        command (activate_drje) processor=activate_drje
        command (activate_ftam_responder) processor=activate_ftam_responder
        command (activate_history_log, acthl) processor=activate_history_log
        command (activate_mail_delivery_agent, actmda) processor=activate_mail_delivery_agent
        command (activate_mail_gateway) processor=activate_mail_gateway
        command (activate_mailve) processor=activate_mailve
        command (activate_network_clock, actnc) processor=activate_network_clock
        command (activate_network_file_access, actnfa) processor=activate_network_file_access
        command (activate_network_initializer, actni) processor=activate_network_initializer
        command (activate_network_log, actnl) processor=activate_network_log
        command (activate_ntf) processor=activate_ntf
        command (activate_ntf_mail) processor=activate_ntf_mail
        command (activate_ptf) processor=activate_ptf
        command (activate_qtf) processor=activate_qtf
        command (activate_qtfs) processor=activate_qtfs
        command (activate_scf) processor=activate_scf
        command (activate_scfs) processor=activate_scfs
        command (activate_system_logging, actsl) processor=activate_system_logging
        command (activate_system_task, activate_system_tasks, actst) processor=activate_system_task
        command (activate_xtf) processor=activate_xtf
        command (change_date, chad) processor=change_date
        command (change_priority, chap) processor=change_priority
        command (change_time, chat) processor=change_time
        command (change_time_zone, chatz) processor=change_time_zone
        command (deactivate_btfs) processor=deactivate_btfs
        command (deactivate_drje) processor=deactivate_drje
        command (deactivate_ftam_responder) processor=deactivate_ftam_responder
        command (deactivate_history_log, deahl) processor=deactivate_history_log
        command (deactivate_mail_delivery_agent, deamda) processor=deactivate_mail_delivery_agent
        command (deactivate_mail_gateway) processor=deactivate_mail_gateway
        command (deactivate_mailve) processor=deactivate_mailve
        command (deactivate_network_clock, deanc) processor=deactivate_network_clock
        command (deactivate_network_file_access, deanfa) processor=deactivate_network_file_access
        command (deactivate_network_initializer, deani) processor=deactivate_network_initializer
        command (deactivate_network_log, deanl) processor=deactivate_network_log
        command (deactivate_ntf) processor=deactivate_ntf
        command (deactivate_ntf_mail) processor=deactivate_ntf_mail
        command (deactivate_ptf) processor=deactivate_ptf
        command (deactivate_qtf) processor=deactivate_qtf
        command (deactivate_qtfs) processor=deactivate_qtfs
        command (deactivate_scf) processor=deactivate_scf
        command (deactivate_scfs) processor=deactivate_scfs
        command (deactivate_system_logging, deasl) processor=deactivate_system_logging
        command (deactivate_system_task, deactivate_system_tasks, deast) processor=deactivate_system_task
        command (deactivate_xtf) processor=deactivate_xtf
        command (define_system_task, defst) processor=define_system_task a=hidden
        command (delete_system_task, delst, remove_system_task, remst) processor=delete_system_task a=hidden

" SET_JOB_CLASS_LIMIT is a hidden command that will not be supported in the future.

        command (set_job_class_limit, set_job_class_limits, setjcl) processor=set_job_class_limit a=hidden
        command (swap_in_job, swapin, swaij) processor=swap_in_job
        command (swap_out_job, swapout, swaoj) processor=swap_out_job
        command (terminate_system) processor=terminate_system

" Add the activate nqs command if the $system.nqs catalog exists.

        IF $wild_card_files($system.nqs, include_catalogs) <> () THEN
          command (activate_nqs) processor=activate_nqs
          command (deactivate_nqs) processor=deactivate_nqs
        IFEND
      IFEND

" Add commands that are available if either configuration_administration or
" system_displays is active.

      IF selected.configuration_administration OR selected.system_displays THEN
        command (display_kill_job_action, diskja) processor=display_kill_job_action
        command (display_nam_attributes, disna) processor=display_nam_attributes
        command (display_system_attribute, dissa) processor=display_system_attribute
        command (display_tape_scan_frequency, distsf) processor=display_tape_scan_frequency
        command (display_tape_validation, distv) processor=display_tape_validation
        command (manage_periodic_statistics, manps) processor=manage_periodic_statistics
      IFEND
" Add commands that are available if either removable_media_operation or system_operation is active.

      IF selected.removable_media_operation OR selected.system_operation THEN
        command (acknowledge_operator_message, ackom) processor=acknowledge_operator_message
      IFEND

" Add commands that are available if either system_displays or system_operation is active.

      IF selected.system_displays OR selected.system_operation THEN
        command (display_all_input, disai) processor=display_all_input
        command (display_all_output, disao) processor=display_all_output
        command (display_critical_window_log, discwl) processor=display_critical_window_log
        command (display_site_ved_names, dissvn) processor=display_site_ved_names
        command (display_system_log, dissl) processor=display_system_log
        command (display_system_task_data, disstd) processor=display_system_task_data
        command (ved_utility, vedu) processor=ved_utility
        command (manage_queue_file, manage_queue_files, manqf) processor=manage_queue_file
      IFEND

" Add commands that are available if any of accounting_administration, configuration_administration,
" or system_operation is active.

      IF selected.accounting_administration OR selected.configuration_administration OR ..
            selected.system_operation THEN
        command (activate_system_statistic, activate_system_statistics, actss) ..
              processor=activate_system_statistic
        command (deactivate_system_statistic, deactivate_system_statistics, deass) ..
              processor=deactivate_system_statistic
        command (terminate_log, terl) processor=terminate_log
      IFEND

" Add commands that are available if any of configuration_administration,
" removable_media_operation, system_displays, or system_operation is active.

      IF selected.configuration_administration OR selected.removable_media_operation OR selected..
.system_displays OR selected.system_operation THEN
        command (display_system_configuration, dissc) processor=display_system_configuration
        command (logical_configuration_utility, lcu) processor=logical_configuration_utility
      IFEND

" Add commands that are available if any of removable_media_administration, removable_media_operation,
" system_displays, or system_operation is active.

      IF selected.removable_media_administration OR selected.removable_media_operation OR selected..
.system_displays OR selected.system_operation THEN
        command (vedisplay, ved) processor=vedisplay
      IFEND

" Add commands that are available if any of removable_media_operation,
" system_displays, or system_operation is active.

      IF selected.removable_media_operation OR selected.system_displays OR selected.system_operation THEN
        command (display_operator_action_menu, display_operator_action_menus, disoam) ..
              processor=display_operator_action_menu
        command (display_operator_action_status, disoas) processor=display_operator_action_status
      IFEND

" Add commands that are available if system_administration or family_administration is selected.

      IF selected.system_administration OR selected.family_administration THEN
        command (compress_validation_file, comvf) processor=compress_validation_file
        command (move_classes, move_class, movc) processor=move_classes
        command (retrieve_qualified_files, retqf) processor=retrieve_qualified_files
      IFEND

" Add commands that are available if any of configuration_administration,
" system_displays, or system_operation is active.

      IF selected.configuration_administration OR selected.system_displays OR selected.system_operation THEN
        command (display_active_volumes, disav) processor=display_active_volumes
        command (display_heap_map, dishm) processor=display_heap_map
      IFEND

" Add commands that are available if either configuration_administration or
" system_operation is active.

      IF selected.configuration_administration OR selected.system_operation THEN
        command (run_das_disk_head_shift_test, runddhst) processor=run_das_disk_head_shift_test
      IFEND
      tablend

      $system.osf$sou_library.ofp$activate_sou_capabilities selected
      delete_variable n=selected

      include_file f=input u=system_operator_utility
    UTILITYEND
  TASKEND

PROCEND system_operator_utility
