PROCEDURE rap$create_default_family (
  family_name, fn: name = $required
  user_name, un: name = $required
  password, pw, p: (SECURE) name = $required
  account_name, an: name = NONE
  project_name, pn: name = NONE
  permanent_file_set, pfs: name = $optional
  status)

*IF $variable(wev$prod_doc,declared)<>'UNKNOWN'
"
"   This procedure performs several miscellaneous tasks which must be
"performed during an initial installation.
"
"  1.  Create the family specified in the parameter FAMILY_NAME, and
"      define the specified password.  If account or project level validations
"      are planned, specify the account and/or project name parameters.
"      This prevents a possible deadlock situation if in the future, the
"      site uses a validation level other than user.  If so, a log on to
"      the family administrator user name would fail unless the validation
"      level was temporarily set to user, the account and/or project name
"      set for the administrator user, and the appropriate validation level
"      reset to what it was previously.
"
"  2.  Make this family the default login family by executing the
"      approriate system command, and also by placing this command
"      in the system_initiation_prolog.
"
"  3.  Calls the procedure to allow the user_name access to the
"      configuration files.
"
"  4.  Copies the released version of PHYSICAL_CONFIG to the site's
"      version in the configuration file catalog.
"
"  5.  Creates file permits for user_name to the files
"      $SYSTEM.MANUALS.SITE_ANALYST_EXAMPLES, and
"      $SYSTEM.MANUALS.EXAMPLES_FILES.SITE_ANALYST_SOURCE.
"
"
*IFEND


  "$FORMAT=OFF
  VAR
    ignore_status: status
    local_status: status
    validation_file: string
  VAREND
  "$FORMAT=ON"

setup_block: ..
  BLOCK

  IF NOT $specified(permanent_file_set) THEN
    $system.osf$sou_library.create_family family_name=family_name family_user_administrator=user_name ..
          password=password account_name=account_name project_name=project_name status=local_status
  ELSE "permanent_file_set was specified
    $system.osf$sou_library.create_family family_name=family_name family_user_administrator=user_name ..
          password=password account_name=account_name project_name=project_name ..
          permanent_file_set=permanent_file_set status=local_status
  IFEND
  EXIT setup_block WHEN NOT local_status.normal

  $system.put_line 'change_job_attribute_default login_family='//$string(family_name) ..
        o=$system.prologs_and_epilogs.system_initiation_prolog.$eoi status=local_status
  EXIT setup_block WHEN NOT local_status.normal

  $system.osf$sou_library.change_job_attribute_default login_family=family_name ..
    status=local_status
  EXIT setup_block WHEN NOT local_status.normal

  change_config_file_access configuration_file_access=on fn=family_name un=user_name ..
    status=local_status
  EXIT setup_block WHEN NOT local_status.normal

  $system.copy_file i=$system.mainframe.configuration ..
        o=$system.site_os_maintenance.deadstart_commands.physical_config status=local_status
  EXIT setup_block WHEN NOT local_status.normal

  $system.detach_file $system.mainframe.configuration status=ignore_status
  $system.detach_file $system.site_os_maintenance.deadstart_commands.physical_config status=ignore_status

  $system.create_file_permit f=$system.manuals.site_analyst_examples g=user fn=family_name u=user_name ..
    am=(read execute) status=local_status
  EXIT setup_block WHEN NOT local_status.normal

  $system.create_file_permit f=$system.manuals.examples_files.site_analyst_source_library g=user ..
        fn=family_name u=user_name am=(read execute) status=local_status
  EXIT setup_block WHEN NOT local_status.normal

  BLOCKEND setup_block

  EXIT procedure WITH local_status WHEN NOT local_status.normal

PROCEND rap$create_default_family

