PROC activate_rhfam (
  status : var of status = $optional
  )

  create_variable activate_rhfam_status kind=status
  create_variable ignore_status kind=status

  create_variable cr_requested kind=string

  create_variable rhfam_utility_installed kind=boolean value=false
  create_variable rhfam_microcode_installed kind=boolean value=false
  create_variable rhfam_configuration_installed kind=boolean value=false

  create_variable rhfam_configuration_file k=string v='$system.rhfam.configuration_cmd_file'
  create_variable rhfam_utility_file k=string v='$system.rhfam.osf$rhfam_network_utilities'
  create_variable rhfam_microcode k=string v='$system.rhfam.microcode.c180'

  rhfam_utility_installed = $file($fname(rhfam_utility_file), permanent)
  rhfam_microcode_installed = $file($fname(rhfam_microcode), permanent)
  IF (NOT rhfam_utility_installed) OR (NOT rhfam_microcode_installed) THEN
    put_line ('  ', ' --ERROR-- Product RHFAM is not installed.') o=$response
    accept_line cr_requested input p='Press NEXT:'
    EXIT_PROC
  IFEND

  rhfam_configuration_installed = $file($fname(rhfam_configuration_file), permanent)
  IF NOT rhfam_configuration_installed THEN
    put_line ('  ', ' --ERROR-- RHFAM network configuration is not installed.') o=$response
    accept_line cr_requested input p='Press NEXT:'
    EXIT_PROC
  IFEND
  MANAGE_RHFAM_NETWORK
    install_rhfam_config_bin
    quit

  delete_system_task rhfam status=ignore_status
  define_system_task name=rhfam sp=rfp$rhfam_event_processor automatic_restart=false ..
        idle_task_option=ignore restart_after_idle=false tel=warning lm=$null lmo=none dm=off ..
        status=activate_rhfam_status
  EXIT_PROC WITH activate_rhfam_status WHEN NOT activate_rhfam_status.normal

  activate_system_statistic statistic=(cm7200 cm7202) log=engineering_log ..
        status=activate_rhfam_status
  EXIT_PROC WITH activate_rhfam_status WHEN NOT activate_rhfam_status.normal


  activate_system_task task_name=rhfam status=activate_rhfam_status
  EXIT_PROC WITH activate_rhfam_status WHEN NOT activate_rhfam_status.normal

  put_line ' RHFAM activated' o=$response

PROCEND activate_rhfam

