?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Disk Fault Tolerance:  Exception Policies Commands.' ??
MODULE osm$manage_exception_policies;

{ PURPOSE:
{   This module contains the command interfaces for establishing and displaying
{   disk fault tolerance exception processing policies.

?? NEWTITLE := 'Global Declarations Referenced by This Module.', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc clt$path_display_chunks
*copyc fsc$local
*copyc osd$exception_policies
*copyc ose$disk_ft_exceptions
*copyc ost$date
*copyc ost$ecp_file_identification
*copyc ost$heap
*copyc ost$time
*copyc rmc$unspecified_file_class
?? POP ??
*copyc amp$fetch
*copyc amp$get_segment_pointer
*copyc amv$nil_file_identifier
*copyc bap$find_open_file_via_segment
*copyc clp$begin_utility
*copyc clp$build_standard_title
*copyc clp$build_pattern_for_wild_card
*copyc clp$close_display
*copyc clp$convert_data_to_string
*copyc clp$convert_file_ref_to_string
*copyc clp$count_list_elements
*copyc clp$end_include
*copyc clp$end_utility
*copyc clp$evaluate_file_reference
*copyc clp$evaluate_parameters
*copyc clp$find_scl_options
*copyc clp$include_command
*copyc clp$include_file
*copyc clp$make_file_value
*copyc clp$make_integer_value
*copyc clp$make_keyword_value
*copyc clp$make_list_value
*copyc clp$make_name_value
*copyc clp$make_record_value
*copyc clp$make_unspecified_value
*copyc clp$match_string_pattern
*copyc clp$new_display_line
*copyc clp$new_display_page
*copyc clp$open_display_reference
*copyc clp$put_data_representation
*copyc clp$put_display
*copyc clp$put_partial_display
*copyc clp$reset_for_next_display_page
*copyc clp$right_justify_string
*copyc clp$trimmed_string_size
*copyc clv$nil_display_control
*copyc fsp$convert_fs_structure_to_pf
*copyc fsp$default_file_class
*copyc jmp$get_job_attributes
*copyc jmp$validate_name
*copyc mmp$create_scratch_segment
*copyc mmp$delete_scratch_segment
*copyc osp$append_status_parameter
*copyc osp$r3_get_installed_policies
*copyc osp$r3_install_exception_policy
*copyc osp$disestablish_cond_handler
*copyc osp$establish_block_exit_hndlr
*copyc osp$file_access_condition
*copyc osp$generate_output_message
*copyc osp$get_access_condition_entry
*copyc osp$set_status_condition
*copyc osp$store_sequence_headers
*copyc oss$job_paged_literal
*copyc osv$ecp_sequence_headers
*copyc pfp$convert_pft$path_to_fs_str
*copyc pfp$get_object_information
*copyc pmp$wait
?? OLDTITLE, EJECT ??
?? NEWTITLE := 'Global Declarations Declared by This Module', EJECT ??

  CONST
    all_keyword = 'ALL',
    batch = 'BATCH',
    family_keyword = 'FAMILY',
    interactive = 'INTERACTIVE',
    job_keyword = 'JOB',
    job_class_keyword = 'JOB_CLASS',
    job_mode_keyword = 'JOB_MODE',
    mass_storage_class_keyword = 'MASS_STORAGE_CLASS',
    max_volumes_per_file = 500,
    one_second = 1000,
    set_keyword = 'SET',
    user_keyword = 'USER',
    utility_name = 'MANAGE_EXCEPTION_POLICIES      ',
    utility_prompt = 'MEP',
    volumes_keyword = 'VOLUMES';

  CONST
    login_users_fields = 4,
    number_of_fields = 17;

  VAR

?? FMT (FORMAT := OFF) ??
    action_names: [READ, oss$job_paged_literal] array [ost$ecp_action] of ost$name :=
          ['DELETE                         ', 'ENABLE_MATCHING_IMAGE          ',
           'ENABLE_NONMATCHING_IMAGE       ', 'EXIT                           ',
           'SET_DAMAGE_CONDITION           ', 'WAIT                           '],

{ The following subcommand images are the system default exception condition policies.
{ Generally, our default policy is to wait for an exception condition.  However, we
{ have a policy of special-casing the System Job so that it waits only for cycle busy
{ conditions.  This ensures that we do not lock up the console terminal in disaster
{ situations.  We wait for cycle busy conditions in the System Job because of the
{ potential use of magnetic tapes from the console and the corresponding wait for the
{ REMOVABLE_MEDIA_MANAGEMENT_SYSTEM (RMS) data base.

    default_policies: [READ, oss$job_paged_literal] array [1 .. 6] of string (286) := [
        'change_exception_policies files=all catalog_volume_unavailable=wait cycle_restoration_required=wait '
  CAT   'volume_unavailable=wait polling_frequency=60                                                        '
  CAT   '                                                                  ',

        'change_exception_policies files=all data_retrieval_required=wait polling_frequency=35               '
  CAT   '                                                                                                    '
  CAT   '                                                                  ',

        'change_exception_policies files=all file_server_inactive=wait polling_frequency=30                  '
  CAT   '                                                                                                    '
  CAT   '                                                                  ',

        'change_exception_policies files=all space_unavailable=wait polling_frequency=10                     '
  CAT   '                                                                                                    '
  CAT   '                                                                  ',

        'change_exception_policies files=all cycle_busy=wait polling_frequency=7                             '
  CAT   '                                                                                                    '
  CAT   '                                                                  ',

        'change_exception_policies jobs=$aaa_0000 catalog_volume_unavailable=exit cycle_busy=wait            '
  CAT   'cycle_restoration_required=exit data_retrieval_required=exit file_server_inactive=exit              '
  CAT   'space_unavailable=wait volume_unavailable=exit polling_frequency=5'],

    function_field_names: [READ, oss$job_paged_literal] array [osc$fp_null .. osc$fp_volumes] of
          ost$name := ['NULL                           ', 'JOB_CLASSES                    ',
                       'JOB_MODE                       ', 'JOBS                           ',
                       'LOGIN_USERS                    ', 'FAMILIES                       ',
                       'FILES                          ', 'MASS_STORAGE_CLASSES           ',
                       'SETS                           ', 'VOLUMES                        '],

    header_initialization_record: [READ, oss$job_paged_literal] ost$ecp_header := [
     {first_policy} NIL,
     {last_accessed_policy} 0,
     {last_policy} NIL,
     {number_of_policies} 0,
     {segment_p} [amc$sequence_pointer, NIL],
     {system_default_policies} FALSE],

    policy_initialization_record: [READ, oss$job_paged_literal] ost$ecp_policy_header := [
     {next_policy} NIL,
     {jobs} NIL,
     {login_users} NIL,
     {job_mode.specified} [FALSE],
     {job_classes} NIL,
     {files.specified} [FALSE],
     {mass_storage_classes.specified} [FALSE],
     {volumes} NIL,
     {families} NIL,
     {sets} NIL,
     {conditions} [
    ['CATALOG_VOLUME_UNAVAILABLE     ', osc$fp_catalog_vol_unavailable,
     $fst$file_access_conditions [fsc$catalog_volume_unavailable, fsc$catalog_media_missing] , FALSE],
    ['CYCLE_BUSY                     ', osc$fp_cycle_busy,
     $fst$file_access_conditions [fsc$cycle_busy                                           ] , FALSE],
    ['CYCLE_RESTORATION_REQUIRED     ', osc$fp_cycle_restoration_req,
     $fst$file_access_conditions [fsc$data_restoration_required                            ] , FALSE],
    ['DATA_RETRIEVAL_REQUIRED        ', osc$fp_data_retrieval_req,
     $fst$file_access_conditions [fsc$data_retrieval_required                              ] , FALSE],
    ['FILE_SERVER_INACTIVE           ', osc$fp_file_server_inactive,
     $fst$file_access_conditions [fsc$file_server_inactive                                 ] , FALSE],
    ['SPACE_UNAVAILABLE              ', osc$fp_space_unavailable,
     $fst$file_access_conditions [fsc$space_unavailable                                    ] , FALSE],
    ['VOLUME_UNAVAILABLE             ', osc$fp_volume_unavailable,
     $fst$file_access_conditions [fsc$volume_unavailable, fsc$media_missing                ] , FALSE]],
     {polling_frequency.specified} [FALSE]],

    login_users_names: [READ, oss$job_paged_literal] array [ost$ecp_specified_login_field] of
          ost$name := ['USER                           ', 'FAMILY                         ',
                       'JOB_CLASS                      ', 'JOB_MODE                       '],

?? FMT (FORMAT := ON) ??
    polling_frequency_name: [READ, oss$job_paged_literal] ost$name := 'POLLING_FREQUENCY              ';

?? NEWTITLE := 'osp$_manage_exception_policies', EJECT ??

{ PURPOSE:
{   This is the starting procedure for the MANAGE_EXCEPTION_POLICIES utility.

  PROCEDURE [XDCL, #GATE] osp$_manage_exception_policies
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$manep) manage_exception_policies, manep (
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 1] of clt$pdt_parameter_name,
      parameters: array [1 .. 1] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [92, 4, 3, 11, 13, 0, 973],
    clc$command, 1, 1, 0, 0, 0, 0, 1, ''], [
    ['STATUS                         ',clc$nominal_entry, 1]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$status = 1;

    VAR
      pvt: array [1 .. 1] of clt$parameter_value;

{ table n=man_ecp_subcommands t=command sn=oss$job_paged_literal
{ command n=(change_exception_policies, change_exception_policy, chaep)    ..
{   p=osp$_change_exception_policies cm=local a=normal_usage    ..
{   log=automatic
{ command n=(delete_exception_policy, delete_exception_policies, delep)    ..
{   p=osp$_delete_exception_policies cm=local a=normal_usage    ..
{   log=automatic
{ command n=(display_applicable_policy, disap)            ..
{   p=osp$_display_applicable_policy cm=local a=normal_usage    ..
{   log=automatic
{ command n=(display_exception_policy, display_exception_policies, disep)  ..
{   p=osp$_display_exception_policies cm=local a=normal_usage    ..
{   log=automatic
{ command n=(install_default_policies, install_default_policy, insdp)      ..
{   p=osp$_install_default_policies cm=local a=normal_usage    ..
{   log=automatic
{ command n=(install_exception_policies, install_exception_policy, insep)  ..
{   p=osp$_install_exception_policies cm=local a=normal_usage    ..
{   log=automatic
{ command n=(quit, end_manage_exception_policies, qui)            ..
{   p=osp$_end_manecp cm=local a=normal_usage log=automatic
{ tablend

?? PUSH (LISTEXT := ON) ??

VAR
  man_ecp_subcommands: [STATIC, READ, oss$job_paged_literal]
      ^clt$command_table := ^man_ecp_subcommands_entries,

  man_ecp_subcommands_entries: [STATIC, READ, oss$job_paged_literal]
      array [1 .. 20] of clt$command_table_entry := [
  {} ['CHAEP                          ', clc$abbreviation_entry,
        clc$normal_usage_entry, 1, clc$automatically_log, clc$linked_call,
        ^osp$_change_exception_policies],
  {} ['CHANGE_EXCEPTION_POLICIES      ', clc$nominal_entry,
        clc$normal_usage_entry, 1, clc$automatically_log, clc$linked_call,
        ^osp$_change_exception_policies],
  {} ['CHANGE_EXCEPTION_POLICY        ', clc$alias_entry,
        clc$normal_usage_entry, 1, clc$automatically_log, clc$linked_call,
        ^osp$_change_exception_policies],
  {} ['DELEP                          ', clc$abbreviation_entry,
        clc$normal_usage_entry, 2, clc$automatically_log, clc$linked_call,
        ^osp$_delete_exception_policies],
  {} ['DELETE_EXCEPTION_POLICIES      ', clc$alias_entry,
        clc$normal_usage_entry, 2, clc$automatically_log, clc$linked_call,
        ^osp$_delete_exception_policies],
  {} ['DELETE_EXCEPTION_POLICY        ', clc$nominal_entry,
        clc$normal_usage_entry, 2, clc$automatically_log, clc$linked_call,
        ^osp$_delete_exception_policies],
  {} ['DISAP                          ', clc$abbreviation_entry,
        clc$normal_usage_entry, 3, clc$automatically_log, clc$linked_call,
        ^osp$_display_applicable_policy],
  {} ['DISEP                          ', clc$abbreviation_entry,
        clc$normal_usage_entry, 4, clc$automatically_log, clc$linked_call,
        ^osp$_display_exception_policies],
  {} ['DISPLAY_APPLICABLE_POLICY      ', clc$nominal_entry,
        clc$normal_usage_entry, 3, clc$automatically_log, clc$linked_call,
        ^osp$_display_applicable_policy],
  {} ['DISPLAY_EXCEPTION_POLICIES     ', clc$alias_entry,
        clc$normal_usage_entry, 4, clc$automatically_log, clc$linked_call,
        ^osp$_display_exception_policies],
  {} ['DISPLAY_EXCEPTION_POLICY       ', clc$nominal_entry,
        clc$normal_usage_entry, 4, clc$automatically_log, clc$linked_call,
        ^osp$_display_exception_policies],
  {} ['END_MANAGE_EXCEPTION_POLICIES  ', clc$alias_entry,
        clc$normal_usage_entry, 7, clc$automatically_log, clc$linked_call,
        ^osp$_end_manecp],
  {} ['INSDP                          ', clc$abbreviation_entry,
        clc$normal_usage_entry, 5, clc$automatically_log, clc$linked_call,
        ^osp$_install_default_policies],
  {} ['INSEP                          ', clc$abbreviation_entry,
        clc$normal_usage_entry, 6, clc$automatically_log, clc$linked_call,
        ^osp$_install_exception_policies],
  {} ['INSTALL_DEFAULT_POLICIES       ', clc$nominal_entry,
        clc$normal_usage_entry, 5, clc$automatically_log, clc$linked_call,
        ^osp$_install_default_policies],
  {} ['INSTALL_DEFAULT_POLICY         ', clc$alias_entry,
        clc$normal_usage_entry, 5, clc$automatically_log, clc$linked_call,
        ^osp$_install_default_policies],
  {} ['INSTALL_EXCEPTION_POLICIES     ', clc$nominal_entry,
        clc$normal_usage_entry, 6, clc$automatically_log, clc$linked_call,
        ^osp$_install_exception_policies],
  {} ['INSTALL_EXCEPTION_POLICY       ', clc$alias_entry,
        clc$normal_usage_entry, 6, clc$automatically_log, clc$linked_call,
        ^osp$_install_exception_policies],
  {} ['QUI                            ', clc$abbreviation_entry,
        clc$normal_usage_entry, 7, clc$automatically_log, clc$linked_call,
        ^osp$_end_manecp],
  {} ['QUIT                           ', clc$nominal_entry,
        clc$normal_usage_entry, 7, clc$automatically_log, clc$linked_call,
        ^osp$_end_manecp]];

?? POP ??
{ table n=man_ecp_functions t=function sn=oss$job_paged_literal
{ function n=$applicable_policy p=osp$$applicable_policy
{ function n=$criteria p=osp$$criteria
{ function n=$exception_policy p=osp$$exception_policy

?? PUSH (LISTEXT := ON) ??

    VAR
      man_ecp_functions: [STATIC, READ, oss$job_paged_literal] ^clt$function_processor_table :=
            ^man_ecp_functions_entries,

      man_ecp_functions_entries: [STATIC, READ, oss$job_paged_literal] array [1 .. 3] of
            clt$function_proc_table_entry := [
            {} ['$APPLICABLE_POLICY             ', clc$nominal_entry, clc$normal_usage_entry, 1,
            clc$linked_call, ^osp$$applicable_policy],
            {} ['$CRITERIA                      ', clc$nominal_entry, clc$normal_usage_entry, 2,
            clc$linked_call, ^osp$$criteria],
            {} ['$EXCEPTION_POLICY              ', clc$nominal_entry, clc$normal_usage_entry, 3,
            clc$linked_call, ^osp$$exception_policy]];

?? POP ??

?? EJECT ??

    VAR
      file_id: amt$file_identifier,
      manep_utility_attributes: ^clt$utility_attributes,
      sequence_headers: array [ost$ecp_sequence_index] of ^ost$ecp_header,
      segment_pointer: amt$segment_pointer;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF status.normal THEN

      PUSH manep_utility_attributes: [1 .. 3];
      manep_utility_attributes^ [1].key := clc$utility_prompt;
      manep_utility_attributes^ [1].prompt.value := utility_prompt;
      manep_utility_attributes^ [1].prompt.size := clp$trimmed_string_size
            (manep_utility_attributes^ [1].prompt.value);

      manep_utility_attributes^ [2].key := clc$utility_command_table;
      manep_utility_attributes^ [2].command_table := man_ecp_subcommands;

      manep_utility_attributes^ [3].key := clc$utility_function_proc_table;
      manep_utility_attributes^ [3].function_processor_table := man_ecp_functions;

      clp$begin_utility (utility_name, manep_utility_attributes^, status);

      IF status.normal THEN
        initialize_session_segment (sequence_headers [osc$ecp_session_policies], status);
        IF status.normal THEN
          initialize_installed_segment (sequence_headers [osc$ecp_installed_policies], status);
          IF status.normal THEN
            osp$store_sequence_headers (sequence_headers, status);
            IF status.normal THEN
              clp$include_file (clc$current_command_input, {ignore prompt} '', utility_name, status);
              IF NOT status.normal THEN
                RETURN;
              IFEND;
            IFEND;
          IFEND;
        IFEND;
      IFEND;
      clp$end_utility (utility_name, status);
    IFEND;


  PROCEND osp$_manage_exception_policies;
?? OLDTITLE ??
?? NEWTITLE := 'osp$_change_exception_policies', EJECT ??

  PROCEDURE osp$_change_exception_policies
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ A correspondence must be maintained between the ordinal values of type
{ ost$ecp_function_param_ordinal and the order of the parameters of this
{ subcommand.  This ensures that the order of the parameter values
{ displayed by DISPLAY_EXCEPTION_POLICIES and $EXCEPTION_POLICIES is the
{ same as CHAEP.

{ A correspondence must also be maintained between the ordinal values of type
{ ost$ecp_specified_login_field and the order of the fields of the
{ LOGIN_USERS parameter of this subcommand.  This ensures that the order of
{ the parameter values displayed by DISPLAY_EXCEPTION_POLICIES and
{ $EXCEPTION_POLICIES is the same as CHAEP.

{ The CHECK_POLICY_SEMANTICS procedure depends on the order of the "who",
{ "what", and "which" parameters below remaining the same.  If you add a
{ parameter 1) before JOB_CLASSES, 2) after VOLUMES, or 3) after VOLUME_UNAVAILABLE,
{ you will have to change the use of the 'p$' constants in that procedure.

{ If you add ANY parameters to this subcommand, you must modify the ordinal type
{ ost$ecp_function_param_ordinal and review the preceding comments.

{ PROCEDURE (osm$manep_chaep) change_exception_policies, change_exception_policy, chaep (
{   job_classes, job_class, jc: (BY_NAME) list of name = $optional
{   job_mode, jm: (BY_NAME) key
{       (batch, b)
{       (interactive, i)
{     keyend = $optional
{   jobs, job, j: (BY_NAME) list of name = $optional
{   login_users, login_user, lu: (BY_NAME) list of record
{       user: name
{       family: name = $optional
{       job_class: name = $optional
{       job_mode: key
{         (batch, b)
{         (interactive, i)
{       keyend = $optional
{     recend = $optional
{   families, family, fn: (BY_NAME) list of name = $optional
{   files, c, catalog, catalogs, file, f: (BY_NAME) any of
{       key
{         all
{       keyend
{       list defer_expansion of file
{     anyend = $optional
{   mass_storage_classes, mass_storage_class, msc: (BY_NAME) any of
{       list of key
{         (nosve_defined, nd)
{         (site_defined, sd)
{         (system_catalogs, sc)
{         (system_critical_files, scf)
{         (system_objects, so)
{         (system_permanent_files, spf, system_files, sf)
{         (system_products, sp)
{         (temporary_files, tf)
{         (user_catalogs, uc)
{         (user_objects, uo)
{         (user_permanent_files, user_files, upf, uf)
{       keyend
{       list 1..25 of name 1..1
{     anyend = $optional
{   sets, set, s: (BY_NAME) list of name = $optional
{   volumes, volume, v: (BY_NAME) list of name 1..6 = $optional
{   catalog_volume_unavailable, catalog_media_missing, cmm, cvu: (BY_NAME) key
{       (exit, e)
{       (wait, w)
{     keyend = $optional
{   cycle_busy, cb: (BY_NAME) key
{       (exit, e)
{       (wait, w)
{     keyend = $optional
{   cycle_restoration_required, ud, undefined_data, crr: (BY_NAME, CHECK) any of
{       key
{         (wait, w)
{       keyend
{       list of key
{         (delete, d)
{         (enable_matching_image, emi)
{         (enable_nonmatching_image, eni)
{         (set_damage_condition, sdc)
{       keyend
{       list of key
{         (enable_matching_image, emi)
{         (enable_nonmatching_image, eni)
{         (exit, e)
{         (set_damage_condition, sdc)
{       keyend
{     anyend = $optional
{   data_retrieval_required, drr: (BY_NAME) key
{       (exit, e)
{       (wait, w)
{     keyend = $optional
{   file_server_inactive, fsi: (BY_NAME) key
{       (exit, e)
{       (wait, w)
{     keyend = $optional
{   space_unavailable, su: (BY_NAME) key
{       (exit, e)
{       (wait, w)
{     keyend = $optional
{   volume_unavailable, media_missing, mm, vu: (BY_NAME, CHECK) any of
{       key
{         (wait, w)
{       keyend
{       list of key
{         (delete, d)
{         (enable_matching_image, emi)
{         (enable_nonmatching_image, eni)
{         (set_damage_condition, sdc)
{       keyend
{       list of key
{         (enable_matching_image, emi)
{         (enable_nonmatching_image, eni)
{         (exit, e)
{         (set_damage_condition, sdc)
{       keyend
{     anyend = $optional
{   polling_frequency, pf: integer 1..31622400 = $optional
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 52] of clt$pdt_parameter_name,
      parameters: array [1 .. 18] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$record_type_qualifier,
          field_spec_1: clt$field_specification,
          element_type_spec_1: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
          field_spec_2: clt$field_specification,
          element_type_spec_2: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
          field_spec_3: clt$field_specification,
          element_type_spec_3: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
          field_spec_4: clt$field_specification,
          element_type_spec_4: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 4] of clt$keyword_specification,
          recend,
        recend,
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
          recend,
        recend,
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 26] of clt$keyword_specification,
          recend,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
      recend,
      type10: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
      recend,
      type11: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
      recend,
      type12: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 8] of clt$keyword_specification,
          recend,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 8] of clt$keyword_specification,
          recend,
        recend,
      recend,
      type13: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
      recend,
      type14: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
      recend,
      type15: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
      recend,
      type16: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 2] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 8] of clt$keyword_specification,
          recend,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$keyword_type_qualifier,
            keyword_specs: array [1 .. 8] of clt$keyword_specification,
          recend,
        recend,
      recend,
      type17: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type18: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [92, 12, 20, 17, 40, 22, 585],
    clc$command, 52, 18, 0, 0, 0, 0, 18, 'OSM$MANEP_CHAEP'], [
    ['C                              ',clc$alias_entry, 6],
    ['CATALOG                        ',clc$alias_entry, 6],
    ['CATALOGS                       ',clc$alias_entry, 6],
    ['CATALOG_MEDIA_MISSING          ',clc$alias_entry, 10],
    ['CATALOG_VOLUME_UNAVAILABLE     ',clc$nominal_entry, 10],
    ['CB                             ',clc$abbreviation_entry, 11],
    ['CMM                            ',clc$alias_entry, 10],
    ['CRR                            ',clc$abbreviation_entry, 12],
    ['CVU                            ',clc$abbreviation_entry, 10],
    ['CYCLE_BUSY                     ',clc$nominal_entry, 11],
    ['CYCLE_RESTORATION_REQUIRED     ',clc$nominal_entry, 12],
    ['DATA_RETRIEVAL_REQUIRED        ',clc$nominal_entry, 13],
    ['DRR                            ',clc$abbreviation_entry, 13],
    ['F                              ',clc$abbreviation_entry, 6],
    ['FAMILIES                       ',clc$nominal_entry, 5],
    ['FAMILY                         ',clc$alias_entry, 5],
    ['FILE                           ',clc$alias_entry, 6],
    ['FILES                          ',clc$nominal_entry, 6],
    ['FILE_SERVER_INACTIVE           ',clc$nominal_entry, 14],
    ['FN                             ',clc$abbreviation_entry, 5],
    ['FSI                            ',clc$abbreviation_entry, 14],
    ['J                              ',clc$abbreviation_entry, 3],
    ['JC                             ',clc$abbreviation_entry, 1],
    ['JM                             ',clc$abbreviation_entry, 2],
    ['JOB                            ',clc$alias_entry, 3],
    ['JOBS                           ',clc$nominal_entry, 3],
    ['JOB_CLASS                      ',clc$alias_entry, 1],
    ['JOB_CLASSES                    ',clc$nominal_entry, 1],
    ['JOB_MODE                       ',clc$nominal_entry, 2],
    ['LOGIN_USER                     ',clc$alias_entry, 4],
    ['LOGIN_USERS                    ',clc$nominal_entry, 4],
    ['LU                             ',clc$abbreviation_entry, 4],
    ['MASS_STORAGE_CLASS             ',clc$alias_entry, 7],
    ['MASS_STORAGE_CLASSES           ',clc$nominal_entry, 7],
    ['MEDIA_MISSING                  ',clc$alias_entry, 16],
    ['MM                             ',clc$alias_entry, 16],
    ['MSC                            ',clc$abbreviation_entry, 7],
    ['PF                             ',clc$abbreviation_entry, 17],
    ['POLLING_FREQUENCY              ',clc$nominal_entry, 17],
    ['S                              ',clc$abbreviation_entry, 8],
    ['SET                            ',clc$alias_entry, 8],
    ['SETS                           ',clc$nominal_entry, 8],
    ['SPACE_UNAVAILABLE              ',clc$nominal_entry, 15],
    ['STATUS                         ',clc$nominal_entry, 18],
    ['SU                             ',clc$abbreviation_entry, 15],
    ['UD                             ',clc$alias_entry, 12],
    ['UNDEFINED_DATA                 ',clc$alias_entry, 12],
    ['V                              ',clc$abbreviation_entry, 9],
    ['VOLUME                         ',clc$alias_entry, 9],
    ['VOLUMES                        ',clc$nominal_entry, 9],
    ['VOLUME_UNAVAILABLE             ',clc$nominal_entry, 16],
    ['VU                             ',clc$abbreviation_entry, 16]],
    [
{ PARAMETER 1
    [28, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 2
    [29, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_parameter, 0, 0],
{ PARAMETER 3
    [26, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 4
    [31, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 337,
  clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [15, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 6
    [18, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 83, clc$optional_parameter,
  0, 0],
{ PARAMETER 7
    [34, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 1026,
  clc$optional_parameter, 0, 0],
{ PARAMETER 8
    [42, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 9
    [50, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 21, clc$optional_parameter,
  0, 0],
{ PARAMETER 10
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_parameter, 0, 0],
{ PARAMETER 11
    [10, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_parameter, 0, 0],
{ PARAMETER 12
    [11, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$extended_parameter_checking, 743,
  clc$optional_parameter, 0, 0],
{ PARAMETER 13
    [12, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_parameter, 0, 0],
{ PARAMETER 14
    [19, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_parameter, 0, 0],
{ PARAMETER 15
    [43, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_parameter, 0, 0],
{ PARAMETER 16
    [51, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$extended_parameter_checking, 743,
  clc$optional_parameter, 0, 0],
{ PARAMETER 17
    [39, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 18
    [44, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [4], [
    ['B                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['BATCH                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['I                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['INTERACTIVE                    ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ],
{ PARAMETER 3
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 4
    [[1, 0, clc$list_type], [321, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$record_type], [4],
      ['USER                           ', clc$required_field, 5], [[1, 0, clc$name_type], [1,
  osc$max_name_size]],
      ['FAMILY                         ', clc$optional_field, 5], [[1, 0, clc$name_type], [1,
  osc$max_name_size]],
      ['JOB_CLASS                      ', clc$optional_field, 5], [[1, 0, clc$name_type], [1,
  osc$max_name_size]],
      ['JOB_MODE                       ', clc$optional_field, 155], [[1, 0, clc$keyword_type], [4], [
        ['B                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['BATCH                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['I                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['INTERACTIVE                    ', clc$nominal_entry, clc$normal_usage_entry, 2]]
        ]
      ]
    ],
{ PARAMETER 5
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 6
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    19, [[1, 0, clc$list_type], [3, 1, clc$max_list_size, 0, TRUE, FALSE],
        [[1, 0, clc$file_type]]
      ]
    ],
{ PARAMETER 7
    [[1, 0, clc$union_type], [[clc$list_type],
    FALSE, 2],
    985, [[1, 0, clc$list_type], [969, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [26], [
        ['ND                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['NOSVE_DEFINED                  ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['SC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['SCF                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['SD                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['SF                             ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
        ['SITE_DEFINED                   ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['SO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
        ['SP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 7],
        ['SPF                            ', clc$alias_entry, clc$normal_usage_entry, 6],
        ['SYSTEM_CATALOGS                ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['SYSTEM_CRITICAL_FILES          ', clc$nominal_entry, clc$normal_usage_entry, 4],
        ['SYSTEM_FILES                   ', clc$alias_entry, clc$normal_usage_entry, 6],
        ['SYSTEM_OBJECTS                 ', clc$nominal_entry, clc$normal_usage_entry, 5],
        ['SYSTEM_PERMANENT_FILES         ', clc$nominal_entry, clc$normal_usage_entry, 6],
        ['SYSTEM_PRODUCTS                ', clc$nominal_entry, clc$normal_usage_entry, 7],
        ['TEMPORARY_FILES                ', clc$nominal_entry, clc$normal_usage_entry, 8],
        ['TF                             ', clc$abbreviation_entry, clc$normal_usage_entry, 8],
        ['UC                             ', clc$abbreviation_entry, clc$normal_usage_entry, 9],
        ['UF                             ', clc$abbreviation_entry, clc$normal_usage_entry, 11],
        ['UO                             ', clc$abbreviation_entry, clc$normal_usage_entry, 10],
        ['UPF                            ', clc$alias_entry, clc$normal_usage_entry, 11],
        ['USER_CATALOGS                  ', clc$nominal_entry, clc$normal_usage_entry, 9],
        ['USER_FILES                     ', clc$alias_entry, clc$normal_usage_entry, 11],
        ['USER_OBJECTS                   ', clc$nominal_entry, clc$normal_usage_entry, 10],
        ['USER_PERMANENT_FILES           ', clc$nominal_entry, clc$normal_usage_entry, 11]]
        ]
      ],
    21, [[1, 0, clc$list_type], [5, 1, 25, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, 1]]
      ]
    ],
{ PARAMETER 8
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, osc$max_name_size]]
    ],
{ PARAMETER 9
    [[1, 0, clc$list_type], [5, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$name_type], [1, 6]]
    ],
{ PARAMETER 10
    [[1, 0, clc$keyword_type], [4], [
    ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['EXIT                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['W                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['WAIT                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ],
{ PARAMETER 11
    [[1, 0, clc$keyword_type], [4], [
    ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['EXIT                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['W                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['WAIT                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ],
{ PARAMETER 12
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 3],
    81, [[1, 0, clc$keyword_type], [2], [
      ['W                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['WAIT                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    319, [[1, 0, clc$list_type], [303, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [8], [
        ['D                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['DELETE                         ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['EMI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['ENABLE_MATCHING_IMAGE          ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['ENABLE_NONMATCHING_IMAGE       ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['ENI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['SDC                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['SET_DAMAGE_CONDITION           ', clc$nominal_entry, clc$normal_usage_entry, 4]]
        ]
      ],
    319, [[1, 0, clc$list_type], [303, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [8], [
        ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['EMI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['ENABLE_MATCHING_IMAGE          ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['ENABLE_NONMATCHING_IMAGE       ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['ENI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['EXIT                           ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['SDC                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['SET_DAMAGE_CONDITION           ', clc$nominal_entry, clc$normal_usage_entry, 4]]
        ]
      ]
    ],
{ PARAMETER 13
    [[1, 0, clc$keyword_type], [4], [
    ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['EXIT                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['W                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['WAIT                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ],
{ PARAMETER 14
    [[1, 0, clc$keyword_type], [4], [
    ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['EXIT                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['W                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['WAIT                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ],
{ PARAMETER 15
    [[1, 0, clc$keyword_type], [4], [
    ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['EXIT                           ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['W                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['WAIT                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ],
{ PARAMETER 16
    [[1, 0, clc$union_type], [[clc$keyword_type, clc$list_type],
    FALSE, 3],
    81, [[1, 0, clc$keyword_type], [2], [
      ['W                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['WAIT                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    319, [[1, 0, clc$list_type], [303, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [8], [
        ['D                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['DELETE                         ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['EMI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['ENABLE_MATCHING_IMAGE          ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['ENABLE_NONMATCHING_IMAGE       ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['ENI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['SDC                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['SET_DAMAGE_CONDITION           ', clc$nominal_entry, clc$normal_usage_entry, 4]]
        ]
      ],
    319, [[1, 0, clc$list_type], [303, 1, clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$keyword_type], [8], [
        ['E                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
        ['EMI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
        ['ENABLE_MATCHING_IMAGE          ', clc$nominal_entry, clc$normal_usage_entry, 1],
        ['ENABLE_NONMATCHING_IMAGE       ', clc$nominal_entry, clc$normal_usage_entry, 2],
        ['ENI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
        ['EXIT                           ', clc$nominal_entry, clc$normal_usage_entry, 3],
        ['SDC                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
        ['SET_DAMAGE_CONDITION           ', clc$nominal_entry, clc$normal_usage_entry, 4]]
        ]
      ]
    ],
{ PARAMETER 17
    [[1, 0, clc$integer_type], [1, 31622400, 10]],
{ PARAMETER 18
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$job_classes = 1,
      p$job_mode = 2,
      p$jobs = 3,
      p$login_users = 4,
      p$families = 5,
      p$files = 6,
      p$mass_storage_classes = 7,
      p$sets = 8,
      p$volumes = 9,
      p$catalog_volume_unavailable = 10,
      p$cycle_busy = 11,
      p$cycle_restoration_required = 12,
      p$data_retrieval_required = 13,
      p$file_server_inactive = 14,
      p$space_unavailable = 15,
      p$volume_unavailable = 16,
      p$polling_frequency = 17,
      p$status = 18;

    VAR
      pvt: array [1 .. 18] of clt$parameter_value;


    VAR
      header_p: ^ost$ecp_policy_header;

?? NEWTITLE := 'check_policy_semantics', EJECT ??

  PROCEDURE check_policy_semantics
    (    pvt: ^clt$parameter_value_table;
         which_parameter: clt$which_parameter;
     VAR status: ost$status);

    VAR
      actions: ost$ecp_actions,
      at_least_one_specified: boolean,
      i: p$job_classes .. p$volume_unavailable,
      node: ^clt$data_value;

{ Design:  This procedure validates that at least one "who" or "what" parameter is
{ specified and at least one exception condition or "which" parameter is specified.
{ It also validates that if SET_DAMAGE_CONDITION is specified so must the
{ ENABLE_NONMATCHING_IMAGE option.

{ This procedure assumes that all of the "who" and "what" parameters are contiguous
{ in the PDT starting with JOB_CLASSES and ending with VOLUMES.  It also assumes
{ that all of the "which" parameters are contiguous in the PDT starting with
{ CATALOG_VOLUME_UNAVAILABLE and ending with VOLUME_UNAVAILABLE.

    status.normal := TRUE;

    IF which_parameter.specific THEN
      actions := $ost$ecp_actions [];
      IF pvt^ [which_parameter.number].value^.kind = clc$list THEN
        node := pvt^ [which_parameter.number].value;
        WHILE node <> NIL DO
          IF node^.element_value^.keyword_value = action_names [osc$ecp_enable_nonmatch_image] THEN
            actions := actions + $ost$ecp_actions [osc$ecp_enable_nonmatch_image];
          ELSEIF node^.element_value^.keyword_value = action_names [osc$ecp_set_damage_condition] THEN
            actions := actions + $ost$ecp_actions [osc$ecp_set_damage_condition];
          IFEND;
          node := node^.link;
        WHILEND;
      IFEND;
      IF (osc$ecp_set_damage_condition IN actions) AND NOT (osc$ecp_enable_nonmatch_image IN actions) THEN
        osp$set_status_condition (ose$eni_required_with_sdc, status);
      IFEND;
    ELSE {Verify overall semantics of command}
      {1. There must be at least one condition specified and at least one criterion
      at_least_one_specified := FALSE;

      FOR i := p$job_classes TO p$volumes DO
        at_least_one_specified := at_least_one_specified OR pvt^ [i].specified;
      FOREND;

      IF at_least_one_specified THEN
        at_least_one_specified := FALSE;
        FOR i := p$catalog_volume_unavailable TO p$volume_unavailable DO
          at_least_one_specified := at_least_one_specified OR pvt^ [i].specified;
        FOREND;
        IF NOT at_least_one_specified THEN
          osp$set_status_condition (ose$object_of_policy_missing, status);
          RETURN;
        IFEND;
      ELSE
        osp$set_status_condition (ose$subject_of_policy_missing, status);
        RETURN;
      IFEND;

      { Offline conditions should not have criteria that require the file to be online
      IF pvt^ [p$cycle_restoration_required].specified OR pvt^ [p$data_retrieval_required].specified THEN
        IF pvt^ [p$mass_storage_classes].specified OR pvt^ [p$volumes].specified THEN
          osp$set_status_condition (ose$offline_condition, status);
          RETURN;
        IFEND;
      IFEND;
    IFEND;

  PROCEND check_policy_semantics;
?? OLDTITLE ??
?? NEWTITLE := 'process_exception_condition', EJECT ??

    PROCEDURE process_exception_condition
      (    parameter_number: ost$positive_integers);

      VAR
        i: ost$ecp_number_of_conditions,
        node: ^clt$data_value;

      FOR i := 1 TO UPPERBOUND (header_p^.conditions) DO
        IF parameter_number = $INTEGER (header_p^.conditions [i].exception_ordinal) THEN

          header_p^.conditions [i].specified := TRUE;
          header_p^.conditions [i].actions := $ost$ecp_actions [];

          IF pvt [parameter_number].value^.kind = clc$keyword THEN
            IF pvt [parameter_number].value^.keyword_value = action_names [osc$ecp_delete] THEN
              header_p^.conditions [i].actions := header_p^.conditions [i].
                    actions + $ost$ecp_actions [osc$ecp_delete];
            ELSEIF pvt [parameter_number].value^.keyword_value = action_names [osc$ecp_exit] THEN
              header_p^.conditions [i].actions := header_p^.conditions [i].
                    actions + $ost$ecp_actions [osc$ecp_exit];
            ELSEIF pvt [parameter_number].value^.keyword_value = action_names [osc$ecp_wait] THEN
              header_p^.conditions [i].actions := header_p^.conditions [i].
                    actions + $ost$ecp_actions [osc$ecp_wait];
            IFEND;
          ELSE {list of key}
            node := pvt [parameter_number].value;
            WHILE node <> NIL DO
              IF node^.element_value^.keyword_value = action_names [osc$ecp_delete] THEN
                header_p^.conditions [i].actions := header_p^.conditions [i].
                      actions + $ost$ecp_actions [osc$ecp_delete];
              ELSEIF node^.element_value^.keyword_value = action_names [osc$ecp_enable_matching_image] THEN
                header_p^.conditions [i].actions := header_p^.conditions [i].
                      actions + $ost$ecp_actions [osc$ecp_enable_matching_image];
              ELSEIF node^.element_value^.keyword_value = action_names [osc$ecp_enable_nonmatch_image] THEN
                header_p^.conditions [i].actions := header_p^.conditions [i].
                      actions + $ost$ecp_actions [osc$ecp_enable_nonmatch_image];
              ELSEIF node^.element_value^.keyword_value = action_names [osc$ecp_exit] THEN
                header_p^.conditions [i].actions := header_p^.conditions [i].
                      actions + $ost$ecp_actions [osc$ecp_exit];
              ELSEIF node^.element_value^.keyword_value = action_names [osc$ecp_set_damage_condition] THEN
                header_p^.conditions [i].actions := header_p^.conditions [i].
                      actions + $ost$ecp_actions [osc$ecp_set_damage_condition];
              IFEND;
              node := node^.link;
            WHILEND;
          IFEND;
        IFEND;
      FOREND;
    PROCEND process_exception_condition;
?? OLDTITLE ??
?? NEWTITLE := 'process_files', EJECT ??

    PROCEDURE process_files
      (VAR files {output} : ost$ecp_files;
       VAR policies_p {input, output} : ^SEQ ( * ));

{ Design:

{ File paths are fully evaluated by clp$evaluate_parameters unless the file
{ path evaluation is deferred, i.e.  it 1) begins with :$USER, :$FAMILY, or
{ 2) contains a WILD CARD reference and evaluation is DEFERRED (as it is here).

{ This procedure classifies a file reference as 1) an evaludated file reference,
{ 2) a generic file reference, or 3) a WILD CARD reference.  Classifications
{ 2 and 3 are stored in an unevaluated form until an exception condition
{ occurs; then these two file expressions are "evaluated" within the affected
{ job's environment for a possible match with the affected file path.

      VAR
        count: clt$list_size,
        evaluated_file_reference: fst$evaluated_file_reference,
        file_node: ^clt$data_value,
        i: ost$positive_integers,
        ignore_path_size: fst$path_size,
        path: fst$path,
        path_size: fst$path_size,
        scl_options: ^clt$scl_options;

      files.specified := TRUE;
      IF pvt [p$files].value^.kind = clc$keyword THEN
        files.all_specified := TRUE;
      ELSE {list of file}
        files.all_specified := FALSE;
        count := clp$count_list_elements (pvt [p$files].value);

        NEXT files.path_list: [1 .. count] IN policies_p;
        IF files.path_list <> NIL THEN
          file_node := pvt [p$files].value;
          FOR i := 1 TO count DO
            clp$evaluate_file_reference (file_node^.element_value^.file_value^,
                  $clt$file_ref_parsing_options [clc$multiple_reference_allowed], FALSE,
                  evaluated_file_reference, status);
            IF status.normal THEN
              clp$convert_file_ref_to_string (evaluated_file_reference, TRUE, path, ignore_path_size, status);
              IF status.normal THEN
                path_size := clp$trimmed_string_size (file_node^.element_value^.file_value^);
                NEXT files.path_list^ [i].path: [path_size] IN policies_p;
                IF files.path_list^ [i].path <> NIL THEN
                  files.path_list^ [i].path^ := file_node^.element_value^.file_value^ (1, path_size);

                  IF evaluated_file_reference.multiple_reference_specified THEN
                    clp$find_scl_options (scl_options);
                    files.path_list^ [i].file_reference_type := osc$ecp_wild_card_reference;
                    files.path_list^ [i].wild_card_pattern_type := scl_options^.wild_card_pattern_type;
                  ELSE
                    IF path (1, path_size) = file_node^.element_value^.file_value^ (1, path_size) THEN
                      files.path_list^ [i].file_reference_type := osc$ecp_evaluated_reference;
                    ELSE
                      files.path_list^ [i].file_reference_type := osc$ecp_generic_reference;
                    IFEND;
                  IFEND;
                IFEND;
              ELSE
                RESET osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.
                      sequence_pointer TO header_p;
                EXIT osp$_change_exception_policies;
              IFEND;
            IFEND;
            file_node := file_node^.link;
          FOREND;
        ELSE
          osp$set_status_condition (ose$internal_workspace_full, status);
          osp$append_status_parameter (osc$status_parameter_delimiter,
                'MANAGE_EXCEPTION_POLICIES - process_files', status);
          EXIT osp$_change_exception_policies;
        IFEND;
      IFEND;

    PROCEND process_files;
?? OLDTITLE ??
?? NEWTITLE := 'process_job_mode', EJECT ??

    PROCEDURE process_job_mode
      (VAR job_mode: ost$ecp_job_mode);

      job_mode.specified := TRUE;
      IF pvt [p$job_mode].value^.keyword_value = batch THEN
        job_mode.value := jmc$batch;
      ELSE {INTERACTIVE}
        job_mode.value := jmc$interactive_connected;
      IFEND;

    PROCEND process_job_mode;
?? OLDTITLE ??
?? NEWTITLE := 'process_login_users', EJECT ??

    PROCEDURE process_login_users
      (VAR login_users: ^ost$ecp_login_users_list;
       VAR policies_p {input, output} : ^SEQ ( * ));

      VAR
        count: clt$list_size,
        i: ost$positive_integers,
        j: ost$positive_integers,
        name_list: ^ost$ecp_name_list,
        node: ^clt$data_value;

      login_users := NIL;
      count := clp$count_list_elements (pvt [p$login_users].value);

      NEXT login_users: [1 .. count] IN policies_p;
      IF login_users <> NIL THEN
        node := pvt [p$login_users].value;
        FOR i := 1 TO count DO
          login_users^ [i].specified_fields := $ost$ecp_specified_login_fields [osc$lu_user_name];
          FOR j := 1 TO UPPERBOUND (node^.element_value^.field_values^) DO
            IF node^.element_value^.field_values^ [j].name = user_keyword THEN
              login_users^ [i].user_name := node^.element_value^.field_values^ [j].value^.name_value;
            ELSEIF node^.element_value^.field_values^ [j].name = family_keyword THEN
              IF node^.element_value^.field_values^ [j].value <> NIL THEN
                login_users^ [i].specified_fields := login_users^ [i].specified_fields +
                      $ost$ecp_specified_login_fields [osc$lu_family_name];
                login_users^ [i].family_name := node^.element_value^.field_values^ [j].value^.name_value;
              IFEND;
            ELSEIF node^.element_value^.field_values^ [j].name = job_class_keyword THEN
              IF node^.element_value^.field_values^ [j].value <> NIL THEN
                login_users^ [i].specified_fields := login_users^ [i].specified_fields +
                      $ost$ecp_specified_login_fields [osc$lu_job_class];
                login_users^ [i].job_class := node^.element_value^.field_values^ [j].value^.name_value;
              IFEND;
            ELSE {JOB_MODE}
              IF node^.element_value^.field_values^ [j].value <> NIL THEN
                login_users^ [i].specified_fields := login_users^ [i].specified_fields +
                      $ost$ecp_specified_login_fields [osc$lu_job_mode];
                IF node^.element_value^.field_values^ [j].value^.keyword_value = batch THEN
                  login_users^ [i].job_mode := jmc$batch;
                ELSE {INTERACTIVE}
                  login_users^ [i].job_mode := jmc$interactive_connected;
                IFEND;
              IFEND;
            IFEND;
          FOREND;
          node := node^.link;
        FOREND;
      ELSE
        osp$set_status_condition (ose$internal_workspace_full, status);
        osp$append_status_parameter (osc$status_parameter_delimiter,
              'MANAGE_EXCEPTION_POLICIES - process_login_users', status);
        RESET osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.sequence_pointer TO header_p;
        EXIT osp$_change_exception_policies;
      IFEND;

    PROCEND process_login_users;
?? OLDTITLE ??
?? NEWTITLE := 'process_ms_classes', EJECT ??

    PROCEDURE process_ms_classes
      (VAR ms_classes: ost$ecp_ms_classes);

      VAR
        name_node: ^clt$data_value;

      ms_classes.specified := TRUE;
      ms_classes.value := $dmt$class [];
      name_node := pvt [p$mass_storage_classes].value;
      WHILE name_node <> NIL DO
        IF name_node^.element_value^.kind = clc$keyword THEN
          IF name_node^.element_value^.keyword_value = 'NOSVE_DEFINED' THEN
            ms_classes.value := ms_classes.value + $dmt$class ['J', 'K', 'L', 'M', 'N', 'P', 'Q'];
          ELSEIF name_node^.element_value^.keyword_value = 'SITE_DEFINED' THEN
            ms_classes.value := ms_classes.value + $dmt$class ['U', 'V', 'W', 'X', 'Y', 'Z'];
          ELSEIF name_node^.element_value^.keyword_value = 'SYSTEM_CATALOGS' THEN
            ms_classes.value := ms_classes.value + $dmt$class ['J'];
          ELSEIF name_node^.element_value^.keyword_value = 'SYSTEM_CRITICAL_FILES' THEN
            ms_classes.value := ms_classes.value + $dmt$class ['Q'];
          ELSEIF name_node^.element_value^.keyword_value = 'SYSTEM_OBJECTS' THEN
            ms_classes.value := ms_classes.value + $dmt$class ['J', 'K', 'P', 'Q'];
          ELSEIF name_node^.element_value^.keyword_value = 'SYSTEM_PERMANENT_FILES' THEN
            ms_classes.value := ms_classes.value + $dmt$class ['K', 'P'];
          ELSEIF name_node^.element_value^.keyword_value = 'SYSTEM_PRODUCTS' THEN
            ms_classes.value := ms_classes.value + $dmt$class ['P'];
          ELSEIF name_node^.element_value^.keyword_value = 'TEMPORARY_FILES' THEN
            ms_classes.value := ms_classes.value + $dmt$class ['N'];
          ELSEIF name_node^.element_value^.keyword_value = 'USER_CATALOGS' THEN
            ms_classes.value := ms_classes.value + $dmt$class ['L'];
          ELSEIF name_node^.element_value^.keyword_value = 'USER_OBJECTS' THEN
            ms_classes.value := ms_classes.value + $dmt$class ['L', 'M', 'N'];
          ELSEIF name_node^.element_value^.keyword_value = 'USER_PERMANENT_FILES' THEN
            ms_classes.value := ms_classes.value + $dmt$class ['M'];
          ELSE
          IFEND;
        ELSE {name}
          ms_classes.value := ms_classes.value + $dmt$class [name_node^.element_value^.name_value (1, 1)];
        IFEND;
        name_node := name_node^.link;
      WHILEND;

    PROCEND process_ms_classes;
?? OLDTITLE ??
?? NEWTITLE := 'process_names', EJECT ??

    PROCEDURE process_names
      (    parameter_ordinal: ost$positive_integers;
       VAR policies_p {input, output} : ^SEQ ( * );
       VAR result_p {output} : ^ost$ecp_name_list);

      VAR
        count: clt$list_size,
        i: ost$positive_integers,
        name_node: ^clt$data_value;

      result_p := NIL;
      count := clp$count_list_elements (pvt [parameter_ordinal].value);

      NEXT result_p: [1 .. count] IN policies_p;
      IF result_p <> NIL THEN
        name_node := pvt [parameter_ordinal].value;
        FOR i := 1 TO count DO
          result_p^ [i] := name_node^.element_value^.name_value;
          name_node := name_node^.link;
        FOREND;
      ELSE
        osp$set_status_condition (ose$internal_workspace_full, status);
        osp$append_status_parameter (osc$status_parameter_delimiter,
              'MANAGE_EXCEPTION_POLICIES - process_names', status);
        RESET osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.sequence_pointer TO header_p;
        EXIT osp$_change_exception_policies;
      IFEND;

    PROCEND process_names;
?? OLDTITLE ??
?? NEWTITLE := 'process_volumes', EJECT ??

    PROCEDURE process_volumes
      (VAR policies_p {input, output} : ^SEQ ( * );
       VAR volumes {output} : ^ost$ecp_volume_list);

      VAR
        count: clt$list_size,
        i: ost$positive_integers,
        name_node: ^clt$data_value;

      name_node := pvt [p$volumes].value;
      count := clp$count_list_elements (pvt [p$volumes].value);

      NEXT volumes: [1 .. count] IN policies_p;
      IF volumes <> NIL THEN
        name_node := pvt [p$volumes].value;
        FOR i := 1 TO count DO
          volumes^ [i] := name_node^.element_value^.name_value (1, 6);
          name_node := name_node^.link;
        FOREND;
      ELSE
        osp$set_status_condition (ose$internal_workspace_full, status);
        osp$append_status_parameter (osc$status_parameter_delimiter,
              'MANAGE_EXCEPTION_POLICIES - process_volumes', status);
        RESET osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.sequence_pointer TO header_p;
        EXIT osp$_change_exception_policies;
      IFEND;

    PROCEND process_volumes;
?? OLDTITLE ??
?? EJECT ??

    VAR
      i: ost$positive_integers,
      jm_name: jmt$name,
      validated_name: jmt$name;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), ^check_policy_semantics, ^pvt, status);
    IF status.normal THEN

    /process_command/
      BEGIN
        NEXT header_p IN osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.sequence_pointer;
        header_p^ := policy_initialization_record;

        { Process "who" parameters
        IF pvt [p$job_classes].specified THEN
          process_names (p$job_classes, osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.
                sequence_pointer, header_p^.job_classes);
        IFEND;
        IF pvt [p$job_mode].specified THEN
          process_job_mode (header_p^.job_mode);
        IFEND;
        IF pvt [p$jobs].specified THEN
          process_names (p$jobs, osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.
                sequence_pointer, header_p^.jobs);
          FOR i := 1 TO UPPERBOUND (header_p^.jobs^) DO
            jm_name.kind := jmc$system_supplied_name;
            jm_name.system_supplied_name := header_p^.jobs^ [i];
            jmp$validate_name (jm_name, validated_name, status);
            IF status.normal THEN
              header_p^.jobs^ [i] := validated_name.system_supplied_name;
            ELSE
              EXIT /process_command/;
            IFEND;
          FOREND;
        IFEND;

        IF pvt [p$login_users].specified THEN
          process_login_users (header_p^.login_users, osv$ecp_sequence_headers [osc$ecp_session_policies]^.
                segment_p.sequence_pointer);
        IFEND;

        { Process "what" parameters
        IF pvt [p$families].specified THEN
          process_names (p$families, osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.
                sequence_pointer, header_p^.families);
        IFEND;
        IF pvt [p$files].specified THEN
          process_files (header_p^.files, osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.
                sequence_pointer);
        IFEND;
        IF pvt [p$mass_storage_classes].specified THEN
          process_ms_classes (header_p^.mass_storage_classes);
        IFEND;
        IF pvt [p$sets].specified THEN
          process_names (p$sets, osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.
                sequence_pointer, header_p^.sets);
        IFEND;
        IF pvt [p$volumes].specified THEN
          process_volumes (osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.sequence_pointer,
                header_p^.volumes);
        IFEND;

        { Process "exception" parameters
        IF pvt [p$catalog_volume_unavailable].specified THEN
          process_exception_condition (p$catalog_volume_unavailable);
        IFEND;
        IF pvt [p$cycle_busy].specified THEN
          process_exception_condition (p$cycle_busy);
        IFEND;
        IF pvt [p$cycle_restoration_required].specified THEN
          process_exception_condition (p$cycle_restoration_required);
        IFEND;
        IF pvt [p$data_retrieval_required].specified THEN
          process_exception_condition (p$data_retrieval_required);
        IFEND;
        IF pvt [p$file_server_inactive].specified THEN
          process_exception_condition (p$file_server_inactive);
        IFEND;
        IF pvt [p$space_unavailable].specified THEN
          process_exception_condition (p$space_unavailable);
        IFEND;
        IF pvt [p$volume_unavailable].specified THEN
          process_exception_condition (p$volume_unavailable);
        IFEND;

        IF pvt [p$polling_frequency].specified THEN
          header_p^.polling_frequency.specified := TRUE;
          header_p^.polling_frequency.value := pvt [p$polling_frequency].value^.integer_value.value;
        IFEND;

        IF (osv$ecp_sequence_headers [osc$ecp_session_policies] <> NIL) THEN
          IF osv$ecp_sequence_headers [osc$ecp_session_policies]^.first_policy = NIL THEN
            osv$ecp_sequence_headers [osc$ecp_session_policies]^.first_policy := header_p;
          IFEND;
          header_p^.next_policy := NIL;
          IF osv$ecp_sequence_headers [osc$ecp_session_policies]^.last_policy <> NIL THEN
            osv$ecp_sequence_headers [osc$ecp_session_policies]^.last_policy^.next_policy := header_p;
          IFEND;
          osv$ecp_sequence_headers [osc$ecp_session_policies]^.last_policy := header_p;
          osv$ecp_sequence_headers [osc$ecp_session_policies]^.number_of_policies :=
                osv$ecp_sequence_headers [osc$ecp_session_policies]^.number_of_policies + 1;
          osv$ecp_sequence_headers [osc$ecp_session_policies]^.last_accessed_policy :=
                osv$ecp_sequence_headers [osc$ecp_session_policies]^.last_accessed_policy + 1;
        IFEND;
      END /process_command/;
    IFEND; {parameter evaluation}

  PROCEND osp$_change_exception_policies;
?? OLDTITLE ??
?? NEWTITLE := 'osp$_delete_exception_policies', EJECT ??

  PROCEDURE osp$_delete_exception_policies
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$manep_delep) delete_exception_policy, delete_exception_policies, delep (
{   delete_option, do: key
{       (all, a)
{       (last, ldp, last_defined_policy, l)
{     keyend = last
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
        default_value: string (4),
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [92, 6, 25, 9, 42, 4, 335],
    clc$command, 3, 2, 0, 0, 0, 0, 2, 'OSM$MANEP_DELEP'], [
    ['DELETE_OPTION                  ',clc$nominal_entry, 1],
    ['DO                             ',clc$abbreviation_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 229,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 2
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$keyword_type], [6], [
    ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['LAST                           ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['LAST_DEFINED_POLICY            ', clc$alias_entry, clc$normal_usage_entry, 2],
    ['LDP                            ', clc$alias_entry, clc$normal_usage_entry, 2]]
    ,
    'last'],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$delete_option = 1,
      p$status = 2;

    VAR
      pvt: array [1 .. 2] of clt$parameter_value;

    VAR
      policy: ^ost$ecp_policy_header,
      policy_number: ost$positive_integers,
      reset_policy: ^ost$ecp_policy_header,
      session_segment: amt$segment_pointer;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);

    IF status.normal THEN
      IF (osv$ecp_sequence_headers [osc$ecp_session_policies] <> NIL) AND
            (osv$ecp_sequence_headers [osc$ecp_session_policies]^.number_of_policies > 0) THEN
        IF (pvt [p$delete_option].value^.keyword_value = all_keyword) OR
              (osv$ecp_sequence_headers [osc$ecp_session_policies]^.number_of_policies = 1) THEN
          session_segment := osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p;
          reset_policy := osv$ecp_sequence_headers [osc$ecp_session_policies]^.first_policy;
          osv$ecp_sequence_headers [osc$ecp_session_policies]^ := header_initialization_record;
          osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p := session_segment;
          RESET osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.
                sequence_pointer TO reset_policy;
        ELSE
          policy := osv$ecp_sequence_headers [osc$ecp_session_policies]^.first_policy;

          WHILE policy^.next_policy <> osv$ecp_sequence_headers [osc$ecp_session_policies]^.last_policy DO
            policy := policy^.next_policy;
          WHILEND;

          RESET osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.
                sequence_pointer TO osv$ecp_sequence_headers [osc$ecp_session_policies]^.last_policy;
          policy^.next_policy := NIL;
          osv$ecp_sequence_headers [osc$ecp_session_policies]^.last_policy := policy;
          osv$ecp_sequence_headers [osc$ecp_session_policies]^.number_of_policies :=
                osv$ecp_sequence_headers [osc$ecp_session_policies]^.number_of_policies - 1;
          osv$ecp_sequence_headers [osc$ecp_session_policies]^.last_accessed_policy := 0;
        IFEND;
      ELSE
        osp$set_status_condition (ose$no_session_policies_defined, status);
      IFEND;
    IFEND;

  PROCEND osp$_delete_exception_policies;

?? OLDTITLE ??
?? NEWTITLE := 'osp$_display_applicable_policy', EJECT ??

  PROCEDURE osp$_display_applicable_policy
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$manep_disap) display_applicable_policy, disap (
{   criteria, c: record
{       condition: key
{         (catalog_volume_unavailable, catalog_media_missing, cmm, cvu)
{         (cycle_busy, cb)
{         (cycle_restoration_required, ud, undefined_data, crr)
{         (data_retrieval_required, drr)
{         (file_server_inactive, fsi)
{         (space_unavailable, su)
{         (volume_unavailable, media_missing, mm, vu)
{       keyend
{       family_path_name: name
{       file: file
{       job: name
{       job_class: name
{       job_mode: key
{         (batch, b)
{         (interactive, i)
{       keyend
{       login_family: name
{       login_user: name
{       mass_storage_class: name 1..1 = $optional
{       set: name = $optional
{       volumes: list of name 1..6 = $optional
{     recend = $required
{   source, s: key
{       (installed_policies, ip)
{       (utility_session, us)
{     keyend = utility_session
{   output, o: file = $output
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 7] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 20] of clt$keyword_specification,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: record
          header: clt$type_specification_header,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_5: clt$field_specification,
        element_type_spec_5: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_6: clt$field_specification,
        element_type_spec_6: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 4] of clt$keyword_specification,
        recend,
        field_spec_7: clt$field_specification,
        element_type_spec_7: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_8: clt$field_specification,
        element_type_spec_8: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_9: clt$field_specification,
        element_type_spec_9: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_10: clt$field_specification,
        element_type_spec_10: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_11: clt$field_specification,
        element_type_spec_11: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (15),
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [93, 1, 17, 16, 15, 57, 605],
    clc$command, 7, 4, 1, 0, 0, 0, 4, 'OSM$MANEP_DISAP'], [
    ['C                              ',clc$abbreviation_entry, 1],
    ['CRITERIA                       ',clc$nominal_entry, 1],
    ['O                              ',clc$abbreviation_entry, 3],
    ['OUTPUT                         ',clc$nominal_entry, 3],
    ['S                              ',clc$abbreviation_entry, 2],
    ['SOURCE                         ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 1364,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_default_parameter, 0, 15],
{ PARAMETER 3
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 4
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$record_type], [11],
    ['CONDITION                      ', clc$required_field, 747], [[1, 0, clc$keyword_type], [20], [
      ['CATALOG_MEDIA_MISSING          ', clc$alias_entry, clc$normal_usage_entry, 1],
      ['CATALOG_VOLUME_UNAVAILABLE     ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['CB                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['CMM                            ', clc$alias_entry, clc$normal_usage_entry, 1],
      ['CRR                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['CVU                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['CYCLE_BUSY                     ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['CYCLE_RESTORATION_REQUIRED     ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['DATA_RETRIEVAL_REQUIRED        ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['DRR                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['FILE_SERVER_INACTIVE           ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['FSI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['MEDIA_MISSING                  ', clc$alias_entry, clc$normal_usage_entry, 7],
      ['MM                             ', clc$alias_entry, clc$normal_usage_entry, 7],
      ['SPACE_UNAVAILABLE              ', clc$nominal_entry, clc$normal_usage_entry, 6],
      ['SU                             ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
      ['UD                             ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['UNDEFINED_DATA                 ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['VOLUME_UNAVAILABLE             ', clc$nominal_entry, clc$normal_usage_entry, 7],
      ['VU                             ', clc$abbreviation_entry, clc$normal_usage_entry, 7]]
      ],
    ['FAMILY_PATH_NAME               ', clc$required_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['FILE                           ', clc$required_field, 3], [[1, 0, clc$file_type]],
    ['JOB                            ', clc$required_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['JOB_CLASS                      ', clc$required_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['JOB_MODE                       ', clc$required_field, 155], [[1, 0, clc$keyword_type], [4], [
      ['B                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['BATCH                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['I                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['INTERACTIVE                    ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    ['LOGIN_FAMILY                   ', clc$required_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['LOGIN_USER                     ', clc$required_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['MASS_STORAGE_CLASS             ', clc$optional_field, 5], [[1, 0, clc$name_type], [1, 1]],
    ['SET                            ', clc$optional_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['VOLUMES                        ', clc$optional_field, 21], [[1, 0, clc$list_type], [5, 0,
  clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, 6]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [4], [
    ['INSTALLED_POLICIES             ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['IP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['US                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['UTILITY_SESSION                ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ,
    'utility_session'],
{ PARAMETER 3
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$criteria = 1,
      p$source = 2,
      p$output = 3,
      p$status = 4;

    VAR
      pvt: array [1 .. 4] of clt$parameter_value;

*copy clv$display_variables
?? NEWTITLE := 'abort_handler', EJECT ??

    PROCEDURE abort_handler
      (    condition: pmt$condition;
           condition_information: ^pmt$condition_information;
           save_area: ^ost$stack_frame_save_area;
       VAR handler_status: ost$status);

      VAR
        ignore_status: ost$status;

      clp$close_display (display_control, ignore_status);

    PROCEND abort_handler;

*copy clp$new_page_procedure
?? OLDTITLE ??
?? NEWTITLE := 'put_subtitle ', EJECT ??

    PROCEDURE [INLINE] put_subtitle
      (VAR display_control: clt$display_control;
       VAR status: ost$status);

      {The presence of this procedure is required by clp$put_display but subtitling
      {is not desired.

    PROCEND put_subtitle;
?? OLDTITLE, EJECT ??

    VAR
      default_ring_attributes: amt$ring_attributes,
      display_control: clt$display_control,
      empty_display: boolean,
      local_status: ost$status,
      representation: ^clt$data_representation,
      result: ^clt$data_value,
      scratch_segment: amt$segment_pointer,
      work_area: ^clt$work_area;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);

    IF status.normal THEN
      display_control := clv$nil_display_control;
      #SPOIL (display_control);
      osp$establish_block_exit_hndlr (^abort_handler);

      mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_sequential, scratch_segment, status);
      IF status.normal THEN
        work_area := scratch_segment.sequence_pointer;
        default_ring_attributes.r1 := #RING (^default_ring_attributes);
        default_ring_attributes.r2 := #RING (^default_ring_attributes);
        default_ring_attributes.r3 := #RING (^default_ring_attributes);

        clp$open_display_reference (pvt [p$output].value^.file_value^, ^clp$new_page_procedure, fsc$list,
              default_ring_attributes, display_control, status);
        IF status.normal THEN
          clv$titles_built := FALSE;
          clv$command_name := 'DISPLAY_APPLICABLE_POLICY';

          IF display_control.page_width < clc$narrow_page_width THEN
            clv$page_width := clc$narrow_page_width;
          ELSEIF display_control.page_width > clc$wide_page_width THEN
            clv$page_width := clc$wide_page_width;
          ELSE
            clv$page_width := display_control.page_width;
          IFEND;

          make_$applicable_policy (p$criteria, pvt, p$source, empty_display, result, work_area, status);

          IF status.normal AND (result <> NIL) AND (NOT empty_display) THEN
            IF (display_control.page_format = amc$burstable_form) OR
                  (display_control.page_format = amc$non_burstable_form) THEN
              clp$new_display_page (display_control, status);
            IFEND;

            IF status.normal THEN
              clp$convert_data_to_string (result, clc$labeled_elem_representation, display_control.
                    page_width, work_area, representation, status);
              IF status.normal THEN
                clp$put_data_representation (display_control, representation, status);
              IFEND;
            IFEND;
          IFEND;
        IFEND;
        mmp$delete_scratch_segment (scratch_segment, local_status);
        IF status.normal AND (NOT local_status.normal) THEN
          status := local_status;
        IFEND;
      IFEND;
    IFEND;

    IF display_control.file_id <> amv$nil_file_identifier THEN
      clp$close_display (display_control, local_status);
      IF status.normal AND (NOT local_status.normal) THEN
        status := local_status;
      IFEND;
    IFEND;

    osp$disestablish_cond_handler;

  PROCEND osp$_display_applicable_policy;
?? OLDTITLE ??
?? NEWTITLE := 'osp$_display_exception_policies', EJECT ??

  PROCEDURE osp$_display_exception_policies
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$manep_disep) display_exception_policy, display_exception_policies, disep (
{   display_option, do: any of
{       key
{         (all, a)
{         (first, f)
{         (last, last_accessed_policy, lap, l)
{         (next, n)
{       keyend
{       integer
{     anyend = last
{   source, s: key
{       (installed_policies, ip)
{       (utility_session, us)
{     keyend = utility_session
{   output, o: file = $output
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 7] of clt$pdt_parameter_name,
      parameters: array [1 .. 4] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 10] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (15),
      recend,
      type3: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type4: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [92, 6, 23, 12, 14, 59, 276],
    clc$command, 7, 4, 0, 0, 0, 0, 4, 'OSM$MANEP_DISEP'], [
    ['DISPLAY_OPTION                 ',clc$nominal_entry, 1],
    ['DO                             ',clc$abbreviation_entry, 1],
    ['O                              ',clc$abbreviation_entry, 3],
    ['OUTPUT                         ',clc$nominal_entry, 3],
    ['S                              ',clc$abbreviation_entry, 2],
    ['SOURCE                         ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 4]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 417,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 2
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_default_parameter, 0, 15],
{ PARAMETER 3
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 4
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    377, [[1, 0, clc$keyword_type], [10], [
      ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['F                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['FIRST                          ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['LAP                            ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['LAST                           ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['LAST_ACCESSED_POLICY           ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['NEXT                           ', clc$nominal_entry, clc$normal_usage_entry, 4]]
      ],
    20, [[1, 0, clc$integer_type], [clc$min_integer, clc$max_integer, 10]]
    ,
    'last'],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [4], [
    ['INSTALLED_POLICIES             ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['IP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['US                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['UTILITY_SESSION                ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ,
    'utility_session'],
{ PARAMETER 3
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 4
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$display_option = 1,
      p$source = 2,
      p$output = 3,
      p$status = 4;

    VAR
      pvt: array [1 .. 4] of clt$parameter_value;

*copy clv$display_variables

    VAR
      policy_number: ost$positive_integers;

?? NEWTITLE := 'abort_handler', EJECT ??

    PROCEDURE abort_handler
      (    condition: pmt$condition;
           condition_information: ^pmt$condition_information;
           save_area: ^ost$stack_frame_save_area;
       VAR handler_status: ost$status);

      VAR
        ignore_status: ost$status;

      clp$close_display (display_control, ignore_status);

    PROCEND abort_handler;

*copy clp$new_page_procedure
?? OLDTITLE ??
?? TITLE := 'put_subtitle ', EJECT ??

    PROCEDURE [INLINE] put_subtitle
      (VAR display_control: clt$display_control;
       VAR status: ost$status);

      {The presence of this procedure is required by clp$put_display but subtitling
      {is not desired.

    PROCEND put_subtitle;
?? OLDTITLE, EJECT ??

    CONST
      max_subtitle_length = 30;

    VAR
      default_ring_attributes: amt$ring_attributes,
      display_control: clt$display_control,
      empty_display: boolean,
      length: integer,
      local_status: ost$status,
      representation: ^clt$data_representation,
      result: ^clt$data_value,
      scratch_segment: amt$segment_pointer,
      subtitle: string (max_subtitle_length),
      work_area: ^clt$work_area;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);

    IF status.normal THEN
      display_control := clv$nil_display_control;
      #SPOIL (display_control);
      osp$establish_block_exit_hndlr (^abort_handler);

      mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_sequential, scratch_segment, status);
      IF status.normal THEN
        work_area := scratch_segment.sequence_pointer;
        default_ring_attributes.r1 := #RING (^default_ring_attributes);
        default_ring_attributes.r2 := #RING (^default_ring_attributes);
        default_ring_attributes.r3 := #RING (^default_ring_attributes);

        clp$open_display_reference (pvt [p$output].value^.file_value^, ^clp$new_page_procedure, fsc$list,
              default_ring_attributes, display_control, status);
        IF status.normal THEN
          clv$titles_built := FALSE;
          clv$command_name := 'DISPLAY_EXCEPTION_POLICY';

          IF display_control.page_width < clc$narrow_page_width THEN
            clv$page_width := clc$narrow_page_width;
          ELSEIF display_control.page_width > clc$wide_page_width THEN
            clv$page_width := clc$wide_page_width;
          ELSE
            clv$page_width := display_control.page_width;
          IFEND;

          make_$exception_policies (p$display_option, pvt, p$source, empty_display, result, work_area,
                status);

          IF status.normal AND (result <> NIL) AND (NOT empty_display) THEN
            IF (display_control.page_format = amc$burstable_form) OR
                  (display_control.page_format = amc$non_burstable_form) THEN
              clp$new_display_page (display_control, status);
            IFEND;

            IF status.normal THEN
              IF result^.kind = clc$list THEN
                policy_number := 1;

                WHILE status.normal AND (result <> NIL) DO
                  clp$convert_data_to_string (result^.element_value, clc$labeled_elem_representation,
                        display_control.page_width, work_area, representation, status);
                  IF status.normal THEN
                    STRINGREP (subtitle, length, 'Policy Number:', policy_number);
                    clp$put_display (display_control, subtitle (1, length), clc$trim, status);
                    IF status.normal THEN
                      clp$new_display_line (display_control, {skip_count} 1, status);
                      IF status.normal THEN
                        clp$put_data_representation (display_control, representation, status);
                        result := result^.link;
                        IF result <> NIL THEN
                          clp$new_display_line (display_control, {skip_count} 2, status);
                          IF status.normal THEN
                            policy_number := policy_number + 1;
                          IFEND;
                        IFEND;
                      IFEND;
                    IFEND;
                  IFEND;
                WHILEND;
              ELSE
                clp$convert_data_to_string (result, clc$labeled_elem_representation,
                      display_control.page_width, work_area, representation, status);
                IF status.normal THEN
                  clp$put_data_representation (display_control, representation, status);
                IFEND;
              IFEND;
            IFEND;
          IFEND;
        IFEND;
        mmp$delete_scratch_segment (scratch_segment, status);
      IFEND;
    IFEND;

    IF display_control.file_id <> amv$nil_file_identifier THEN
      clp$close_display (display_control, local_status);
      IF status.normal AND (NOT local_status.normal) THEN
        status := local_status;
      IFEND;
    IFEND;

    osp$disestablish_cond_handler;

  PROCEND osp$_display_exception_policies;
?? OLDTITLE ??
?? NEWTITLE := 'osp$_end_manecp', EJECT ??

  PROCEDURE osp$_end_manecp
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$manep_qui) quit, qui (
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 1] of clt$pdt_parameter_name,
      parameters: array [1 .. 1] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [92, 4, 3, 13, 30, 14, 105],
    clc$command, 1, 1, 0, 0, 0, 0, 1, ''], [
    ['STATUS                         ',clc$nominal_entry, 1]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$status = 1;

    VAR
      pvt: array [1 .. 1] of clt$parameter_value;

    status.normal := TRUE;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF status.normal THEN
      clp$end_include (utility_name, status);
    IFEND;

  PROCEND osp$_end_manecp;
?? OLDTITLE ??
?? NEWTITLE := 'osp$_install_default_policies', EJECT ??

  PROCEDURE osp$_install_default_policies
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$manep_insdp) install_default_policies, insdp (
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 1] of clt$pdt_parameter_name,
      parameters: array [1 .. 1] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [92, 6, 1, 10, 43, 35, 561],
    clc$command, 1, 1, 0, 0, 0, 0, 1, ''], [
    ['STATUS                         ',clc$nominal_entry, 1]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$status = 1;

    VAR
      pvt: array [1 .. 1] of clt$parameter_value;

    VAR
      obsolete_segment: amt$segment_pointer,
      sequence_headers: array [ost$ecp_sequence_index] of ^ost$ecp_header;

?? NEWTITLE := 'install_default_policies', EJECT ??

    PROCEDURE install_default_policies
      (VAR status: ost$status);

      VAR
        i: ost$positive_integers;

      FOR i := 1 TO UPPERBOUND (default_policies) DO
        clp$include_command (default_policies [i], {enable_echoing} FALSE, status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      FOREND;

      osv$ecp_sequence_headers [osc$ecp_session_policies]^.system_default_policies := TRUE;

      install_exception_policies (osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.
            sequence_pointer, status);

    PROCEND install_default_policies;
?? OLDTITLE, EJECT ??
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF status.normal THEN
      IF (osv$ecp_sequence_headers [osc$ecp_session_policies] = NIL) OR
            (osv$ecp_sequence_headers [osc$ecp_session_policies]^.number_of_policies = 0) THEN
        install_default_policies (status);
        IF status.normal THEN
          IF osv$ecp_sequence_headers [osc$ecp_installed_policies] <> NIL THEN
            obsolete_segment := osv$ecp_sequence_headers [osc$ecp_installed_policies]^.segment_p;
          ELSE
            obsolete_segment.sequence_pointer := NIL;
          IFEND;
          sequence_headers [osc$ecp_installed_policies] := osv$ecp_sequence_headers
                [osc$ecp_session_policies];
          IF obsolete_segment.sequence_pointer <> NIL THEN
            mmp$delete_scratch_segment (obsolete_segment, status);
          IFEND;
          IF status.normal THEN
            initialize_session_segment (sequence_headers [osc$ecp_session_policies], status);
            IF status.normal THEN
              osp$store_sequence_headers (sequence_headers, status);
            IFEND;
          IFEND;
        IFEND;
      ELSE
        osp$set_status_condition (ose$session_policies_defined, status);
      IFEND;
    IFEND;

  PROCEND osp$_install_default_policies;
?? OLDTITLE ??
?? NEWTITLE := 'osp$_install_exception_policies', EJECT ??

  PROCEDURE osp$_install_exception_policies
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (osm$manep_insep) install_exception_policies, insep (
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 1] of clt$pdt_parameter_name,
      parameters: array [1 .. 1] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [92, 4, 17, 14, 7, 3, 980],
    clc$command, 1, 1, 0, 0, 0, 0, 1, ''], [
    ['STATUS                         ',clc$nominal_entry, 1]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$status = 1;

    VAR
      pvt: array [1 .. 1] of clt$parameter_value;

    VAR
      exception_conditions: ost$ecp_conditions,
      ignore_policy_criteria: ost$ecp_policy_criteria,
      obsolete_segment: amt$segment_pointer,
      sequence_headers: array [ost$ecp_sequence_index] of ^ost$ecp_header;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF status.normal THEN
      IF (osv$ecp_sequence_headers [osc$ecp_session_policies] <> NIL) AND
            (osv$ecp_sequence_headers [osc$ecp_session_policies]^.number_of_policies > 0) THEN
        osp$get_union_of_policies (osv$ecp_sequence_headers [osc$ecp_session_policies], exception_conditions,
              ignore_policy_criteria, status);
        IF status.normal THEN
          analyze_policy_coverage (exception_conditions, status);
          IF status.normal THEN
            install_exception_policies (osv$ecp_sequence_headers [osc$ecp_session_policies]^.segment_p.
                  sequence_pointer, status);
            IF status.normal THEN
              IF osv$ecp_sequence_headers [osc$ecp_installed_policies] <> NIL THEN
                obsolete_segment := osv$ecp_sequence_headers [osc$ecp_installed_policies]^.segment_p;
              ELSE
                obsolete_segment.sequence_pointer := NIL;
              IFEND;
              sequence_headers [osc$ecp_installed_policies] :=
                    osv$ecp_sequence_headers [osc$ecp_session_policies];
              IF obsolete_segment.sequence_pointer <> NIL THEN
                mmp$delete_scratch_segment (obsolete_segment, status);
              IFEND;
              IF status.normal THEN
                initialize_session_segment (sequence_headers [osc$ecp_session_policies], status);
                IF status.normal THEN
                  osp$store_sequence_headers (sequence_headers, status);
                IFEND;
              IFEND;
            IFEND;
          IFEND;
        IFEND;
      ELSE
        osp$set_status_condition (ose$no_session_policies_defined, status);
      IFEND;
    IFEND;

  PROCEND osp$_install_exception_policies;
?? OLDTITLE ??
?? NEWTITLE := 'osp$$applicable_policy', EJECT ??

  PROCEDURE osp$$applicable_policy
    (    parameter_list: clt$parameter_list;
     VAR work_area {input, output} : ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

{ FUNCTION $applicable_policy (
{   criteria: record
{       condition: key
{         (catalog_volume_unavailable, catalog_media_missing, cmm, cvu)
{         (cycle_busy, cb)
{         (cycle_restoration_required, ud, undefined_data, crr)
{         (data_retrieval_required, drr)
{         (file_server_inactive, fsi)
{         (space_unavailable, su)
{         (volume_unavailable, media_missing, mm, vu)
{       keyend
{       family_path_name: name
{       file: file
{       job: name
{       job_class: name
{       job_mode: key
{         (batch, b)
{         (interactive, i)
{       keyend
{       login_family: name
{       login_user: name
{       mass_storage_class: name 1..1
{       set: name
{       volumes: list of name 1..6
{     recend = $required
{   source: key
{       (installed_policies, ip)
{       (utility_session, us)
{     keyend = utility_session
{   )

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 2] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 20] of clt$keyword_specification,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_3: clt$field_specification,
        element_type_spec_3: record
          header: clt$type_specification_header,
        recend,
        field_spec_4: clt$field_specification,
        element_type_spec_4: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_5: clt$field_specification,
        element_type_spec_5: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_6: clt$field_specification,
        element_type_spec_6: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 4] of clt$keyword_specification,
        recend,
        field_spec_7: clt$field_specification,
        element_type_spec_7: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_8: clt$field_specification,
        element_type_spec_8: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_9: clt$field_specification,
        element_type_spec_9: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_10: clt$field_specification,
        element_type_spec_10: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_11: clt$field_specification,
        element_type_spec_11: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier_v2,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (15),
      recend,
    recend := [
    [1,
    [92, 8, 17, 12, 40, 29, 848],
    clc$function, 2, 2, 1, 0, 0, 0, 0, ''], [
    ['CRITERIA                       ',clc$nominal_entry, 1],
    ['SOURCE                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 1364,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_default_parameter, 0, 15]],
{ PARAMETER 1
    [[1, 0, clc$record_type], [11],
    ['CONDITION                      ', clc$required_field, 747], [[1, 0, clc$keyword_type], [20], [
      ['CATALOG_MEDIA_MISSING          ', clc$alias_entry, clc$normal_usage_entry, 1],
      ['CATALOG_VOLUME_UNAVAILABLE     ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['CB                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['CMM                            ', clc$alias_entry, clc$normal_usage_entry, 1],
      ['CRR                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['CVU                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['CYCLE_BUSY                     ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['CYCLE_RESTORATION_REQUIRED     ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['DATA_RETRIEVAL_REQUIRED        ', clc$nominal_entry, clc$normal_usage_entry, 4],
      ['DRR                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['FILE_SERVER_INACTIVE           ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['FSI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
      ['MEDIA_MISSING                  ', clc$alias_entry, clc$normal_usage_entry, 7],
      ['MM                             ', clc$alias_entry, clc$normal_usage_entry, 7],
      ['SPACE_UNAVAILABLE              ', clc$nominal_entry, clc$normal_usage_entry, 6],
      ['SU                             ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
      ['UD                             ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['UNDEFINED_DATA                 ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['VOLUME_UNAVAILABLE             ', clc$nominal_entry, clc$normal_usage_entry, 7],
      ['VU                             ', clc$abbreviation_entry, clc$normal_usage_entry, 7]]
      ],
    ['FAMILY_PATH_NAME               ', clc$required_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['FILE                           ', clc$required_field, 3], [[1, 0, clc$file_type]],
    ['JOB                            ', clc$required_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['JOB_CLASS                      ', clc$required_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['JOB_MODE                       ', clc$required_field, 155], [[1, 0, clc$keyword_type], [4], [
      ['B                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['BATCH                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['I                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['INTERACTIVE                    ', clc$nominal_entry, clc$normal_usage_entry, 2]]
      ],
    ['LOGIN_FAMILY                   ', clc$required_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['LOGIN_USER                     ', clc$required_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['MASS_STORAGE_CLASS             ', clc$required_field, 5], [[1, 0, clc$name_type], [1, 1]],
    ['SET                            ', clc$required_field, 5], [[1, 0, clc$name_type], [1, osc$max_name_size]
  ],
    ['VOLUMES                        ', clc$required_field, 21], [[1, 0, clc$list_type], [5, 0,
  clc$max_list_size, 0, FALSE, FALSE],
        [[1, 0, clc$name_type], [1, 6]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [4], [
    ['INSTALLED_POLICIES             ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['IP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['US                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['UTILITY_SESSION                ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ,
    'utility_session']];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$criteria = 1,
      p$source = 2;

    VAR
      pvt: array [1 .. 2] of clt$parameter_value;

    VAR
      ignore_empty_display: boolean;


    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);

    IF status.normal THEN
      make_$applicable_policy (p$criteria, pvt, p$source, ignore_empty_display, result, work_area, status);
    IFEND;

  PROCEND osp$$applicable_policy;
?? OLDTITLE ??
?? NEWTITLE := 'osp$$criteria', EJECT ??

  PROCEDURE osp$$criteria
    (    parameter_list: clt$parameter_list;
     VAR work_area {input, output} : ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

{ FUNCTION $criteria (
{   condition: key
{       (catalog_volume_unavailable, catalog_media_missing, cmm, cvu)
{       (cycle_busy, cb)
{       (cycle_restoration_required, ud, undefined_data, crr)
{       (data_retrieval_required, drr)
{       (file_server_inactive, fsi)
{       (space_unavailable, su)
{       (volume_unavailable, media_missing, mm, vu)
{     keyend = $required
{   file: file = $required
{   job_mode: key
{       (batch, b)
{       (interactive, i)
{     keyend = $optional
{   )

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 20] of clt$keyword_specification,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
      recend,
    recend := [
    [1,
    [92, 4, 27, 12, 13, 10, 726],
    clc$function, 3, 3, 2, 0, 0, 0, 0, ''], [
    ['CONDITION                      ',clc$nominal_entry, 1],
    ['FILE                           ',clc$nominal_entry, 2],
    ['JOB_MODE                       ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 747,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$required_parameter, 0
  , 0],
{ PARAMETER 3
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$keyword_type], [20], [
    ['CATALOG_MEDIA_MISSING          ', clc$alias_entry, clc$normal_usage_entry, 1],
    ['CATALOG_VOLUME_UNAVAILABLE     ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['CB                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['CMM                            ', clc$alias_entry, clc$normal_usage_entry, 1],
    ['CRR                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
    ['CVU                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['CYCLE_BUSY                     ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['CYCLE_RESTORATION_REQUIRED     ', clc$nominal_entry, clc$normal_usage_entry, 3],
    ['DATA_RETRIEVAL_REQUIRED        ', clc$nominal_entry, clc$normal_usage_entry, 4],
    ['DRR                            ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
    ['FILE_SERVER_INACTIVE           ', clc$nominal_entry, clc$normal_usage_entry, 5],
    ['FSI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 5],
    ['MEDIA_MISSING                  ', clc$alias_entry, clc$normal_usage_entry, 7],
    ['MM                             ', clc$alias_entry, clc$normal_usage_entry, 7],
    ['SPACE_UNAVAILABLE              ', clc$nominal_entry, clc$normal_usage_entry, 6],
    ['SU                             ', clc$abbreviation_entry, clc$normal_usage_entry, 6],
    ['UD                             ', clc$alias_entry, clc$normal_usage_entry, 3],
    ['UNDEFINED_DATA                 ', clc$alias_entry, clc$normal_usage_entry, 3],
    ['VOLUME_UNAVAILABLE             ', clc$nominal_entry, clc$normal_usage_entry, 7],
    ['VU                             ', clc$abbreviation_entry, clc$normal_usage_entry, 7]]
    ],
{ PARAMETER 2
    [[1, 0, clc$file_type]],
{ PARAMETER 3
    [[1, 0, clc$keyword_type], [4], [
    ['B                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['BATCH                          ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['I                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['INTERACTIVE                    ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$condition = 1,
      p$file = 2,
      p$job_mode = 3;

    VAR
      pvt: array [1 .. 3] of clt$parameter_value;

?? POP ??

    CONST
      condition = 1,
      family_path_name = 2,
      file = 3,
      job = 4,
      job_class = 5,
      job_mode = 6,
      login_family = 7,
      login_user = 8,
      mass_storage_class = 9,
      set_name = 10,
      volume_list = 11,

      number_of_fields = 11;

    VAR
      criteria: ost$ecp_criteria,
      file_identifier: ost$ecp_file_identification,
      i: ost$positive_integers,
      ignore_volume_cond_list: ^fst$volume_condition_list,
      name1: string (1),
      node: ^^clt$data_value,
      sequence: ^SEQ ( * ),
      seq_size: ost$positive_integers;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);

    IF status.normal THEN
      file_identifier.selector := osc$ecp_file_reference;
      file_identifier.file_reference := pvt [p$file].value^.file_value;

      seq_size := #SIZE (fst$goi_object_information) + fsc$max_path_size + #SIZE (fst$goi_object) +
            #SIZE (fst$device_information) + (max_volumes_per_file * (#SIZE (rmt$volume_descriptor) +
            #SIZE (fst$file_access_condition)));
      PUSH sequence: [[REP seq_size OF cell]];

      osp$get_login_user_criteria (criteria, status);
      IF status.normal THEN
        osp$get_file_criteria (file_identifier, {catalog_object} FALSE, {catalog_space_unavailable} FALSE,
               {password} osc$null_name, sequence, criteria, ignore_volume_cond_list, status);

        IF status.normal THEN
          clp$make_record_value (number_of_fields, work_area, result);

          node := ^result^.field_values^ [condition].value;
          result^.field_values^ [condition].name := 'CONDITION';
          clp$make_keyword_value (pvt [p$condition].value^.keyword_value, work_area, node^);

          node := ^result^.field_values^ [family_path_name].value;
          result^.field_values^ [family_path_name].name := 'FAMILY_PATH_NAME';
          clp$make_name_value (criteria.family_path_name, work_area, node^);

          node := ^result^.field_values^ [file].value;
          result^.field_values^ [file].name := 'FILE';
          IF criteria.file <> osc$null_name THEN
            clp$make_file_value (criteria.file, work_area, node^);
          ELSE
            clp$make_unspecified_value (work_area, node^);
          IFEND;

          node := ^result^.field_values^ [job].value;
          result^.field_values^ [job].name := job_keyword;
          clp$make_name_value (criteria.job, work_area, node^);

          node := ^result^.field_values^ [job_class].value;
          result^.field_values^ [job_class].name := job_class_keyword;
          clp$make_name_value (criteria.job_class, work_area, node^);

          node := ^result^.field_values^ [job_mode].value;
          result^.field_values^ [job_mode].name := job_mode_keyword;
          IF pvt [p$job_mode].specified THEN
            IF pvt [p$job_mode].value^.keyword_value = batch THEN
              criteria.job_mode := jmc$batch;
            ELSE {INTERACTIVE}
              criteria.job_mode := jmc$interactive_connected;
            IFEND;
          IFEND;
          IF criteria.job_mode = jmc$batch THEN
            clp$make_keyword_value (batch, work_area, node^);
          ELSE
            clp$make_keyword_value (interactive, work_area, node^);
          IFEND;

          node := ^result^.field_values^ [login_family].value;
          result^.field_values^ [login_family].name := 'LOGIN_FAMILY';
          clp$make_name_value (criteria.login_family, work_area, node^);

          node := ^result^.field_values^ [login_user].value;
          result^.field_values^ [login_user].name := 'LOGIN_USER';
          clp$make_name_value (criteria.login_user, work_area, node^);

          node := ^result^.field_values^ [mass_storage_class].value;
          result^.field_values^ [mass_storage_class].name := mass_storage_class_keyword;
          IF criteria.mass_storage_class <> rmc$unspecified_file_class THEN
            #UNCHECKED_CONVERSION (criteria.mass_storage_class, name1);
            clp$make_name_value (name1, work_area, node^);
          ELSE
            clp$make_unspecified_value (work_area, node^);
          IFEND;

          node := ^result^.field_values^ [set_name].value;
          result^.field_values^ [set_name].name := set_keyword;
          IF criteria.set_name <> osc$null_name THEN
            clp$make_name_value (criteria.set_name, work_area, node^);
          ELSE
            clp$make_unspecified_value (work_area, node^);
          IFEND;

          node := ^result^.field_values^ [volume_list].value;
          result^.field_values^ [volume_list].name := volumes_keyword;
          IF criteria.volume_list <> NIL THEN
            FOR i := 1 TO UPPERBOUND (criteria.volume_list^) DO
              clp$make_list_value (work_area, node^);
              clp$make_name_value (criteria.volume_list^ [i].recorded_vsn, work_area, node^^.element_value);
              node := ^node^^.link;
            FOREND;
          ELSE
            clp$make_unspecified_value (work_area, node^);
          IFEND;

        IFEND;
        IF result = NIL THEN
          osp$set_status_abnormal ('CL', cle$work_area_overflow, '$CRITERIA', status);
        IFEND;
      IFEND;
    IFEND;

  PROCEND osp$$criteria;
?? OLDTITLE ??
?? NEWTITLE := 'osp$$exception_policy', EJECT ??

  PROCEDURE osp$$exception_policy
    (    parameter_list: clt$parameter_list;
     VAR work_area {input, output} : ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

{ FUNCTION $exception_policy (
{   policy: any of
{       key
{         (all, a)
{         (first, f)
{         (last, last_accessed_policy, lap, l)
{         (next, n)
{       keyend
{       integer
{     anyend = last
{   source: key
{       (installed_policies, ip)
{       (utility_session, us)
{     keyend = utility_session
{   )

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 2] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 10] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
        default_value: string (4),
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (15),
      recend,
    recend := [
    [1,
    [92, 6, 23, 12, 16, 18, 13],
    clc$function, 2, 2, 0, 0, 0, 0, 0, ''], [
    ['POLICY                         ',clc$nominal_entry, 1],
    ['SOURCE                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 417,
  clc$optional_default_parameter, 0, 4],
{ PARAMETER 2
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_default_parameter, 0, 15]],
{ PARAMETER 1
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    377, [[1, 0, clc$keyword_type], [10], [
      ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['F                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['FIRST                          ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['L                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['LAP                            ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['LAST                           ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['LAST_ACCESSED_POLICY           ', clc$alias_entry, clc$normal_usage_entry, 3],
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['NEXT                           ', clc$nominal_entry, clc$normal_usage_entry, 4]]
      ],
    20, [[1, 0, clc$integer_type], [clc$min_integer, clc$max_integer, 10]]
    ,
    'last'],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [4], [
    ['INSTALLED_POLICIES             ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['IP                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['US                             ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['UTILITY_SESSION                ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ,
    'utility_session']];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$policy = 1,
      p$source = 2;

    VAR
      pvt: array [1 .. 2] of clt$parameter_value;

    VAR
      ignore_empty_display: boolean;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);

    IF status.normal THEN
      make_$exception_policies (p$policy, pvt, p$source, ignore_empty_display, result, work_area, status);
    IFEND;

  PROCEND osp$$exception_policy;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] osp$chacc_applicable_policy', EJECT ??

  FUNCTION [XDCL, #GATE] osp$chacc_applicable_policy
    (    policy: ^ost$ecp_policy_header): boolean;

    VAR
      i: ost$positive_integers,
      ok: boolean,
      temp_file_count: ost$non_negative_integers;

    osp$chacc_applicable_policy := FALSE;
    IF policy <> NIL THEN
      ok := (policy^.jobs = NIL) AND (NOT policy^.job_mode.specified) AND (policy^.job_classes = NIL);
      IF ok THEN
        IF (policy^.login_users <> NIL) THEN
          FOR i := LOWERBOUND (policy^.login_users^) TO UPPERBOUND (policy^.login_users^) DO
            IF (policy^.login_users^ [i].specified_fields * $ost$ecp_specified_login_fields
                  [osc$lu_job_class, osc$lu_job_mode]) <> $ost$ecp_specified_login_fields [] THEN
              RETURN;
            IFEND;
          FOREND;
        IFEND;

        IF policy^.files.specified AND (NOT policy^.files.all_specified) THEN
          temp_file_count := 0;
          FOR i := LOWERBOUND (policy^.files.path_list^) TO UPPERBOUND (policy^.files.path_list^) DO
            IF policy^.files.path_list^ [i].file_reference_type <> osc$ecp_generic_reference THEN
              IF temporary_file (policy^.files.path_list^ [i].path^) THEN
                temp_file_count := temp_file_count + 1;
              IFEND;
            IFEND;
          FOREND;
          {If the policy's file list consists only of temporary files, it does not apply to CHACC
          IF temp_file_count = UPPERBOUND (policy^.files.path_list^) THEN
            RETURN;
          IFEND;
        IFEND;

        FOR i := 1 TO UPPERBOUND (policy^.conditions) DO
          IF policy^.conditions [i].specified THEN
            IF (($fst$file_access_conditions [fsc$data_restoration_required, fsc$volume_unavailable,
                  fsc$media_missing] * policy^.conditions [i].file_access_conditions) =
                  $fst$file_access_conditions []) THEN
              RETURN;
            ELSEIF (($ost$ecp_actions [osc$ecp_delete, osc$ecp_enable_matching_image,
                  osc$ecp_enable_nonmatch_image] * policy^.conditions [i].actions) = $ost$ecp_actions []) THEN
              RETURN;
            IFEND;
          IFEND;
        FOREND;
        osp$chacc_applicable_policy := TRUE;
      IFEND;
    IFEND;

  FUNCEND osp$chacc_applicable_policy;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] osp$find_applicable_policy', EJECT ??

  PROCEDURE [XDCL, #GATE] osp$find_applicable_policy
    (    criteria: ost$ecp_criteria;
         policies_sequence_header: ^ost$ecp_header;
     VAR applicable_actions: ost$ecp_actions;
     VAR applicable_policy: ^ost$ecp_policy_header;
     VAR status: ost$status);

*copyc osi$find_applicable_policy

    find_applicable_policy (criteria, policies_sequence_header, applicable_actions, applicable_policy,
          status);

  PROCEND osp$find_applicable_policy;
?? OLDTITLE ??
?? NEWTITLE := 'osp$get_file_criteria', EJECT ??

   PROCEDURE [XDCL, #GATE] osp$get_file_criteria
    (    file: ost$ecp_file_identification;
         catalog_object: boolean;
         catalog_space_unavailable: boolean;
         password: pft$name;
     VAR work_area {input, output} : ^SEQ ( * );
     VAR criteria: ost$ecp_criteria;
     VAR volume_condition_list: ^fst$volume_condition_list;
     VAR status: ost$status);

?? NEWTITLE := 'get_relevant_object_attributes', EJECT ??

    PROCEDURE get_relevant_object_attributes
      (    file_reference: fst$file_reference;
           validation_criteria: ^fst$goi_validation_criteria;
       VAR object_condition: fst$file_access_condition;
       VAR object_type: fst$goi_object_type;
       VAR mass_storage_class: dmt$class_member;
       VAR resolved_path: fst$path;
       VAR set_name: ost$name;
       VAR volume_condition_list: ^fst$volume_condition_list;
       VAR volume_list: ^rmt$volume_list;
       VAR status: ost$status);

      VAR
        information_request: fst$goi_information_request,
        object: ^fst$goi_object_information;

      status.normal := TRUE;
      object_condition := fsc$null_file_access_condition;
      object_type := fsc$goi_file_object;
      mass_storage_class := rmc$unspecified_file_class;
      resolved_path := osc$null_name;
      resolved_path (1, STRLENGTH (file_reference)) := file_reference (1, STRLENGTH (file_reference));
      set_name := osc$null_name;
      volume_condition_list := NIL;
      volume_list := NIL;

      RESET work_area;

      information_request.catalog_depth.depth_specification := fsc$specific_depth;
      information_request.catalog_depth.depth := 1;
      information_request.object_information_requests := $fst$goi_object_info_requests
            [fsc$goi_catalog_device_info, fsc$goi_cycle_device_info, fsc$goi_set_name];

      pfp$get_object_information (file_reference, information_request, validation_criteria, work_area,
            status);

      IF status.normal THEN
        RESET work_area;
        NEXT object IN work_area;
        IF object <> NIL THEN
          resolved_path := object^.resolved_path^;
          object_type := object^.object^.object_type;
          CASE object^.object^.object_type OF
          = fsc$goi_catalog_object =
            IF object^.object^.catalog_device_information <> NIL THEN
              IF object^.object^.catalog_device_information^.mass_storage_device_info.resides_online THEN
                object_condition := object^.object^.catalog_device_information^.mass_storage_device_info.
                      object_condition;
                mass_storage_class := object^.object^.catalog_device_information^.
                      mass_storage_device_info.mass_storage_class;
                volume_condition_list := object^.object^.catalog_device_information^.mass_storage_device_info.
                      volume_condition_list;
                volume_list := object^.object^.catalog_device_information^.mass_storage_device_info.
                      volume_list;
                set_name := object^.set_name;
              IFEND;
            IFEND;
          = fsc$goi_cycle_object =
            IF object^.object^.cycle_device_class = rmc$mass_storage_device THEN
              IF object^.object^.cycle_device_information <> NIL THEN
                IF object^.object^.cycle_device_information^.mass_storage_device_info.resides_online THEN
                  object_condition := object^.object^.cycle_device_information^.mass_storage_device_info.
                        object_condition;
                  mass_storage_class := object^.object^.cycle_device_information^.
                        mass_storage_device_info.mass_storage_class;
                  volume_condition_list := object^.object^.cycle_device_information^.mass_storage_device_info.
                        volume_condition_list;
                  volume_list := object^.object^.cycle_device_information^.mass_storage_device_info.
                        volume_list;
                  set_name := object^.set_name;
                IFEND;
              IFEND;
            IFEND;
          ELSE
          CASEND;
        IFEND;
      IFEND;
    PROCEND get_relevant_object_attributes;
?? OLDTITLE ??
?? NEWTITLE := 'set_defaults_from_path', EJECT ??

  PROCEDURE set_defaults_from_path
    (    pf_path: ^pft$path);

    IF pf_path <> NIL THEN
      criteria.family_path_name := pf_path^ [pfc$family_name_index];
      criteria.mass_storage_class := fsp$default_file_class (pf_path^);
      IF catalog_object THEN
        CASE criteria.mass_storage_class OF
        = rmc$msc_system_permanent_files =
          criteria.mass_storage_class := rmc$msc_system_catalogs;
        = rmc$msc_user_permanent_files =
          criteria.mass_storage_class := rmc$msc_user_catalogs;
        ELSE
        CASEND;
      IFEND;
    IFEND;
  PROCEND set_defaults_from_path;
?? OLDTITLE ??

    VAR
      access_condition_entry: fst$access_condition_entry,
      entry_found: boolean,
      evaluated_file_reference: fst$evaluated_file_reference,
      fetch_attributes: ^array [1 .. 1] of amt$fetch_item,
      file_reference: ^fst$path,
      fs_path: ^fst$path,
      fs_path_size: fst$path_size,
      i: 1 .. fsc$max_path_size,
      ignore_file_instance: ^bat$task_file_entry,
      ignore_resolved_path: fst$path,
      local_status: ost$status,
      object_condition: fst$file_access_condition,
      object_type: fst$goi_object_type,
      original_file_ref: ^fst$path,
      parental_set_name: ost$name,
      pf_path: ^pft$path,
      resolved_file_reference: ^fst$resolved_file_reference,
      size: integer,
      validation_criteria: ^fst$goi_validation_criteria;

    status.normal := TRUE;

    criteria.family_path_name := osc$null_name;
    criteria.file := '';
    criteria.mass_storage_class := rmc$unspecified_file_class;
    criteria.set_name := osc$null_name;
    criteria.volume_list := NIL;

    volume_condition_list := NIL;

    pf_path := NIL;

    PUSH fs_path;

    CASE file.selector OF

    = osc$ecp_evaluated_file_ref =
      clp$convert_file_ref_to_string (file.evaluated_file_reference, {include_open_position} FALSE, fs_path^,
            fs_path_size, local_status);
      IF local_status.normal THEN
        criteria.file := fs_path^ (1, fs_path_size);
      IFEND;
      PUSH pf_path: [1 .. file.evaluated_file_reference.number_of_path_elements];
      fsp$convert_fs_structure_to_pf (file.evaluated_file_reference, pf_path);

    = osc$ecp_file_identifier =
      PUSH fetch_attributes;
      PUSH resolved_file_reference;
      fetch_attributes^ [1].key := amc$resolved_file_reference;
      fetch_attributes^ [1].resolved_file_reference := resolved_file_reference;

      amp$fetch (file.file_identifier, fetch_attributes^, local_status);
      IF local_status.normal THEN
        criteria.file := resolved_file_reference^.path (1, resolved_file_reference^.complete_path_size);
        clp$evaluate_file_reference (criteria.file, $clt$file_ref_parsing_options [], FALSE,
              evaluated_file_reference, local_status);
        IF local_status.normal THEN
          PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
          fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
        IFEND;
      IFEND;

    = osc$ecp_file_reference =
      IF file.file_reference <> NIL THEN
        criteria.file := file.file_reference^;
        clp$evaluate_file_reference (file.file_reference^, $clt$file_ref_parsing_options [], FALSE,
              evaluated_file_reference, local_status);
        IF local_status.normal THEN
          PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
          fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
        IFEND;
      ELSE
        criteria.file := osc$null_name;
      IFEND;

    = osc$ecp_file_segment =
      bap$find_open_file_via_segment (#SEGMENT (file.file_segment), ignore_file_instance, fs_path^,
            fs_path_size, entry_found);
      IF entry_found THEN
        criteria.file := fs_path^ (1, fs_path_size);
        clp$evaluate_file_reference (criteria.file, $clt$file_ref_parsing_options [], FALSE,
              evaluated_file_reference, local_status);
        IF local_status.normal THEN
          PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
          fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
        IFEND;
      IFEND;

    = osc$ecp_pf_path =
      IF file.pf_path <> NIL THEN
        pf_path := file.pf_path;
        pfp$convert_pft$path_to_fs_str (file.pf_path^, evaluated_file_reference);
        IF catalog_object THEN
          evaluated_file_reference.cycle_reference.specification := fsc$cycle_omitted;
        ELSE
          CASE file.cycle_selector.cycle_option OF
          = pfc$highest_cycle =
            evaluated_file_reference.cycle_reference.specification := fsc$high_cycle;
          = pfc$lowest_cycle =
            evaluated_file_reference.cycle_reference.specification := fsc$low_cycle;
          = pfc$specific_cycle =
            evaluated_file_reference.cycle_reference.specification := fsc$cycle_number;
            evaluated_file_reference.cycle_reference.cycle_number := file.cycle_selector.cycle_number;
          ELSE
            evaluated_file_reference.cycle_reference.specification := fsc$high_cycle;
          CASEND;
        IFEND;
        clp$convert_file_ref_to_string (evaluated_file_reference, {include_open_position} FALSE, fs_path^,
              fs_path_size, local_status);
        IF local_status.normal THEN
          criteria.file := fs_path^ (1, fs_path_size);
        IFEND;
      ELSE
        criteria.file := osc$null_name;
      IFEND;
    ELSE
    CASEND;

    IF (criteria.file <> osc$null_name) AND catalog_space_unavailable THEN
      { Isolate the parental catalog}
      PUSH file_reference;
      FOR i := 1 TO (UPPERBOUND (pf_path^) - 1) DO
        IF i > 1 THEN
          size := clp$trimmed_string_size (file_reference^ (1, size));
          STRINGREP (file_reference^, size, file_reference^ (1, size), '.', pf_path^ [i]);
        ELSE
          STRINGREP (file_reference^, size, ':', pf_path^ [i]);
        IFEND;
      FOREND;
      criteria.file := file_reference^ (1, size);
      clp$evaluate_file_reference (criteria.file, $clt$file_ref_parsing_options [], FALSE,
             evaluated_file_reference, local_status);
      IF local_status.normal THEN
        PUSH pf_path: [1 .. evaluated_file_reference.number_of_path_elements];
        fsp$convert_fs_structure_to_pf (evaluated_file_reference, pf_path);
      IFEND;
    IFEND;

    IF local_status.normal AND (criteria.file <> osc$null_name) THEN
      set_defaults_from_path (pf_path);

      IF password <> osc$null_name THEN
        PUSH validation_criteria: [1 .. 1];
        validation_criteria^ [1].validation_selection := fsc$goi_password;
        validation_criteria^ [1].password := password;
      ELSE
        validation_criteria := NIL;
      IFEND;
      get_relevant_object_attributes (criteria.file, validation_criteria, object_condition, object_type,
            criteria.mass_storage_class, criteria.file, criteria.set_name, volume_condition_list,
            criteria.volume_list, local_status);
      IF (NOT local_status.normal) AND osp$file_access_condition (local_status) THEN
        {
        { PFP$GET_OBJECT_INFORMATION returns abnormal status if a catalog in the path is missing or
        { unavailable, so we need to find that missing or unavailable catalog
        {
        osp$get_access_condition_entry (local_status, access_condition_entry, entry_found);
        IF entry_found THEN
          CASE access_condition_entry.file_access_condition OF
          = fsc$catalog_media_missing, fsc$catalog_volume_unavailable =
            PUSH file_reference;
            FOR i := 1 TO UPPERBOUND (pf_path^) DO
              IF i > 1 THEN
                size := clp$trimmed_string_size (file_reference^ (1, size));
                STRINGREP (file_reference^, size, file_reference^ (1, size), '.', pf_path^ [i]);
              ELSE
                STRINGREP (file_reference^, size, ':', pf_path^ [i]);
              IFEND;
              get_relevant_object_attributes (file_reference^ (1, size), validation_criteria,
                    object_condition, object_type, criteria.mass_storage_class, criteria.file,
                    criteria.set_name, volume_condition_list, criteria.volume_list, local_status);
              IF local_status.normal AND (object_condition <> fsc$null_file_access_condition) THEN
                RETURN;
              IFEND;
            FOREND;
          ELSE
          CASEND;
        IFEND;
      ELSEIF (NOT local_status.normal) AND (pf_path^ [1] <> fsc$local) THEN
        {
        { Isolate a possible space unavailable condition on the parental catalog during creation of a
        { catalog or file.
        {
        PUSH original_file_ref;
        original_file_ref^ := criteria.file;
        PUSH file_reference;
        FOR i := 1 TO (UPPERBOUND (pf_path^) - 1) DO
          IF i > 1 THEN
            size := clp$trimmed_string_size (file_reference^ (1, size));
            STRINGREP (file_reference^, size, file_reference^ (1, size), '.', pf_path^ [i]);
          ELSE
            STRINGREP (file_reference^, size, ':', pf_path^ [i]);
          IFEND;
        FOREND;
        get_relevant_object_attributes (file_reference^ (1, size), validation_criteria,
              object_condition, object_type, criteria.mass_storage_class, criteria.file,
              criteria.set_name, volume_condition_list, criteria.volume_list, local_status);
        IF (NOT local_status.normal) OR (object_type <> fsc$goi_catalog_object) OR (object_condition <>
              fsc$space_unavailable) THEN
          criteria.file := original_file_ref^;
          parental_set_name := criteria.set_name;
          get_relevant_object_attributes (original_file_ref^, validation_criteria, object_condition,
                object_type, criteria.mass_storage_class, ignore_resolved_path, criteria.set_name,
                volume_condition_list, criteria.volume_list, local_status);
          IF (NOT local_status.normal) OR (criteria.mass_storage_class = rmc$unspecified_file_class) THEN
            {
            { This covers the case of an attempted creation when a space
            { unavailable condition occurs.  This implies there is no volume
            { of the class to which the object can be assigned.  This is
            { different than the condition that occurs on catalog expansion
            { when out of space.
            {
            set_defaults_from_path (pf_path);
            IF criteria.set_name = osc$null_name THEN
              criteria.set_name := parental_set_name;
            IFEND;
          IFEND;
        IFEND;
      IFEND;
    IFEND;

  PROCEND osp$get_file_criteria;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] osp$get_installed_policies', EJECT ??

  PROCEDURE [XDCL, #GATE] osp$get_installed_policies
    (VAR installed_policies {input, output} : ^SEQ ( * );
     VAR sequence_header: ^ost$ecp_header;
     VAR status: ost$status);

   status.normal := TRUE;

   REPEAT
     osp$r3_get_installed_policies (installed_policies, sequence_header, status);
     IF (NOT status.normal) AND (status.condition = ose$exception_policies_locked) THEN
       pmp$wait (one_second, one_second);
     IFEND;
   UNTIL status.normal OR (status.condition <> ose$exception_policies_locked);

  PROCEND osp$get_installed_policies;
?? OLDTITLE ??
?? NEWTITLE := 'osp$get_login_user_criteria', EJECT ??

  PROCEDURE [XDCL, #GATE] osp$get_login_user_criteria
    (VAR criteria: ost$ecp_criteria;
     VAR status: ost$status);

    CONST
      job = 1,
      job_class = 2,
      job_mode = 3,
      login_family = 4,
      login_user = 5;

    VAR
      job_attributes: array [job .. login_user] of jmt$job_attribute_result;

    job_attributes [job].key := jmc$system_job_name;
    job_attributes [job_class].key := jmc$job_class;
    job_attributes [job_mode].key := jmc$job_mode;
    job_attributes [login_family].key := jmc$login_family;
    job_attributes [login_user].key := jmc$login_user;

    jmp$get_job_attributes (^job_attributes, status);

    IF status.normal THEN
      criteria.job := job_attributes [job].system_job_name;
      criteria.job_class := job_attributes [job_class].job_class;
      criteria.job_mode := job_attributes [job_mode].job_mode;
      criteria.login_family := job_attributes [login_family].login_family;
      criteria.login_user := job_attributes [login_user].login_user;
    IFEND;

  PROCEND osp$get_login_user_criteria;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] osp$get_policy', EJECT ??

  PROCEDURE [XDCL, #GATE] osp$get_policy
    (    policy_number: ost$positive_integers;
         policies_sequence_header: ost$ecp_header;
     VAR policy: ^ost$ecp_policy_header);

    VAR
      i: ost$positive_integers;

    policy := NIL;
    IF (policy_number <= policies_sequence_header.number_of_policies) THEN
      IF policy_number = 1 THEN
        policy := policies_sequence_header.first_policy;
      ELSEIF policy_number = policies_sequence_header.number_of_policies THEN
        policy := policies_sequence_header.last_policy;
      ELSE
        policy := policies_sequence_header.first_policy;
        i := 1;
        WHILE (policy <> NIL) AND (i < policy_number) DO
          policy := policy^.next_policy;
          i := i + 1;
        WHILEND;
      IFEND;
    IFEND;

  PROCEND osp$get_policy;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] osp$get_policy_list', EJECT ??

  PROCEDURE [XDCL, #GATE] osp$get_policy_list
    (    policies_sequence_header: ost$ecp_header;
     VAR result: ^clt$data_value;
     VAR work_area {input, output} : ^clt$work_area);

    VAR
      node: ^^clt$data_value,
      policy: ^ost$ecp_policy_header,
      policy_number: ost$non_negative_integers;

    result := NIL;
    node := ^result;

    IF policies_sequence_header.number_of_policies > 0 THEN
      node := ^result;
      policy := policies_sequence_header.first_policy;
      policy_number := 1;
      WHILE policy_number <= policies_sequence_header.number_of_policies DO
        clp$make_list_value (work_area, node^);
        osp$get_policy (policy_number, policies_sequence_header, policy);
        IF policy <> NIL THEN
          make_policy_record (policy, work_area, node^^.element_value);
        ELSE
          RETURN;
        IFEND;
        policy_number := policy_number + 1;
        node := ^node^^.link;
      WHILEND;
    IFEND;

  PROCEND osp$get_policy_list;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] osp$get_union_of_policies', EJECT ??

  PROCEDURE [XDCL, #GATE] osp$get_union_of_policies
    (    policies_sequence_header: ^ost$ecp_header;
     VAR exception_conditions: ost$ecp_conditions;
     VAR policy_criteria: ost$ecp_policy_criteria;
     VAR status: ost$status);

    VAR
      i: ost$ecp_number_of_conditions,
      j: ost$positive_integers,
      number_of_policies: ost$non_negative_integers,
      policy: ^ost$ecp_policy_header,
      single_policy_criteria: ost$ecp_policy_criteria;

    status.normal := TRUE;
    number_of_policies := 0;

    FOR i := 1 TO UPPERBOUND (exception_conditions) DO
      exception_conditions [i] := policy_initialization_record.conditions [i];
    FOREND;

    policy_criteria := $ost$ecp_policy_criteria [];

    IF (policies_sequence_header <> NIL) AND (policies_sequence_header^.first_policy <> NIL) THEN
      policy := policies_sequence_header^.first_policy;
      WHILE (policy <> NIL) AND (number_of_policies <= policies_sequence_header^.number_of_policies) DO
        FOR i := 1 TO UPPERBOUND (exception_conditions) DO
          IF policy^.conditions [i].specified THEN
            IF exception_conditions [i].specified THEN
              exception_conditions [i].actions := exception_conditions [i].actions +
                    policy^.conditions [i].actions;
            ELSE
              exception_conditions [i] := policy^.conditions [i];
            IFEND;
          IFEND;
        FOREND;

        single_policy_criteria := $ost$ecp_policy_criteria [];
        IF policy^.jobs <> NIL THEN
          single_policy_criteria := single_policy_criteria + $ost$ecp_policy_criteria [osc$ecp_jobs];
        IFEND;

        IF policy^.login_users <> NIL THEN
          single_policy_criteria := single_policy_criteria + $ost$ecp_policy_criteria [osc$ecp_login_users];
        IFEND;

        IF policy^.job_mode.specified THEN
          single_policy_criteria := single_policy_criteria + $ost$ecp_policy_criteria [osc$ecp_job_mode];
        IFEND;

        IF policy^.job_classes <> NIL THEN
          single_policy_criteria := single_policy_criteria + $ost$ecp_policy_criteria [osc$ecp_job_classes];
        IFEND;

        IF policy^.files.specified THEN
          IF policy^.files.all_specified THEN
            single_policy_criteria := single_policy_criteria + $ost$ecp_policy_criteria [osc$ecp_all_files];
          ELSE

            FOR j := LOWERBOUND (policy^.files.path_list^) TO UPPERBOUND (policy^.files.path_list^) DO
              IF policy^.files.path_list^ [j].file_reference_type = osc$ecp_generic_reference THEN
                {A reference such as $USER implies scanning all files}
                single_policy_criteria := single_policy_criteria + $ost$ecp_policy_criteria
                      [osc$ecp_all_files];
              IFEND;
            FOREND;
            IF NOT (osc$ecp_all_files IN single_policy_criteria) THEN
              single_policy_criteria := single_policy_criteria +
                    $ost$ecp_policy_criteria [osc$ecp_list_of_files];
            IFEND;
          IFEND;
        IFEND;
        IF policy^.volumes <> NIL THEN
          single_policy_criteria := single_policy_criteria + $ost$ecp_policy_criteria [osc$ecp_volumes];
        IFEND;
        IF policy^.families <> NIL THEN
          single_policy_criteria := single_policy_criteria + $ost$ecp_policy_criteria [osc$ecp_families];
        IFEND;
        IF policy^.sets <> NIL THEN
          single_policy_criteria := single_policy_criteria + $ost$ecp_policy_criteria [osc$ecp_sets];
        IFEND;

        IF policy^.mass_storage_classes.specified THEN
          IF (single_policy_criteria * $ost$ecp_policy_criteria
                [osc$ecp_families, osc$ecp_list_of_files, osc$ecp_sets,
                osc$ecp_volumes]) = $ost$ecp_policy_criteria [] THEN
            {A policy based on mass_storage_classes alone must consider all files}
            single_policy_criteria := single_policy_criteria + $ost$ecp_policy_criteria [osc$ecp_all_files];
          IFEND;
          single_policy_criteria := single_policy_criteria +
                $ost$ecp_policy_criteria [osc$ecp_mass_storage_classes];
        IFEND;

        policy_criteria := policy_criteria + single_policy_criteria;
        policy := policy^.next_policy;
        number_of_policies := number_of_policies + 1;
      WHILEND;
    IFEND;

  PROCEND osp$get_union_of_policies;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] osp$remove_policy', EJECT ??

  PROCEDURE [XDCL, #GATE] osp$remove_policy
    (    policy: ^ost$ecp_policy_header;
     VAR policies_sequence_header {input, output} : ost$ecp_header);

    VAR
      prior_policy: ^ost$ecp_policy_header;

    IF policy <> NIL THEN
      IF policy = policies_sequence_header.first_policy THEN
        policies_sequence_header.first_policy := policy^.next_policy;
        policies_sequence_header.number_of_policies := policies_sequence_header.number_of_policies - 1;
      ELSE
        prior_policy := policies_sequence_header.first_policy;
        WHILE (prior_policy^.next_policy <> NIL) AND (policy <> prior_policy^.next_policy) DO
          prior_policy := prior_policy^.next_policy;
        WHILEND;
        IF (prior_policy^.next_policy <> NIL) THEN
          prior_policy^.next_policy := policy^.next_policy;
          IF policy^.next_policy = NIL THEN
            policies_sequence_header.last_policy := prior_policy;
          IFEND;
          policies_sequence_header.number_of_policies := policies_sequence_header.number_of_policies - 1;
        IFEND;
      IFEND;
    IFEND;

  PROCEND osp$remove_policy;
?? OLDTITLE ??
?? NEWTITLE := 'analyze_policy_coverage', EJECT ??

  PROCEDURE analyze_policy_coverage
    (    exception_policies: ost$ecp_conditions;
     VAR status: ost$status);

    VAR
      i: ost$non_negative_integers,
      ignore_status: ost$status,
      length: integer,
      missing_condition: string (33);

    status.normal := TRUE;

    FOR i := 1 TO UPPERBOUND (exception_policies) DO
      IF NOT exception_policies [i].specified THEN
        IF status.normal THEN
          osp$set_status_condition (ose$condition_not_covered, status);
          osp$append_status_parameter (osc$status_parameter_delimiter,
                policy_initialization_record.conditions [i].exception_name
                (1, clp$trimmed_string_size (policy_initialization_record.conditions [i].exception_name)),
                status);
        ELSE
          STRINGREP (missing_condition, length, ' ', policy_initialization_record.conditions [i].
                exception_name (1, clp$trimmed_string_size (policy_initialization_record.conditions [i].
                exception_name)));
          osp$append_status_parameter (',', missing_condition (1, length), status);
        IFEND;
      IFEND;
    FOREND;

  PROCEND analyze_policy_coverage;
?? OLDTITLE ??
?? NEWTITLE := 'initialize_installed_segment', EJECT ??

  PROCEDURE initialize_installed_segment
    (VAR installed_header: ^ost$ecp_header;
     VAR status: ost$status);

    VAR
      ignore_status: ost$status,
      installed_sequence: amt$segment_pointer,
      local_status: ost$status,
      policy_header: ^ost$ecp_policy_header,
      segment_pointer: amt$segment_pointer;

    mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_sequential, segment_pointer, status);
    IF status.normal THEN
      RESET segment_pointer.sequence_pointer;

      NEXT installed_header IN segment_pointer.sequence_pointer;
      IF installed_header <> NIL THEN
        installed_header^ := header_initialization_record;
        installed_header^.segment_p := segment_pointer;
        installed_header^.last_accessed_policy := 0;
        NEXT policy_header IN segment_pointer.sequence_pointer;
        IF policy_header <> NIL THEN
          RESET installed_header^.segment_p.sequence_pointer TO policy_header;
        IFEND;
      IFEND;

      RESET segment_pointer.sequence_pointer;
      osp$get_installed_policies (segment_pointer.sequence_pointer, installed_header, local_status);
      IF (NOT local_status.normal) AND (local_status.condition <> ose$no_policies_installed) THEN
        osp$generate_output_message (local_status, ignore_status);
      IFEND;
    IFEND;

  PROCEND initialize_installed_segment;
?? OLDTITLE ??
?? NEWTITLE := 'initialize_session_segment', EJECT ??

  PROCEDURE initialize_session_segment
    (VAR session_header: ^ost$ecp_header;
     VAR status: ost$status);

    VAR
      policy_header: ^ost$ecp_policy_header,
      segment_pointer: amt$segment_pointer;

    mmp$create_scratch_segment (amc$sequence_pointer, mmc$as_sequential, segment_pointer, status);
    IF status.normal THEN
      RESET segment_pointer.sequence_pointer;

      NEXT session_header IN segment_pointer.sequence_pointer;
      IF session_header <> NIL THEN
        session_header^ := header_initialization_record;
        session_header^.segment_p := segment_pointer;
        session_header^.last_accessed_policy := 0;
        NEXT policy_header IN segment_pointer.sequence_pointer;
        IF policy_header <> NIL THEN
          RESET session_header^.segment_p.sequence_pointer TO policy_header;
        IFEND;
      IFEND;
    IFEND;
  PROCEND initialize_session_segment;
?? OLDTITLE ??
?? NEWTITLE := 'install_exception_policies', EJECT ??

  PROCEDURE install_exception_policies
    (    session_policies: ^SEQ ( * );
     VAR status: ost$status);

   status.normal := TRUE;

   REPEAT
     osp$r3_install_exception_policy (session_policies, status);
     IF (NOT status.normal) AND (status.condition = ose$exception_policies_locked) THEN
       pmp$wait (one_second, one_second);
     IFEND;
   UNTIL status.normal OR (status.condition <> ose$exception_policies_locked);

  PROCEND install_exception_policies;
?? OLDTITLE ??
?? NEWTITLE := 'make_policy_record', EJECT ??

  PROCEDURE make_policy_record
    (    policy: ^ost$ecp_policy_header;
     VAR work_area {input, output} : ^clt$work_area;
     VAR result: ^clt$data_value);


?? NEWTITLE := 'make_condition_fields', EJECT ??

    PROCEDURE make_condition_fields;

      VAR
        condition: ost$ecp_number_of_conditions,
        node: ^^clt$data_value;

?? NEWTITLE := 'make_condition_value', EJECT ??

      PROCEDURE make_condition_value
        (    condition: ost$ecp_number_of_conditions);

        VAR
          j: ost$ecp_action;

        IF policy^.conditions [condition].specified THEN
          IF policy^.conditions [condition].actions = $ost$ecp_actions [osc$ecp_exit] THEN
            clp$make_keyword_value (action_names [osc$ecp_exit], work_area, node^);
          ELSEIF policy^.conditions [condition].actions = $ost$ecp_actions [osc$ecp_wait] THEN
            clp$make_keyword_value (action_names [osc$ecp_wait], work_area, node^);
          ELSEIF (fsc$catalog_volume_unavailable IN policy^.conditions [condition].file_access_conditions) AND
                (osc$ecp_delete IN policy^.conditions [condition].actions) THEN
            clp$make_keyword_value (action_names [osc$ecp_delete], work_area, node^);
          ELSE
            FOR j := osc$ecp_delete TO osc$ecp_set_damage_condition DO
              IF j IN policy^.conditions [condition].actions THEN
                clp$make_list_value (work_area, node^);
                clp$make_keyword_value (action_names [j], work_area, node^^.element_value);
                node := ^node^^.link;
              IFEND;
            FOREND;
          IFEND;
        ELSE
          clp$make_unspecified_value (work_area, node^);
        IFEND;

      PROCEND make_condition_value;
?? OLDTITLE, EJECT ??

      FOR condition := 1 TO UPPERBOUND (policy^.conditions) DO
        node := ^result^.field_values^ [$INTEGER (policy^.conditions [condition].exception_ordinal)].value;
        result^.field_values^ [$INTEGER (policy^.conditions [condition].exception_ordinal)].
              name := policy^.conditions [condition].exception_name;
        make_condition_value (condition);
      FOREND;

    PROCEND make_condition_fields;
?? OLDTITLE ??
?? NEWTITLE := 'make_files_field', EJECT ??

    PROCEDURE make_files_field;

      VAR
        i: ost$positive_integers,
        node: ^^clt$data_value;

      node := ^result^.field_values^ [$INTEGER (osc$fp_files)].value;
      result^.field_values^ [$INTEGER (osc$fp_files)].name := function_field_names [osc$fp_files];

      IF policy^.files.specified THEN
        IF policy^.files.all_specified THEN
          clp$make_keyword_value (all_keyword, work_area, node^);
        ELSEIF policy^.files.path_list <> NIL THEN
          FOR i := 1 TO UPPERBOUND (policy^.files.path_list^) DO
            clp$make_list_value (work_area, node^);
            clp$make_file_value (policy^.files.path_list^ [i].path^, work_area, node^^.element_value);
            node := ^node^^.link;
          FOREND;
        IFEND;
      ELSE
        clp$make_unspecified_value (work_area, node^);
      IFEND;

    PROCEND make_files_field;
?? OLDTITLE ??
?? NEWTITLE := 'make_job_mode_field', EJECT ??

    PROCEDURE make_job_mode_field;

      VAR
        i: ost$positive_integers,
        node: ^^clt$data_value;

      node := ^result^.field_values^ [$INTEGER (osc$fp_job_mode)].value;
      result^.field_values^ [$INTEGER (osc$fp_job_mode)].name := function_field_names [osc$fp_job_mode];

      IF policy^.job_mode.specified THEN
        IF policy^.job_mode.value = jmc$batch THEN
          clp$make_keyword_value (batch, work_area, node^);
        ELSE
          clp$make_keyword_value (interactive, work_area, node^);
        IFEND;
      ELSE
        clp$make_unspecified_value (work_area, node^);
      IFEND;

    PROCEND make_job_mode_field;
?? OLDTITLE ??
?? NEWTITLE := 'make_login_users_field', EJECT ??

    PROCEDURE make_login_users_field;

      CONST
        login_user_field_count = 4;

      VAR
        i: ost$positive_integers,
        j: ost$ecp_specified_login_field,
        node: ^^clt$data_value;

      node := ^result^.field_values^ [$INTEGER (osc$fp_login_users)].value;
      result^.field_values^ [$INTEGER (osc$fp_login_users)].name := function_field_names [osc$fp_login_users];

      IF policy^.login_users <> NIL THEN
        FOR i := 1 TO UPPERBOUND (policy^.login_users^) DO
          clp$make_list_value (work_area, node^);
          clp$make_record_value (login_user_field_count, work_area, node^^.element_value);
          FOR j := osc$lu_user_name TO osc$lu_job_mode DO
            node^^.element_value^.field_values^ [$INTEGER (j) + 1].name := login_users_names [j];
            IF j IN policy^.login_users^ [i].specified_fields THEN
              CASE j OF
              = osc$lu_user_name =
                clp$make_name_value (policy^.login_users^ [i].user_name, work_area,
                      node^^.element_value^.field_values^ [$INTEGER (j) + 1].value);
              = osc$lu_family_name =
                clp$make_name_value (policy^.login_users^ [i].family_name, work_area,
                      node^^.element_value^.field_values^ [$INTEGER (j) + 1].value);
              = osc$lu_job_class =
                clp$make_name_value (policy^.login_users^ [i].job_class, work_area,
                      node^^.element_value^.field_values^ [$INTEGER (j) + 1].value);
              = osc$lu_job_mode =
                IF policy^.login_users^ [i].job_mode = jmc$batch THEN
                  clp$make_keyword_value (batch, work_area, node^^.element_value^.
                        field_values^ [$INTEGER (j) + 1].value);
                ELSE
                  clp$make_keyword_value (interactive, work_area, node^^.element_value^.
                        field_values^ [$INTEGER (j) + 1].value);
                IFEND;
              ELSE
              CASEND;
            ELSE
              clp$make_unspecified_value (work_area, node^^.element_value^.field_values^ [$INTEGER (j) +
                    1].value);
            IFEND;
          FOREND;
          node := ^node^^.link;
        FOREND;
      ELSE
        clp$make_unspecified_value (work_area, node^);
      IFEND;

    PROCEND make_login_users_field;
?? OLDTITLE ??
?? NEWTITLE := 'make_ms_classes_field', EJECT ??

    PROCEDURE make_ms_classes_field;

      VAR
        i: 'B' .. 'Z',
        node: ^^clt$data_value,
        string1: string (1);

      node := ^result^.field_values^ [$INTEGER (osc$fp_mass_storage_classes)].value;
      result^.field_values^ [$INTEGER (osc$fp_mass_storage_classes)].
            name := function_field_names [osc$fp_mass_storage_classes];

      IF policy^.mass_storage_classes.specified THEN
        FOR i := 'B' TO 'Z' DO
          IF i IN policy^.mass_storage_classes.value THEN
            clp$make_list_value (work_area, node^);
            #UNCHECKED_CONVERSION (i, string1);
            clp$make_name_value (string1, work_area, node^^.element_value);
            node := ^node^^.link;
          IFEND;
        FOREND;
      ELSE
        clp$make_unspecified_value (work_area, node^);
      IFEND;

    PROCEND make_ms_classes_field;
?? OLDTITLE ??
?? NEWTITLE := 'make_name_field', EJECT ??

    PROCEDURE make_name_field
      (    field_number: ost$ecp_function_param_ordinal;
           name_array: ^ost$ecp_name_list);

      VAR
        i: ost$positive_integers,
        node: ^^clt$data_value;

      node := ^result^.field_values^ [$INTEGER (field_number)].value;
      result^.field_values^ [$INTEGER (field_number)].name := function_field_names [field_number];

      IF name_array <> NIL THEN
        FOR i := 1 TO UPPERBOUND (name_array^) DO
          clp$make_list_value (work_area, node^);
          clp$make_name_value (name_array^ [i], work_area, node^^.element_value);
          node := ^node^^.link;
        FOREND;
      ELSE
        clp$make_unspecified_value (work_area, node^);
      IFEND;

    PROCEND make_name_field;
?? OLDTITLE ??
?? NEWTITLE := 'make_poll_frequency_field', EJECT ??

    PROCEDURE make_poll_frequency_field;

      VAR
        node: ^^clt$data_value;

      node := ^result^.field_values^ [$INTEGER (osc$fp_polling_frequency)].value;
      result^.field_values^ [$INTEGER (osc$fp_polling_frequency)].name := polling_frequency_name;

      IF policy^.polling_frequency.specified THEN
        clp$make_integer_value (policy^.polling_frequency.value, {radix} 10, {radix_specified} FALSE,
              work_area, node^);
      ELSE
        clp$make_unspecified_value (work_area, node^);
      IFEND;

    PROCEND make_poll_frequency_field;
?? OLDTITLE ??
?? NEWTITLE := 'make_volumes_field', EJECT ??

    PROCEDURE make_volumes_field;

      VAR
        i: ost$positive_integers,
        node: ^^clt$data_value;

      node := ^result^.field_values^ [$INTEGER (osc$fp_volumes)].value;
      result^.field_values^ [$INTEGER (osc$fp_volumes)].name := function_field_names [osc$fp_volumes];

      IF policy^.volumes <> NIL THEN
        FOR i := 1 TO UPPERBOUND (policy^.volumes^) DO
          clp$make_list_value (work_area, node^);
          clp$make_name_value (policy^.volumes^ [i], work_area, node^^.element_value);
          node := ^node^^.link;
        FOREND;
      ELSE
        clp$make_unspecified_value (work_area, node^);
      IFEND;

    PROCEND make_volumes_field;
?? OLDTITLE, EJECT ??

    result := NIL;
    IF policy <> NIL THEN
      clp$make_record_value (number_of_fields, work_area, result);

      make_name_field (osc$fp_job_classes, policy^.job_classes);
      make_job_mode_field;
      make_name_field (osc$fp_jobs, policy^.jobs);
      make_login_users_field;
      make_name_field (osc$fp_families, policy^.families);
      make_files_field;
      make_ms_classes_field;
      make_name_field (osc$fp_sets, policy^.sets);
      make_volumes_field;
      make_condition_fields;
      make_poll_frequency_field;
    IFEND;

  PROCEND make_policy_record;
?? OLDTITLE ??
?? NEWTITLE := 'make_$applicable_policy', EJECT ??

  PROCEDURE make_$applicable_policy
    (    c_param: ost$positive_integers;
         pvt: clt$parameter_value_table;
         s_param: ost$positive_integers;
     VAR empty_display: boolean;
     VAR result: ^clt$data_value;
     VAR work_area {input, output} : ^clt$work_area;
     VAR status: ost$status);

    VAR
      applicable_policy: ^ost$ecp_policy_header,
      count: clt$list_size,
      criteria: ost$ecp_criteria,
      i: ost$positive_integers,
      ignore_applicable_actions: ost$ecp_actions,
      j: ost$positive_integers,
      jm_name: jmt$name,
      name_node: ^clt$data_value,
      sequence_index: ost$ecp_sequence_index,
      validated_name: jmt$name;

    status.normal := TRUE;
    empty_display := FALSE;
    result := NIL;

    criteria.mass_storage_class := rmc$unspecified_file_class;
    criteria.set_name := osc$null_name;
    criteria.volume_list := NIL;

  /make_result/
    BEGIN
      IF pvt [s_param].value^.keyword_value = 'UTILITY_SESSION' THEN
        sequence_index := osc$ecp_session_policies;
      ELSE
        sequence_index := osc$ecp_installed_policies;
      IFEND;

      FOR i := 1 TO UPPERBOUND (pvt [c_param].value^.field_values^) DO
        IF pvt [c_param].value^.field_values^ [i].name = 'CONDITION' THEN
          IF pvt [c_param].value^.field_values^ [i].value^.keyword_value = 'CATALOG_VOLUME_UNAVAILABLE' THEN
            criteria.condition := fsc$catalog_volume_unavailable;
          ELSEIF pvt [c_param].value^.field_values^ [i].value^.keyword_value = 'CYCLE_BUSY' THEN
            criteria.condition := fsc$cycle_busy;
          ELSEIF pvt [c_param].value^.field_values^ [i].value^.keyword_value =
                'CYCLE_RESTORATION_REQUIRED' THEN
            criteria.condition := fsc$data_restoration_required;
          ELSEIF pvt [c_param].value^.field_values^ [i].value^.keyword_value = 'DATA_RETRIEVAL_REQUIRED' THEN
            criteria.condition := fsc$data_retrieval_required;
          ELSEIF pvt [c_param].value^.field_values^ [i].value^.keyword_value = 'FILE_SERVER_INACTIVE' THEN
            criteria.condition := fsc$file_server_inactive;
          ELSEIF pvt [c_param].value^.field_values^ [i].value^.keyword_value = 'SPACE_UNAVAILABLE' THEN
            criteria.condition := fsc$space_unavailable;
          ELSEIF pvt [c_param].value^.field_values^ [i].value^.keyword_value = 'VOLUME_UNAVAILABLE' THEN
            criteria.condition := fsc$volume_unavailable;
          IFEND;
        ELSEIF pvt [c_param].value^.field_values^ [i].name = 'FAMILY_PATH_NAME' THEN
          criteria.family_path_name := pvt [c_param].value^.field_values^ [i].value^.name_value;
        ELSEIF pvt [c_param].value^.field_values^ [i].name = 'FILE' THEN
          criteria.file := pvt [c_param].value^.field_values^ [i].value^.file_value^;
        ELSEIF pvt [c_param].value^.field_values^ [i].name = job_keyword THEN
          jm_name.kind := jmc$system_supplied_name;
          jm_name.system_supplied_name := pvt [c_param].value^.field_values^ [i].value^.name_value;
          jmp$validate_name (jm_name, validated_name, status);
          IF status.normal THEN
            criteria.job := validated_name.system_supplied_name;
          ELSE
            EXIT /make_result/;
          IFEND;
        ELSEIF pvt [c_param].value^.field_values^ [i].name = job_class_keyword THEN
          criteria.job_class := pvt [c_param].value^.field_values^ [i].value^.name_value;
        ELSEIF pvt [c_param].value^.field_values^ [i].name = job_mode_keyword THEN
          IF pvt [c_param].value^.field_values^ [i].value^.keyword_value = batch THEN
            criteria.job_mode := jmc$batch;
          ELSE {INTERACTIVE}
            criteria.job_mode := jmc$interactive_connected;
          IFEND;
        ELSEIF pvt [c_param].value^.field_values^ [i].name = 'LOGIN_FAMILY' THEN
          criteria.login_family := pvt [c_param].value^.field_values^ [i].value^.name_value;
        ELSEIF pvt [c_param].value^.field_values^ [i].name = 'LOGIN_USER' THEN
          criteria.login_user := pvt [c_param].value^.field_values^ [i].value^.name_value;
        ELSEIF pvt [c_param].value^.field_values^ [i].name = mass_storage_class_keyword THEN
          IF pvt [c_param].value^.field_values^ [i].value^.kind <> clc$unspecified THEN
            #UNCHECKED_CONVERSION (pvt [c_param].value^.field_values^ [i].value^.name_value (1, 1),
                  criteria.mass_storage_class);
          IFEND;
        ELSEIF pvt [c_param].value^.field_values^ [i].name = set_keyword THEN
          IF pvt [c_param].value^.field_values^ [i].value^.kind <> clc$unspecified THEN
            criteria.set_name := pvt [c_param].value^.field_values^ [i].value^.name_value;
          IFEND;
        ELSEIF pvt [c_param].value^.field_values^ [i].name = volumes_keyword THEN
          IF pvt [c_param].value^.field_values^ [i].value^.kind <> clc$unspecified THEN
            count := clp$count_list_elements (pvt [c_param].value^.field_values^ [i].value);
            PUSH criteria.volume_list: [1 .. count];
            IF criteria.volume_list <> NIL THEN
              name_node := pvt [c_param].value^.field_values^ [i].value;
              FOR j := 1 TO count DO
                criteria.volume_list^ [j].external_vsn := name_node^.element_value^.name_value (1, 6);
                criteria.volume_list^ [j].recorded_vsn := name_node^.element_value^.name_value (1, 6);
                name_node := name_node^.link;
              FOREND;
            IFEND;
          IFEND;
        IFEND;
      FOREND;

      osp$find_applicable_policy (criteria, osv$ecp_sequence_headers [sequence_index],
            ignore_applicable_actions, applicable_policy, status);

      IF status.normal AND (applicable_policy <> NIL) THEN
        make_policy_record (applicable_policy, work_area, result);
        IF result = NIL THEN
          osp$set_status_abnormal ('CL', cle$work_area_overflow, '$APPLICABLE_POLICY', status);
        IFEND;
      ELSE
        empty_display := TRUE;
        make_policy_record (^policy_initialization_record, work_area, result);
      IFEND;
    END /make_result/;

  PROCEND make_$applicable_policy;
?? OLDTITLE ??
?? NEWTITLE := 'make_$exception_policies', EJECT ??

  PROCEDURE make_$exception_policies
    (    do_param: ost$positive_integers;
         pvt: clt$parameter_value_table;
         s_param: ost$positive_integers;
     VAR empty_display: boolean;
     VAR result: ^clt$data_value;
     VAR work_area {input, output} : ^clt$work_area;
     VAR status: ost$status);

    VAR
      ending_policy: ost$non_negative_integers,
      node: ^^clt$data_value,
      policy: ^ost$ecp_policy_header,
      policy_number: ost$non_negative_integers,
      sequence_index: ost$ecp_sequence_index,
      starting_policy: ost$non_negative_integers;

    status.normal := TRUE;
    empty_display := FALSE;
    result := NIL;

    IF pvt [s_param].value^.keyword_value = 'UTILITY_SESSION' THEN
      sequence_index := osc$ecp_session_policies;
    ELSE
      sequence_index := osc$ecp_installed_policies;
    IFEND;

    IF osv$ecp_sequence_headers [sequence_index] <> NIL THEN
      IF pvt [do_param].value^.kind = clc$keyword THEN
        IF pvt [do_param].value^.keyword_value = all_keyword THEN
          starting_policy := 1;
          ending_policy := osv$ecp_sequence_headers [sequence_index]^.number_of_policies;
        ELSEIF pvt [do_param].value^.keyword_value = 'FIRST' THEN
          starting_policy := 1;
          ending_policy := 1;
        ELSEIF pvt [do_param].value^.keyword_value = 'NEXT' THEN
          starting_policy := osv$ecp_sequence_headers [sequence_index]^.last_accessed_policy + 1;
          ending_policy := osv$ecp_sequence_headers [sequence_index]^.last_accessed_policy + 1;
        ELSEIF pvt [do_param].value^.keyword_value = 'LAST' THEN
          IF osv$ecp_sequence_headers [sequence_index]^.last_accessed_policy <> 0 THEN
            starting_policy := osv$ecp_sequence_headers [sequence_index]^.last_accessed_policy;
            ending_policy := osv$ecp_sequence_headers [sequence_index]^.last_accessed_policy;
          ELSE
            starting_policy := 1;
            ending_policy := 1;
          IFEND;
        IFEND;
      ELSE {last N, where N is an integer}
        IF pvt [do_param].value^.integer_value.value >= osv$ecp_sequence_headers [sequence_index]^.
              number_of_policies THEN
          starting_policy := 1;
          ending_policy := osv$ecp_sequence_headers [sequence_index]^.number_of_policies;
        ELSE
          starting_policy := (osv$ecp_sequence_headers [sequence_index]^.number_of_policies -
                pvt [do_param].value^.integer_value.value) + 1;
          ending_policy := osv$ecp_sequence_headers [sequence_index]^.number_of_policies;
        IFEND;
      IFEND;

      IF starting_policy > ending_policy THEN
        make_policy_record (^policy_initialization_record, work_area, result);
      ELSEIF (ending_policy - starting_policy) > 0 THEN
        node := ^result;
        policy_number := starting_policy;
        REPEAT
          clp$make_list_value (work_area, node^);
          osp$get_policy (policy_number, osv$ecp_sequence_headers [sequence_index]^, policy);
          IF policy <> NIL THEN
            make_policy_record (policy, work_area, node^^.element_value);
          ELSE
            make_policy_record (^policy_initialization_record, work_area, result);
          IFEND;
          policy_number := policy_number + 1;
          node := ^node^^.link;
        UNTIL (policy_number > ending_policy) OR (policy = NIL);
      ELSE
        osp$get_policy (starting_policy, osv$ecp_sequence_headers [sequence_index]^, policy);
        IF policy <> NIL THEN
          make_policy_record (policy, work_area, result);
        ELSE
          make_policy_record (^policy_initialization_record, work_area, result);
          empty_display := TRUE;
        IFEND;
      IFEND;

      IF result = NIL THEN
        osp$set_status_abnormal ('CL', cle$work_area_overflow, '$EXCEPTION_POLICY', status);
      ELSE
        osv$ecp_sequence_headers [sequence_index]^.last_accessed_policy := ending_policy;
      IFEND;
    ELSE
      make_policy_record (^policy_initialization_record, work_area, result);
      empty_display := TRUE;
    IFEND;
  PROCEND make_$exception_policies;
?? OLDTITLE ??
?? NEWTITLE := 'temporary_file', EJECT ??

  FUNCTION temporary_file
    (    file: fst$file_reference): boolean;

    temporary_file := FALSE;

    IF STRLENGTH (file (2, * )) >= fsc$local_size THEN
      IF file (2, fsc$local_size) = fsc$local THEN
        temporary_file := TRUE;
      IFEND;
    IFEND;

  FUNCEND temporary_file;
?? OLDTITLE ??
MODEND osm$manage_exception_policies;
