PROC select_family_admin_menu, selfam (
  natural_language, nl : name = us_english
  status               : var of status = $optional
  )

*IF $variable(wev$proc_doc,declared)<>'UNKNOWN'

"     The purpose of this command procedure is to activate the MENU/VE
"administrator menu.  For checkout purposes the variable EUV$MENU_VE_CATALOG can
"be declared XDCL'd outside this procedure to specify a different catalog then
"$SYSTEM.MENU_VE.
"
"   The first section attempts to upgrade the family administrator's environment
"from 1.2.2 to 1.2.3 and beyond.  At 1.2.3 the file $USER.FAM$DEFAULT_ATTRIBUTES
"is renamed $USER.EUF$ADMU_DEFAULT_ATTRIBUTES.
*IFEND

  IF $variable(euv$menu_ve_catalog declared) = 'NONLOCAL' THEN
    create_variable euv$menu_ve_catalog k=string s=xref
  ELSE
    create_variable euv$menu_ve_catalog k=string s=xdcl v='$SYSTEM.MENU_VE'
  IFEND

  create_variable (local_status, ignore_status) k=status
  create_variable natural_language k=string v=$string($value(natural_language))
  create_variable test_for_administrator k=string v='$local.'//$unique
  create_variable line_image k=string
  create_variable euv$terminal_hold_page k=boolean s=local v=off

select_block: ..
  BLOCK

*IF $variable(wev$proc_doc,declared)<>'UNKNOWN'
"  The following code is not needed in NOS/VE 1.3.1 and beyond. The user has to
"  create a new euf$default_attributes file for ADMINISTER_VALIDATIONS>
"
"   IF $file($user.fam$default_attributes permanent) AND
"         NOT $file($user.euf$admu_default_attributes permanent) THEN
"     copy_file i=$user.fam$default_attributes o=$user.euf$admu_default_attributes status=local_status
"     EXIT select_block WHEN NOT local_status.normal
"     delete_file $user.fam$default_attributes status=ignore_status
"   IFEND
*IFEND

    IF $job(mode) <> 'INTERACTIVE' THEN
      put_line ' -- ERROR -- Command can only be called interactively.' o=$response
      EXIT select_block
    ELSEIF (NOT $file($fname(euv$menu_ve_catalog//'.euf$admu_explain_'//natural_language), permanent)) OR ..
          (NOT $file($fname(euv$menu_ve_catalog//'.euf$admu_menu_'//natural_language) permanent)) THEN
      put_line ' Unable to locate the manuals for natural language '//natural_language//'.' o=$response
      EXIT select_block
    ELSEIF $terminal_model = '' THEN
      put_line ' -- ERROR -- No terminal model was specified.' o=$response
      EXIT select_block
    ELSE
    IFEND

*IF $variable(euv$proc_doc,declared)<>'UNKNOWN'
" Track original terminal attribute 'hold_page'. This is set to
" off in MENU_VE session
*IFEND

    attribute_file = $unique
    display_terminal_attribute output= $fname(attribute_file)
    EDIT_FILE file= $fname(attribute_file) output=$null prolog=$null status=ignore_status
      locate_text 'Hold_Page' status= ignore_status
      line_image = $line_text
    QUIT
    IF $scan_string('on', line_image) <> 0 THEN
      euv$terminal_hold_page = on
    IFEND
    detach_file $fname(attribute_file) status= ignore_status

    copy_file input=$fname(euv$menu_ve_catalog//'.euf$admu_menu_'//natural_language) ..
          output=$local.euf$admu_menu status=local_status
    EXIT select_block WHEN NOT local_status.normal

    copy_file input=$fname(euv$menu_ve_catalog//'.euf$admu_explain_'//natural_language) ..
          output=$local.euf$admu_explain status=local_status
    EXIT select_block WHEN NOT local_status.normal

    PUSH command_list

    create_command_list_entry entry=$fname(euv$menu_ve_catalog//'.euf$admu_menu_library') status=local_status
    IF (NOT local_status.normal) AND ($condition(local_status.condition) = 'CLE$DUPLICATE_COMMAND_LIST_ENT')..
           THEN
      local_status.normal = true
    IFEND
    EXIT select_block WHEN NOT local_status.normal

    set_terminal_attribute hp=off
    explain m=$local.euf$admu_menu status=local_status
    set_terminal_attribute hp=euv$terminal_hold_page

  BLOCKEND select_block

  detach_file $local.euf$admu_menu status=ignore_status
  detach_file $local.euf$admu_explain status=ignore_status

  EXIT_PROC WITH local_status WHEN NOT local_status.normal

PROCEND select_family_admin_menu
