  CONST
    osc$ecp_max_poll_frequency = 60 {seconds} * 60 {minutes} * 24 {hours} * 366
          {days} ,

    osc$ecp_number_of_conditions = 7;

  TYPE

{ Exception policies are stored in a sequence in mainframe pageable.  The
{ policies are stored in chronological order; the most recent and most
{ specific applicable policy is binding.

{ Applicability exists when the job affected by an exception condition
{ matches the "who", "what", and "which" aspects of an exception policy.  A
{ policy may consist of any combination of "who" and "what" aspects plus at
{ least one "which" aspect.

{ Within a given policy, the "who" and "what" aspects of the policy determine
{ which users and/or objects are covered by the policy.  These aspects are
{ listed in order of decreasing weight.  This determines the order that
{ applicability is investigated.  The "who" policies carry more weight than
{ "what" policies.  The "who" aspects are JOBS, LOGIN_USERS, JOB_MODE, and
{ JOB_CLASSES.  The "what" aspects are FILES, MASS_STORAGE_CLASSES, VOLUMES,
{ FAMILIES, and SETS.

{ Within a given policy, the "which" aspects of the policy define the
{ exception conditions covered by the policy.  The "which" aspects are
{ CATALOG_VOLUME_UNAVAILABLE, CYCLE_BUSY, CYCLE_RESTORATION_REQUIRED,
{ DATA_RETRIEVAL_REQUIRED, FILE_SERVER_INACTIVE, SPACE_UNAVAILABLE, and
{ VOLUME_UNAVAILABLE.

{ For an applicable policy, one or more "actions" are authorized.  "Actions"
{ are the values supplied for the parameter corresponding to the condition on
{ CHANGE_EXCEPTION_POLICIES.  If the option is to WAIT, the value specified
{ for the POLLING_FREQUENCY is used to control the polling frequency of an
{ affected job.

{ Each policy in the sequence is preceded by an ost$ecp_policy_header
{ followed by an optional range of bytes referred to as the "policy body".
{ The "policy body" contains the values of the specified aspects.  The
{ ost$ecp_policy_header contains a pointer to the next policy header.

    ost$ecp_header = record
      first_policy: ^ost$ecp_policy_header,
      last_accessed_policy: ost$non_negative_integers,
      last_policy: ^ost$ecp_policy_header,
      number_of_policies: ost$non_negative_integers,
      segment_p: amt$segment_pointer,
      system_default_policies: boolean,
    recend,

    ost$ecp_policy_header = record
      next_policy: ^ost$ecp_policy_header,

      {The following "who" aspects of the policy are ordered by decreasing
      { weight}
      jobs: ^ost$ecp_name_list,
      login_users: ^ost$ecp_login_users_list,
      job_mode: ost$ecp_job_mode,
      job_classes: ^ost$ecp_name_list,

      {The following "what" aspects of the policy are ordered by decreasing
      { weight}
      {NOTE: FILES=ALL has the least weight and a specific file has the most
      { weight}
      files: ost$ecp_files,
      mass_storage_classes: ost$ecp_ms_classes,
      volumes: ^ost$ecp_volume_list,
      families: ^ost$ecp_name_list,
      sets: ^ost$ecp_name_list,

      conditions: ost$ecp_conditions,

      polling_frequency: ost$ecp_polling_frequency,
    recend,

    ost$ecp_actions = set of ost$ecp_action,

    ost$ecp_action = (osc$ecp_delete, osc$ecp_enable_matching_image,
          osc$ecp_enable_nonmatch_image, osc$ecp_exit,
          osc$ecp_set_damage_condition, osc$ecp_wait),

    ost$ecp_conditions = array [ost$ecp_number_of_conditions] of
          ost$ecp_exception_condition,

    ost$ecp_criteria = record
      condition: fst$file_access_condition,
      family_path_name: ost$name,
      file: fst$path,
      job: jmt$system_supplied_name,
      job_class: ost$name,
      job_mode: jmt$job_mode,
      login_family: ost$name,
      login_user: ost$name,
      mass_storage_class: dmt$class_member,
      set_name: ost$name,
      volume_list: ^rmt$volume_list,
    recend,

    ost$ecp_exception_condition = record
      exception_name: ost$name,
      exception_ordinal: ost$ecp_function_param_ordinal,
      file_access_conditions: fst$file_access_conditions,
      case specified: boolean of
      = TRUE =
        actions: ost$ecp_actions,
      = FALSE =
      casend,
    recend,

    ost$ecp_files = record
      case specified: boolean of
      = TRUE =
        case all_specified: boolean of
        = TRUE =
          ,
        = FALSE =
          path_list: ^array [1 .. * ] of ost$ecp_file_entry,
        casend,
      casend,
    recend,

    ost$ecp_file_entry = record
      path: ^string ( * ),
      case file_reference_type: ost$ecp_file_reference_kind of
      = osc$ecp_evaluated_reference, osc$ecp_generic_reference =
        ,
      = osc$ecp_wild_card_reference =
        wild_card_pattern_type: clt$wild_card_pattern_type,
      casend,
    recend,

    ost$ecp_file_reference_kind = (osc$ecp_evaluated_reference,
          osc$ecp_generic_reference, osc$ecp_wild_card_reference),

    {A correspondence must be maintained between the integer value of these
    { ordinals and the order of the parameters of the CHANGE_EXCEPTION_POLICIES
    { subcommand.  This ensures that the order of the parameter values displayed
    { by DISPLAY_EXCEPTION_POLICIES and $EXCEPTION_POLICIES is the same as
    { CHAEP.

    ost$ecp_function_param_ordinal = (osc$fp_null, osc$fp_job_classes,
          osc$fp_job_mode, osc$fp_jobs, osc$fp_login_users, osc$fp_families,
          osc$fp_files, osc$fp_mass_storage_classes, osc$fp_sets,
          osc$fp_volumes, osc$fp_catalog_vol_unavailable, osc$fp_cycle_busy,
          osc$fp_cycle_restoration_req, osc$fp_data_retrieval_req,
          osc$fp_file_server_inactive, osc$fp_space_unavailable,
          osc$fp_volume_unavailable, osc$fp_polling_frequency),

    ost$ecp_job_mode = record
      case specified: boolean of
      = TRUE =
        value: jmt$job_mode,
      = FALSE =
      casend,
    recend,

    ost$ecp_login_users_list = array [1 .. * ] of ost$ecp_login_user,

    ost$ecp_login_user = record
      specified_fields: ost$ecp_specified_login_fields,
      {Ordered in terms of increasing weight}
      user_name: ost$name,
      family_name: ost$name,
      job_class: jmt$job_class_name,
      job_mode: jmt$job_mode,
    recend,

    ost$ecp_ms_classes = record
      case specified: boolean of
      = TRUE =
        value: dmt$class,
      = FALSE =
      casend,
    recend,

    ost$ecp_name_list = array [1 .. * ] of ost$name,

    ost$ecp_number_of_conditions = 1 .. osc$ecp_number_of_conditions,

    ost$ecp_policy_criteria = set of ost$ecp_policy_criterion,

    ost$ecp_policy_criterion = (osc$ecp_all_files, osc$ecp_job_classes,
          osc$ecp_job_mode, osc$ecp_jobs, osc$ecp_families,
          osc$ecp_list_of_files, osc$ecp_login_users,
          osc$ecp_mass_storage_classes, osc$ecp_sets, osc$ecp_volumes),

    ost$ecp_policy_weight = (osc$ecp_nonapplicable_policy,
          osc$ecp_all_files_priority, osc$ecp_set_priority,
          osc$ecp_family_priority, osc$ecp_ms_class_priority,
          osc$ecp_volume_priority, osc$ecp_specific_path_priority,
          osc$ecp_job_class_priority, osc$ecp_job_mode_priority,
          osc$ecp_lu_user_priority, osc$ecp_lu_family_priority,
          osc$ecp_lu_job_class_priority, osc$ecp_lu_job_mode_priority,
          osc$ecp_job_priority),

    ost$ecp_polling_frequency = record
      case specified: boolean of
      = TRUE =
        value: 1 .. osc$ecp_max_poll_frequency,
      = FALSE =
      casend,
    recend,

    ost$ecp_sequence_index = (osc$ecp_session_policies,
          osc$ecp_installed_policies),

    ost$ecp_specified_login_fields = set of ost$ecp_specified_login_field,

    { A correspondence must be maintained between the integer value of these
    { ordinals and the order of the fields of the LOGIN_USERS parameter of
    { the CHANGE_EXCEPTION_POLICIES subcommand.  This ensures that the order of
    { the
    { parameter values displayed  by DISPLAY_EXCEPTION_POLICIES and
    { $EXCEPTION_POLICIES is the same as CHAEP.
    ost$ecp_specified_login_field = (osc$lu_user_name, osc$lu_family_name,
          osc$lu_job_class, osc$lu_job_mode),

    ost$ecp_volume_list = array [1 .. * ] of rmt$recorded_vsn;

*copyc amt$segment_pointer
*copyc clt$wild_card_pattern_type
*copyc dmt$class
*copyc fsc$longest_wait_time
*copyc fst$evaluated_file_reference
*copyc fst$file_access_conditions
*copyc fst$file_reference
*copyc fst$path
*copyc jmt$job_class_name
*copyc jmt$job_mode
*copyc jmt$system_supplied_name
*copyc osd$integer_limits
*copyc ost$name
*copyc ost$status
*copyc rmt$volume_list
