?? NEWTITLE := 'NOS/VE Basic Access Method : File Attribute Interfaces' ??
MODULE amm$file_structure_functions;
?? RIGHT := 110 ??

?? NEWTITLE := 'Global Declarations Referenced By This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc oss$job_paged_literal
*copyc fsc$local
*copyc ame$attribute_validation_errors
*copyc ame$ring_validation_errors
*copyc cle$ecc_lexical
*copyc fse$system_conditions
*copyc pfe$error_condition_codes
*copyc pfe$internal_error_conditions
*copyc amt$get_attributes
*copyc fmt$file_attribute_keys
*copyc fmt$static_label_header
*copyc fst$file_reference
*copyc fst$goi_object_information
*copyc ost$caller_identifier
*copyc pft$path
?? POP ??
*copyc i#current_sequence_position
*copyc clf$file_reference_valid
*copyc bap$change_file_attributes
*copyc bap$fetch_art_table_pointer
*copyc bap$get_$local_object_info
*copyc bap$get_default_file_attribs
*copyc bap$merge_static_attributes
*copyc bap$set_file_reference_abnormal
*copyc bap$store_art_table_pointer
*copyc clp$convert_file_ref_to_string
*copyc clp$convert_integer_to_string
*copyc clp$convert_str_to_path_handle
*copyc clp$convert_string_to_file_ref
*copyc clp$get_fs_path_elements
*copyc clp$get_ultimate_connection
*copyc clp$only_validate_name
*copyc clp$trimmed_string_size
*copyc clp$validate_name
*copyc fsp$adjust_tape_defaults
*copyc fsp$close_file
*copyc fsp$determine_access_modes
*copyc fsp$determine_global_access
*copyc fsp$evaluate_file_reference
*copyc fsp$expand_file_label
*copyc fsp$file_is_$job_log
*copyc fsp$open_file
*copyc fsp$set_evaluated_file_abnormal
*copyc fsp$set_file_reference_abnormal
*copyc ifp$get_page_length_width
*copyc osp$append_status_file
*copyc osp$append_status_integer
*copyc osp$append_status_parameter
*copyc osp$copy_local_status_to_status
*copyc osp$disestablish_cond_handler
*copyc osp$enforce_exception_policies
*copyc osp$establish_block_exit_hndlr
*copyc osp$file_access_condition
*copyc osp$generate_log_message
*copyc osp$set_status_abnormal
*copyc osp$set_status_condition
*copyc pfp$r3_get_object_information
*copyc amv$access_mode
*copyc amv$attribute_names
*copyc amv$label_options
*copyc amv$message_control
*copyc amv$nil_file_identifier
*copyc amv$valid_ring
*copyc bav$task_file_table
*copyc fmv$global_file_information
*copyc fmv$system_file_attributes
*copyc fsv$default_job_environ_info
*copyc osv$initial_exception_context
*copyc osv$lower_to_upper
?? OLDTITLE ??
?? NEWTITLE := '[xdcl, #gate] AMP$CHANGE_FILE_ATTRIBUTES', EJECT ??

  PROCEDURE [XDCL, #GATE] amp$change_file_attributes
    (    file: fst$file_reference;
         file_attributes: ^amt$file_attributes;
     VAR status: ost$status);

    CONST
      command_file_reference_allowed = TRUE;

    VAR
      evaluated_file_reference: fst$evaluated_file_reference,
      open_changed_file: boolean;

?? NEWTITLE := 'PROCEDURE open_and_close_file', EJECT ??

    PROCEDURE open_and_close_file;

      VAR
        attachment_options: array [1 .. 2] of fst$attachment_option,
        file_identifier: amt$file_identifier,
        ignore_status: ost$status,
        local_status: ost$status,
        path: fst$path,
        path_size: fst$path_size;

?? NEWTITLE := 'PROCEDURE block_exit_handler', EJECT ??

      PROCEDURE block_exit_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;

        IF file_identifier <> amv$nil_file_identifier THEN
          fsp$close_file (file_identifier, ignore_status);
        IFEND;

      PROCEND block_exit_handler;
?? OLDTITLE, EJECT ??

      attachment_options [1].selector := fsc$access_and_share_modes;
      attachment_options [1].access_modes.selector := fsc$specific_access_modes;
      attachment_options [1].access_modes.value := $fst$file_access_options
            [fsc$read, fsc$modify, fsc$append];
      attachment_options [1].share_modes.selector := fsc$specific_share_modes;
      attachment_options [1].share_modes.value := $fst$file_access_options [];
      attachment_options [2].selector := fsc$open_share_modes;
      attachment_options [2].open_share_modes := $fst$file_access_options [];
      clp$convert_file_ref_to_string (evaluated_file_reference, {include_open_position =} FALSE, path,
            path_size, local_status);
      osp$establish_block_exit_hndlr (^block_exit_handler);
      fsp$open_file (path (1, path_size), amc$record, ^attachment_options, NIL, NIL, NIL, NIL,
            file_identifier, local_status);
      IF file_identifier <> amv$nil_file_identifier THEN
        fsp$close_file (file_identifier, ignore_status);
      IFEND;
      IF NOT local_status.normal THEN
        osp$generate_log_message ($pmt$ascii_logset [pmc$job_log], local_status, ignore_status);
      IFEND;
      osp$disestablish_cond_handler;

    PROCEND open_and_close_file;
?? OLDTITLE, EJECT ??

    VAR
      context: ^ost$ecp_exception_context;

    context := NIL;

    IF file_attributes = NIL THEN
      RETURN; {----->
    IFEND;

    fsp$evaluate_file_reference (file, NOT command_file_reference_allowed, evaluated_file_reference, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

  /change_loop/
    REPEAT
      bap$change_file_attributes (file_attributes, evaluated_file_reference, open_changed_file, status);
      IF NOT status.normal THEN
        IF osp$file_access_condition (status) THEN
          IF context = NIL THEN
            PUSH context;
            context^ := osv$initial_exception_context;
            context^.file.selector := osc$ecp_evaluated_file_ref;
            context^.file.evaluated_file_reference := evaluated_file_reference;
          IFEND;
          context^.condition_status := status;
          osp$enforce_exception_policies (context^);
          status := context^.condition_status;
        ELSEIF status.condition = pfe$tape_attached_on_client THEN
          CYCLE /change_loop/; {----->
        ELSE
          RETURN; {----->
        IFEND;
      IFEND;
    UNTIL status.normal OR (NOT osp$file_access_condition (status)) OR (NOT context^.wait);

    IF open_changed_file THEN
      open_and_close_file;
    IFEND

  PROCEND amp$change_file_attributes;
?? OLDTITLE ??
?? NEWTITLE := '[xdcl, #gate] AMP$FILE', EJECT ??
*copy amh$file

  PROCEDURE [XDCL, #GATE] amp$file
    (    local_file_name: amt$local_file_name;
         file_attributes: amt$file_attributes;
     VAR status: ost$status);

    VAR
      caller_id: ost$caller_identifier,
      name_is_valid: boolean,
      validated_attributes: ^amt$file_attributes,
      validated_name: amt$local_file_name;

    #CALLER_ID (caller_id);
    status.normal := TRUE;

    clp$validate_name (local_file_name, validated_name, name_is_valid);
    IF NOT name_is_valid THEN
      osp$set_status_abnormal (amc$access_method_id, cle$improper_name, local_file_name, status);
      RETURN; {----->
    IFEND;

    PUSH validated_attributes: [1 .. UPPERBOUND (file_attributes)];
    validated_attributes^ := file_attributes;

    amp$validate_attributes (validated_name, amc$file_req, caller_id.ring, validated_attributes, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    bap$store_art_table_pointer (validated_name, validated_attributes, status);

  PROCEND amp$file;
?? TITLE := '[xdcl, #gate] AMP$GET_FILE_ATTRIBUTES', EJECT ??
*copy amh$get_file_attributes

  PROCEDURE [XDCL, #GATE] amp$get_file_attributes
    (    file: fst$file_reference;
     VAR file_attributes: {input/output} amt$get_attributes;
     VAR file_exists: boolean;
     VAR file_previously_opened: boolean;
     VAR contains_data: boolean;
     VAR status: ost$status);

    CONST
      added_space_for_max_label_size = 1012,
      command_file_reference_allowed = TRUE,
      estimated_label_size = 240,
      max_connections = 2, { an optimum estimate for the number of file connections }
      max_volumes = 4096,
      nil_object_info_text = 'NEXT of object_information in work_area resulted in a NIL pointer in ' CAT
            'AMP$GET_FILE_ATTRIBUTES',
      output_path_length = 14;

    VAR
      default_information_request: [oss$job_paged_literal, READ] fst$goi_information_request :=
            [[fsc$specific_depth, 1], [fsc$goi_cycle_size, fsc$goi_file_label]];

    VAR

{ Variables shared with nested procedures

      caller_id: ost$caller_identifier,
      current_status: ost$status,
      cycle_object_p: ^fst$goi_object,
      default_new_retention: fst$retention,
      default_new_retention_specified: boolean,
      device_class: rmt$device_class,
      evaluated_file_reference: fst$evaluated_file_reference,
      file_label_p: ^SEQ ( * ),
      file_object_p: ^fst$goi_object,
      file_request_attributes_p: ^amt$file_attributes,
      information_request: fst$goi_information_request,
      job_environment_information_p: ^fst$job_environment_information,
      number_of_volumes: 1 .. max_volumes,
      object_information_p: ^fst$goi_object_information,
      page_length_width: array [1 .. 2] of ift$terminal_attribute,
      static_label_attributes: bat$static_label_attributes,
      target_device_class: rmt$device_class,
      work_area_p: ^SEQ ( * ),
      work_area_size: integer,

{ Variables local only to the main procedure

      local_file_name: amt$local_file_name,
      name_is_valid: boolean,
      validated_name: amt$local_file_name;

?? NEWTITLE := 'assign_attribute_values', EJECT ??

    PROCEDURE assign_attribute_values;

      VAR
        entry_p: ^amt$get_item,
        i: ost$positive_integers,
        i_string: ^ost$string,
        ignore_status: ^ost$status,
        index: ost$non_negative_integers,
        local_status: ^ost$status,
        request_entry_p: ^amt$file_item,
        shared_queue_name: ost$name;

      FOR i := 1 TO UPPERBOUND (file_attributes) DO
        entry_p := ^file_attributes [i];
        CASE entry_p^.key OF
        = amc$access_mode =
          fsp$determine_access_modes (job_environment_information_p, file_object_p, entry_p^.access_mode,
                entry_p^.source);
          IF (entry_p^.source = amc$access_method_default) AND (object_information_p <> NIL) AND
                fsp$file_is_$job_log (object_information_p^.resolved_path) THEN
            entry_p^.access_mode := $pft$usage_selections [pfc$read, pfc$append];

{ The following assignment is necessary for the connected file fap to determine the appropriate access modes
{ for $JOB_LOG when it is being opened as the target of a file connection.

            entry_p^.source := amc$file_command;
          IFEND;
        = amc$application_info =
          IF (file_object_p = NIL) OR (file_object_p^.applicable_file_permit = NIL) THEN
            entry_p^.application_info := ' ';
          ELSE
            entry_p^.application_info := file_object_p^.applicable_file_permit^.application_info;
          IFEND;
          entry_p^.source := amc$local_file_information;
        = amc$block_type =
          entry_p^.block_type := static_label_attributes.block_type;
          entry_p^.source := static_label_attributes.block_type_source;
        = amc$character_conversion =
          entry_p^.character_conversion := static_label_attributes.character_conversion;
          entry_p^.source := static_label_attributes.character_conversion_source;
        = amc$clear_space =
          entry_p^.clear_space := static_label_attributes.clear_space;
          entry_p^.source := static_label_attributes.clear_space_source;
        = amc$device_class =
          entry_p^.device_class := device_class;
          entry_p^.source := amc$open_request;
        = amc$error_exit_name =
          IF job_environment_information_p = NIL THEN
            entry_p^.error_exit_name := fmv$system_file_attributes.dynamic_label.error_exit_name;
            entry_p^.source := fmv$system_file_attributes.dynamic_label.error_exit_name_source;
          ELSE
            entry_p^.error_exit_name := job_environment_information_p^.error_exit_procedure_name;
            entry_p^.source := job_environment_information_p^.attachment_options_sources.
                  error_exit_name_source;
          IFEND;
        = amc$error_options =
          entry_p^.error_options := fmv$system_file_attributes.dynamic_label.error_options;
          entry_p^.source := fmv$system_file_attributes.dynamic_label.error_options_source;
          IF file_request_attributes_p <> NIL THEN
            index := 0;
            REPEAT
              index := index + 1;
              request_entry_p := ^file_request_attributes_p^ [index];
              IF request_entry_p^.key = amc$error_options THEN
                entry_p^.error_options := request_entry_p^.error_options;
                entry_p^.source := amc$file_request;
              IFEND;
            UNTIL (request_entry_p^.key = amc$error_options) OR
                  (index = UPPERBOUND (file_request_attributes_p^));
          IFEND;
        = amc$file_access_procedure =
          entry_p^.file_access_procedure := static_label_attributes.file_access_procedure;
          entry_p^.source := static_label_attributes.file_access_procedure_source;
        = amc$file_contents =
          entry_p^.file_contents := static_label_attributes.file_contents;
          entry_p^.source := static_label_attributes.file_contents_source;
        = amc$file_length =
          IF (cycle_object_p = NIL) OR (cycle_object_p^.cycle_size = NIL) THEN
            entry_p^.file_length := 0;
          ELSE
            entry_p^.file_length := cycle_object_p^.cycle_size^;
          IFEND;
          entry_p^.source := amc$local_file_information;
        = amc$file_limit =
          entry_p^.file_limit := static_label_attributes.file_limit;
          entry_p^.source := static_label_attributes.file_limit_source;
        = amc$file_organization =
          entry_p^.file_organization := static_label_attributes.file_organization;
          entry_p^.source := static_label_attributes.file_organization_source;
        = amc$file_processor =
          entry_p^.file_processor := static_label_attributes.file_processor;
          entry_p^.source := static_label_attributes.file_processor_source;
        = amc$file_structure =
          entry_p^.file_structure := static_label_attributes.file_structure;
          entry_p^.source := static_label_attributes.file_structure_source;
        = amc$forced_write =
          entry_p^.forced_write := static_label_attributes.forced_write;
          entry_p^.source := static_label_attributes.forced_write_source;
        = amc$global_access_mode =
          fsp$determine_global_access (caller_id.ring, job_environment_information_p, file_object_p,
                cycle_object_p, static_label_attributes.ring_attributes, entry_p^.global_access_mode);
          entry_p^.source := amc$local_file_information;
        = amc$global_file_address =
          IF job_environment_information_p = NIL THEN
            entry_p^.global_file_address := 0;
          ELSE
            entry_p^.global_file_address := job_environment_information_p^.job_file_address;
          IFEND;
          entry_p^.source := amc$local_file_information;
        = amc$global_file_name =
          IF cycle_object_p = NIL THEN
            entry_p^.global_file_name := fmv$system_file_attributes.descriptive_label.global_file_name;
          ELSE
            entry_p^.global_file_name := cycle_object_p^.cycle_global_file_name;
          IFEND;
          entry_p^.source := amc$local_file_information;
        = amc$global_file_position =
          IF job_environment_information_p = NIL THEN
            entry_p^.global_file_position := amc$boi;
          ELSE
            entry_p^.global_file_position := job_environment_information_p^.job_file_position;
          IFEND;
          entry_p^.source := amc$local_file_information;
        = amc$global_share_mode =
          IF (job_environment_information_p <> NIL) AND job_environment_information_p^.cycle_attached THEN
            #UNCHECKED_CONVERSION (job_environment_information_p^.attached_share_modes,
                  entry_p^.global_share_mode);
          ELSEIF (file_object_p <> NIL) AND (file_object_p^.applicable_file_permit <> NIL) THEN
            IF (cycle_object_p <> NIL) AND (cycle_object_p^.cycle_information <> NIL) THEN
              entry_p^.global_share_mode := file_object_p^.applicable_file_permit^.share_requirements +
                    cycle_object_p^.cycle_information^.outstanding_access_modes;
            ELSE
              entry_p^.global_share_mode := file_object_p^.applicable_file_permit^.share_requirements;
            IFEND;
          ELSE
            entry_p^.global_share_mode := fmv$system_file_attributes.descriptive_label.global_share_mode;
          IFEND;
          entry_p^.source := amc$local_file_information;
        = amc$internal_code =
          entry_p^.internal_code := static_label_attributes.internal_code;
          entry_p^.source := static_label_attributes.internal_code_source;
        = amc$label_exit_name =
          IF job_environment_information_p = NIL THEN
            entry_p^.label_exit_name := fmv$system_file_attributes.dynamic_label.label_exit_name;
            entry_p^.source := fmv$system_file_attributes.dynamic_label.label_exit_name_source;
          ELSE
            entry_p^.label_exit_name := job_environment_information_p^.label_exit_procedure_name;
            entry_p^.source := job_environment_information_p^.attachment_options_sources.
                  label_exit_name_source;
          IFEND;
        = amc$label_options =
          entry_p^.label_options := fmv$system_file_attributes.dynamic_label.label_options;
          entry_p^.source := fmv$system_file_attributes.dynamic_label.label_options_source;
        = amc$label_type =
          entry_p^.label_type := static_label_attributes.label_type;
          entry_p^.source := static_label_attributes.label_type_source;
        = amc$line_number =
          entry_p^.line_number := static_label_attributes.line_number;
          entry_p^.source := static_label_attributes.line_number_source;
        = amc$max_block_length =
          entry_p^.max_block_length := static_label_attributes.max_block_length;
          entry_p^.source := static_label_attributes.max_block_length_source;
        = amc$max_record_length =
          entry_p^.max_record_length := static_label_attributes.max_record_length;
          entry_p^.source := static_label_attributes.max_record_length_source;
        = amc$min_block_length =
          entry_p^.min_block_length := static_label_attributes.min_block_length;
          entry_p^.source := static_label_attributes.min_block_length_source;
        = amc$min_record_length =
          entry_p^.min_record_length := static_label_attributes.min_record_length;
          entry_p^.source := static_label_attributes.min_record_length_source;
        = amc$null_attribute =
          ;
        = amc$open_position =
          IF (job_environment_information_p = NIL) OR (job_environment_information_p^.
                attachment_options_sources.open_position_source = amc$access_method_default) THEN
            IF (object_information_p <> NIL) AND (STRLENGTH (object_information_p^.resolved_path^) >=
                  output_path_length) AND (object_information_p^.resolved_path^ (1, 14) =
                  ':$LOCAL.OUTPUT') THEN
              entry_p^.open_position := amc$open_at_eoi;
              entry_p^.source := amc$access_method_default;
            ELSEIF evaluated_file_reference.path_handle_info.path_handle.open_position.specified THEN
              entry_p^.open_position := evaluated_file_reference.path_handle_info.path_handle.open_position.
                    value;
              entry_p^.source := amc$file_reference;
            ELSE
              entry_p^.open_position := fmv$system_file_attributes.dynamic_label.open_position;
              entry_p^.source := amc$access_method_default;
            IFEND;
          ELSEIF evaluated_file_reference.path_handle_info.path_handle.open_position.specified AND
                (job_environment_information_p^.attachment_options_sources.open_position_source >
                amc$file_reference) THEN
            entry_p^.open_position := evaluated_file_reference.path_handle_info.path_handle.open_position.
                  value;
            entry_p^.source := amc$file_reference;
          ELSE
            entry_p^.open_position := job_environment_information_p^.open_position;
            entry_p^.source := job_environment_information_p^.attachment_options_sources.open_position_source;
          IFEND;
        = amc$padding_character =
          entry_p^.padding_character := static_label_attributes.padding_character;
          entry_p^.source := static_label_attributes.padding_character_source;
        = amc$page_format =
          entry_p^.page_format := static_label_attributes.page_format;
          entry_p^.source := static_label_attributes.page_format_source;
        = amc$page_length =
          IF ((device_class = rmc$terminal_device) OR ((device_class = rmc$connected_file_device) AND
                (target_device_class = rmc$terminal_device))) AND
                (static_label_attributes.page_length_source = amc$access_method_default) THEN
            IF page_length_width [1].page_length = 0 THEN
              entry_p^.page_length := UPPERVALUE (amt$page_length);
            ELSE
              entry_p^.page_length := page_length_width [1].page_length;
            IFEND;
          ELSE
            entry_p^.page_length := static_label_attributes.page_length;
          IFEND;
          entry_p^.source := static_label_attributes.page_length_source;
        = amc$page_width =
          IF ((device_class = rmc$terminal_device) OR ((device_class = rmc$connected_file_device) AND
                (target_device_class = rmc$terminal_device))) AND
                (static_label_attributes.page_width_source = amc$access_method_default) THEN
            IF page_length_width [2].page_width = 0 THEN
              entry_p^.page_width := amc$max_page_width;
            ELSE
              entry_p^.page_width := page_length_width [2].page_width;
            IFEND;
          ELSE
            entry_p^.page_width := static_label_attributes.page_width;
          IFEND;
          entry_p^.source := static_label_attributes.page_width_source;
        = amc$permanent_file =
          entry_p^.permanent_file := fsp$path_element (^evaluated_file_reference, 1) ^ <> fsc$local;
          entry_p^.source := amc$local_file_information;
        = amc$preset_value =
          entry_p^.preset_value := static_label_attributes.preset_value;
          entry_p^.source := static_label_attributes.preset_value_source;
        = amc$private_read =
          IF (job_environment_information_p <> NIL) AND job_environment_information_p^.private_read.
                specified_on_attach THEN
            entry_p^.private_read := job_environment_information_p^.private_read.value;
            entry_p^.source := amc$file_command;
          ELSE
            entry_p^.private_read := FALSE;
            entry_p^.source := amc$undefined_attribute;
          IFEND;
        = amc$record_delimiting_character =
          entry_p^.record_delimiting_character := static_label_attributes.record_delimiting_character;
          entry_p^.source := static_label_attributes.record_delimiting_char_source;
        = amc$record_type =
          entry_p^.record_type := static_label_attributes.record_type;
          entry_p^.source := static_label_attributes.record_type_source;
        = amc$return_option =
          entry_p^.return_option := fmv$system_file_attributes.dynamic_label.return_option;
          entry_p^.source := fmv$system_file_attributes.dynamic_label.return_option_source;
          IF file_request_attributes_p <> NIL THEN
            index := 0;
            REPEAT
              index := index + 1;
              request_entry_p := ^file_request_attributes_p^ [index];
              IF request_entry_p^.key = amc$return_option THEN
                entry_p^.return_option := request_entry_p^.return_option;
                entry_p^.source := amc$file_request;
              IFEND;
            UNTIL (request_entry_p^.key = amc$return_option) OR
                  (index = UPPERBOUND (file_request_attributes_p^));
          IFEND;
        = amc$ring_attributes =
          entry_p^.ring_attributes := static_label_attributes.ring_attributes;
          entry_p^.source := static_label_attributes.ring_attributes_source;
        = amc$shared_queue =
          IF (cycle_object_p <> NIL) AND (cycle_object_p^.cycle_device_information <> NIL) AND
                (cycle_object_p^.cycle_device_class = rmc$mass_storage_device) THEN
            entry_p^.shared_queue := cycle_object_p^.cycle_device_information^.mass_storage_device_info.
                  shared_queue;
            entry_p^.source := amc$local_file_information;
          ELSE
            entry_p^.shared_queue := osc$null_name;
            entry_p^.source := amc$undefined_attribute;
          IFEND;
        = amc$statement_identifier =
          entry_p^.statement_identifier := static_label_attributes.statement_identifier;
          entry_p^.source := static_label_attributes.statement_identifier_source;
        = amc$user_info =
          entry_p^.user_info := static_label_attributes.user_info;
          entry_p^.source := static_label_attributes.user_info_source;
        = amc$vertical_print_density =
          entry_p^.vertical_print_density := static_label_attributes.vertical_print_density;
          entry_p^.source := static_label_attributes.vertical_print_density_source;

{ aam

        = amc$average_record_length =
          entry_p^.average_record_length := static_label_attributes.average_record_length;
          entry_p^.source := static_label_attributes.average_record_length_source;
        = amc$collate_table_name =
          entry_p^.collate_table_name := static_label_attributes.collate_table_name;
          entry_p^.source := static_label_attributes.collate_table_name_source;
        = amc$compression_procedure_name =
          IF entry_p^.compression_procedure_name <> NIL THEN
            entry_p^.compression_procedure_name^ := static_label_attributes.compression_procedure_name;
            entry_p^.source := static_label_attributes.compression_proc_name_source;
          IFEND;
        = amc$data_padding =
          entry_p^.data_padding := static_label_attributes.data_padding;
          entry_p^.source := static_label_attributes.data_padding_source;
        = amc$dynamic_home_block_space =
          entry_p^.dynamic_home_block_space := static_label_attributes.dynamic_home_block_space;
          entry_p^.source := static_label_attributes.dynamic_home_block_space_source;
        = amc$embedded_key =
          entry_p^.embedded_key := static_label_attributes.embedded_key;
          entry_p^.source := static_label_attributes.embedded_key_source;
        = amc$error_limit =
          IF job_environment_information_p = NIL THEN
            entry_p^.error_limit := fmv$system_file_attributes.dynamic_label.error_limit;
            entry_p^.source := fmv$system_file_attributes.dynamic_label.error_limit_source;
          ELSE
            entry_p^.error_limit := job_environment_information_p^.error_limit;
            entry_p^.source := job_environment_information_p^.attachment_options_sources.error_limit_source;
          IFEND;
        = amc$estimated_record_count =
          entry_p^.estimated_record_count := static_label_attributes.estimated_record_count;
          entry_p^.source := static_label_attributes.estimated_record_count_source;
        = amc$hashing_procedure_name =
          IF entry_p^.hashing_procedure_name <> NIL THEN
            entry_p^.hashing_procedure_name^ := static_label_attributes.hashing_procedure_name;
            entry_p^.source := static_label_attributes.hashing_procedure_name_source;
          IFEND;
        = amc$index_levels =
          entry_p^.index_levels := static_label_attributes.index_levels;
          entry_p^.source := static_label_attributes.index_levels_source;
        = amc$index_padding =
          entry_p^.index_padding := static_label_attributes.index_padding;
          entry_p^.source := static_label_attributes.index_padding_source;
        = amc$initial_home_block_count =
          entry_p^.initial_home_block_count := static_label_attributes.initial_home_block_count;
          entry_p^.source := static_label_attributes.initial_home_block_count_source;
        = amc$key_length =
          entry_p^.key_length := static_label_attributes.key_length;
          entry_p^.source := static_label_attributes.key_length_source;
        = amc$key_position =
          entry_p^.key_position := static_label_attributes.key_position;
          entry_p^.source := static_label_attributes.key_position_source;
        = amc$key_type =
          entry_p^.key_type := static_label_attributes.key_type;
          entry_p^.source := static_label_attributes.key_type_source;
        = amc$loading_factor =
          entry_p^.loading_factor := static_label_attributes.loading_factor;
          entry_p^.source := static_label_attributes.loading_factor_source;
        = amc$lock_expiration_time =
          entry_p^.lock_expiration_time := static_label_attributes.lock_expiration_time;
          entry_p^.source := static_label_attributes.lock_expiration_time_source;
        = amc$logging_options =
          entry_p^.logging_options := static_label_attributes.logging_options;
          entry_p^.source := static_label_attributes.logging_options_source;
        = amc$log_residence =
          IF entry_p^.log_residence <> NIL THEN
            entry_p^.log_residence^ := static_label_attributes.log_residence;
            entry_p^.source := static_label_attributes.log_residence_source;
          IFEND;
        = amc$message_control =
          IF job_environment_information_p = NIL THEN
            entry_p^.message_control := fmv$system_file_attributes.dynamic_label.message_control;
            entry_p^.source := fmv$system_file_attributes.dynamic_label.message_control_source;
          ELSE
            entry_p^.message_control := job_environment_information_p^.message_control;
            entry_p^.source := job_environment_information_p^.attachment_options_sources.
                  message_control_source;
          IFEND;
        = amc$record_limit =
          entry_p^.record_limit := static_label_attributes.record_limit;
          entry_p^.source := static_label_attributes.record_limit_source;
        = amc$records_per_block =
          entry_p^.records_per_block := static_label_attributes.records_per_block;
          entry_p^.source := static_label_attributes.records_per_block_source;

        ELSE
          IF current_status.normal THEN
            PUSH ignore_status;
            PUSH i_string;
            clp$convert_integer_to_string (i, 10, FALSE, i_string^, ignore_status^);
            fsp$set_evaluated_file_abnormal (evaluated_file_reference, ame$improper_file_attrib_key,
                  amc$get_file_attributes_req, 'FILE_ATTRIBUTES', current_status);
            osp$append_status_parameter (osc$status_parameter_delimiter, i_string^.value (1, i_string^.size),
                  current_status);
          ELSE
            clp$convert_integer_to_string (i, 10, FALSE, i_string^, ignore_status^);
            osp$append_status_parameter (',', i_string^.value (1, i_string^.size), current_status);
          IFEND;
        CASEND;
      FOREND;

    PROCEND assign_attribute_values;

?? TITLE := 'get_connected_file_attributes', EJECT ??

    PROCEDURE get_connected_file_attributes
      (VAR status: ost$status);

      VAR
        path_handle_name: fst$path_handle_name,
        target_handle_name: fst$path_handle_name,
        target_object_information_p: ^fst$goi_object_information;

      clp$convert_str_to_path_handle (object_information_p^.resolved_path^, TRUE {delete_allowed} , FALSE
            {resolve_path} , FALSE {include_open_pos_in_handle} , path_handle_name, evaluated_file_reference,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      clp$get_ultimate_connection (path_handle_name, target_handle_name, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;

      IF path_handle_name <> target_handle_name THEN { target file found }
        clp$get_fs_path_elements (target_handle_name, evaluated_file_reference, status);
        IF NOT status.normal THEN
          RETURN; {----->
        IFEND;

        REPEAT
          get_object_information (status);
          IF NOT status.normal THEN
            IF status.condition = pfe$info_full THEN
              IF ($fst$goi_object_info_requests [fsc$goi_cycle_device_info,
                    fsc$goi_job_environment_info] * information_request.object_information_requests) =
                    $fst$goi_object_info_requests [] THEN
                work_area_size := work_area_size + added_space_for_max_label_size;
              ELSEIF number_of_volumes <= max_volumes THEN
                number_of_volumes := number_of_volumes * 4;
                IF fsc$goi_job_environment_info IN information_request.object_information_requests THEN
                  work_area_size := work_area_size + (2 * number_of_volumes * #SIZE (rmt$volume_descriptor));
                ELSE
                  work_area_size := work_area_size + (number_of_volumes * #SIZE (rmt$volume_descriptor));
                IFEND;
              ELSE
                RETURN; {----->
              IFEND;

{NOTE: We push a structure of the caller, here! Caller must not use the structure anymore!

              PUSH work_area_p: [[REP work_area_size OF cell]];
            ELSE
              RETURN; {----->
            IFEND;
          IFEND;
        UNTIL status.normal;

        RESET work_area_p;
        NEXT target_object_information_p IN work_area_p;
        IF target_object_information_p = NIL THEN
          osp$set_status_abnormal (amc$access_method_id, fse$system_error, nil_object_info_text, status);
          RETURN; {----->
        IFEND;

        IF target_object_information_p^.object^.object_type = fsc$goi_file_object THEN
          IF target_object_information_p^.object^.cycle_object_list = NIL THEN
            file_label_p := NIL;
          ELSE
            target_device_class := target_object_information_p^.object^.cycle_object_list^ [1].
                  cycle_device_class;
            contains_data := ((target_object_information_p^.object^.cycle_object_list^ [1].
                  cycle_size <> NIL) AND (target_object_information_p^.object^.cycle_object_list^ [1].
                  cycle_size^ > 0)) OR (device_class = rmc$magnetic_tape_device);
            file_label_p := target_object_information_p^.object^.cycle_object_list^ [1].file_label;
          IFEND;
        ELSEIF target_object_information_p^.object^.object_type = fsc$goi_cycle_object THEN
          target_device_class := target_object_information_p^.object^.cycle_device_class;
          contains_data := ((target_object_information_p^.object^.cycle_size <> NIL) AND
                (target_object_information_p^.object^.cycle_size^ > 0)) OR
                (device_class = rmc$magnetic_tape_device);
          file_label_p := target_object_information_p^.object^.file_label;
        IFEND;

      IFEND; {path_handle_name <> target_handle_name}

    PROCEND get_connected_file_attributes;

?? TITLE := 'get_object_information', EJECT ??

    PROCEDURE get_object_information
      (VAR status: ost$status);

      VAR
        context: ^ost$ecp_exception_context;

      context := NIL;

    /getoi_loop/
      REPEAT
        RESET work_area_p;

        IF fsp$path_element (^evaluated_file_reference, 1) ^ = fsc$local THEN
          bap$get_$local_object_info (evaluated_file_reference, information_request, work_area_p, status);
        ELSE
          pfp$r3_get_object_information (evaluated_file_reference, information_request, NIL, work_area_p,
                status);
        IFEND;
        IF NOT status.normal THEN
          IF osp$file_access_condition (status) THEN
            IF context = NIL THEN
              PUSH context;
              context^ := osv$initial_exception_context;
              context^.file.selector := osc$ecp_evaluated_file_ref;
              context^.file.evaluated_file_reference := evaluated_file_reference;
            IFEND;
            context^.condition_status := status;
            osp$enforce_exception_policies (context^);
            status := context^.condition_status;
          ELSEIF status.condition = pfe$tape_attached_on_client THEN
            CYCLE /getoi_loop/; {----->
          ELSE
            RETURN; {----->
          IFEND;
        IFEND;
      UNTIL status.normal OR (NOT osp$file_access_condition (status)) OR (NOT context^.wait);

    PROCEND get_object_information;

?? TITLE := 'merge_amp$file_requests', EJECT ??

    PROCEDURE merge_amp$file_requests
      (VAR status: ost$status);

      job_environment_information_p^ := fsv$default_job_environ_info;
      merge_dynamic_requests (file_request_attributes_p, job_environment_information_p);
      bap$get_default_file_attribs (static_label_attributes, default_new_retention_specified,
            default_new_retention, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      bap$merge_static_attributes (evaluated_file_reference, file_request_attributes_p,
            static_label_attributes, status);
      IF status.normal THEN
        object_information_p := NIL;
        file_object_p := NIL;
        cycle_object_p := NIL;
        assign_attribute_values;
      IFEND;

    PROCEND merge_amp$file_requests;

?? TITLE := 'preprocess_attribute_requests', EJECT ??

    PROCEDURE [inline] preprocess_attribute_requests;

      VAR
        i: ost$positive_integers;

      FOR i := 1 TO UPPERBOUND (file_attributes) DO
        CASE file_attributes [i].key OF
        = amc$access_mode =
          information_request.object_information_requests :=
                information_request.object_information_requests +
                $fst$goi_object_info_requests [fsc$goi_applicable_file_permit, fsc$goi_job_environment_info];

        = amc$application_info =
          information_request.object_information_requests :=
                information_request.object_information_requests +
                $fst$goi_object_info_requests [fsc$goi_applicable_file_permit];

        = amc$error_exit_name, amc$error_limit, amc$label_exit_name, amc$message_control, amc$open_position,
              amc$global_file_address, amc$global_file_position, amc$private_read =
          information_request.object_information_requests :=
                information_request.object_information_requests +
                $fst$goi_object_info_requests [fsc$goi_job_environment_info];

        = amc$global_access_mode, amc$global_share_mode =
          information_request.object_information_requests :=
                information_request.object_information_requests +
                $fst$goi_object_info_requests [fsc$goi_applicable_file_permit, fsc$goi_job_environment_info,
                fsc$goi_cycle_info];

        = amc$global_file_name =
          information_request.object_information_requests :=
                information_request.object_information_requests +
                $fst$goi_object_info_requests [fsc$goi_cycle_identity];

        = amc$label_type, amc$max_block_length, amc$shared_queue =
          information_request.object_information_requests :=
                information_request.object_information_requests +
                $fst$goi_object_info_requests [fsc$goi_cycle_device_info];

        ELSE
        CASEND;
      FOREND;

      IF fsc$goi_applicable_file_permit IN information_request.object_information_requests THEN
        work_area_size := work_area_size + #SIZE (fst$goi_object) + #SIZE (pft$permit_array_entry);
      IFEND;
      IF fsc$goi_cycle_device_info IN information_request.object_information_requests THEN
        work_area_size := work_area_size + #SIZE (fst$device_information) +
              (number_of_volumes * #SIZE (rmt$volume_descriptor));
      IFEND;
      IF fsc$goi_cycle_info IN information_request.object_information_requests THEN
        work_area_size := work_area_size + #SIZE (fst$goi_cycle_information);
      IFEND;
      IF fsc$goi_job_environment_info IN information_request.object_information_requests THEN
        work_area_size := work_area_size + #SIZE (fst$job_environment_information) +
              (max_connections * fsc$max_path_size) + (number_of_volumes * #SIZE (rmt$volume_descriptor));
      IFEND;

    PROCEND preprocess_attribute_requests;

?? OLDTITLE, EJECT ??

    #CALLER_ID (caller_id);
    status.normal := TRUE;

    file_exists := FALSE;
    file_previously_opened := FALSE;
    contains_data := FALSE;
    device_class := rmc$mass_storage_device;
    number_of_volumes := 4;

  /get_file_attributes/
    BEGIN

{ The following IF/ELSE/IFEND statement is only for amp$file:

      IF clp$trimmed_string_size (file) <= #SIZE (amt$local_file_name) THEN
        local_file_name := file;
        clp$validate_name (local_file_name, validated_name, name_is_valid);
        IF name_is_valid THEN
          bap$fetch_art_table_pointer (validated_name, file_request_attributes_p);
        ELSE
          file_request_attributes_p := NIL;
        IFEND;
      ELSE
        file_request_attributes_p := NIL;
      IFEND;

{ Pfp$get_object_information cannot be called because of compatibility reasons.  It calls
{ clp$evaluate_file_reference which assumes the current working catalog when given only a name.  However,
{ amp$get_file_attributes must continue to assume $LOCAL as the working catalog. The following call
{ accomplishes that.

      fsp$evaluate_file_reference (file, command_file_reference_allowed, evaluated_file_reference,
            current_status);
      IF NOT current_status.normal THEN
        EXIT /get_file_attributes/; {----->
      IFEND;

      information_request := default_information_request;
      IF evaluated_file_reference.number_of_path_elements < 16 THEN
        work_area_size := #SIZE (fst$goi_object_information) +
              ((evaluated_file_reference.number_of_path_elements * (osc$max_name_size + 1)) + 4
              {period and cycle number} ) + #SIZE (fst$goi_object) + #SIZE (amt$file_byte_address) +
              estimated_label_size;
      ELSE
        work_area_size := #SIZE (fst$goi_object_information) + fsc$max_path_size + #SIZE (fst$goi_object) +
              #SIZE (amt$file_byte_address) + estimated_label_size;
      IFEND;
      preprocess_attribute_requests;

      PUSH work_area_p: [[REP work_area_size OF cell]];

      REPEAT
        get_object_information (current_status);
        IF NOT current_status.normal THEN
          IF current_status.condition = pfe$info_full THEN
            IF ($fst$goi_object_info_requests [fsc$goi_cycle_device_info,
                  fsc$goi_job_environment_info] * information_request.object_information_requests) =
                  $fst$goi_object_info_requests [] THEN
              work_area_size := work_area_size + added_space_for_max_label_size;
            ELSEIF number_of_volumes <= max_volumes THEN
              number_of_volumes := number_of_volumes * 4;
              IF fsc$goi_job_environment_info IN information_request.object_information_requests THEN
                work_area_size := work_area_size + (2 * number_of_volumes * #SIZE (rmt$volume_descriptor));
              ELSE
                work_area_size := work_area_size + (number_of_volumes * #SIZE (rmt$volume_descriptor));
              IFEND;
            ELSE
              EXIT /get_file_attributes/; {----->
            IFEND;
            PUSH work_area_p: [[REP work_area_size OF cell]];
          ELSE
            EXIT /get_file_attributes/; {----->
          IFEND;
        IFEND;
      UNTIL current_status.normal;

      RESET work_area_p;
      NEXT object_information_p IN work_area_p;
      IF object_information_p = NIL THEN
        osp$set_status_abnormal (amc$access_method_id, fse$system_error, nil_object_info_text,
              current_status);
        EXIT /get_file_attributes/; {----->
      IFEND;

      IF object_information_p^.object <> NIL THEN
        IF object_information_p^.object^.object_type = fsc$goi_cycle_object THEN
          file_object_p := NIL;
          cycle_object_p := object_information_p^.object;
        ELSEIF object_information_p^.object^.object_type = fsc$goi_file_object THEN
          file_object_p := object_information_p^.object;
          IF object_information_p^.object^.cycle_object_list = NIL THEN
            get_default_attributes (evaluated_file_reference, device_class, file_attributes, current_status);
            EXIT /get_file_attributes/; {----->
          ELSE
            cycle_object_p := ^object_information_p^.object^.cycle_object_list^ [1];
          IFEND;
        ELSE {catalog_object}
          osp$set_status_condition (pfe$name_not_permanent_file, current_status);
          osp$append_status_file (osc$status_parameter_delimiter, object_information_p^.resolved_path^,
                current_status);
          EXIT /get_file_attributes/; {----->
        IFEND;
      ELSE
        fsp$set_file_reference_abnormal (object_information_p^.resolved_path^, ame$file_not_known,
              amc$get_file_attributes_req, '', current_status);
        EXIT /get_file_attributes/; {----->
      IFEND;

      file_exists := TRUE;
      device_class := cycle_object_p^.cycle_device_class;
      contains_data := ((cycle_object_p^.cycle_size <> NIL) AND
            (cycle_object_p^.cycle_size^ > 0)) OR (device_class = rmc$magnetic_tape_device);
      file_label_p := cycle_object_p^.file_label;

      target_device_class := device_class;
      IF device_class = rmc$connected_file_device THEN

{ More space is needed to get the attributes of the target file.  "Work_area_p"
{ can be reused because the necessary information to which it points has been
{ reassigned to other pointers.

        PUSH work_area_p: [[REP work_area_size OF cell]];
        get_connected_file_attributes (current_status);

{NOTE: get_connected_file_attributes may push work_area_p again! And therefore we must not use it anymore!

        IF NOT current_status.normal THEN
          EXIT /get_file_attributes/; {----->
        IFEND;
      IFEND;

      fsp$expand_file_label (file_label_p, static_label_attributes, file_previously_opened, current_status);
      IF NOT current_status.normal THEN
        EXIT /get_file_attributes/; {----->
      IFEND;

      IF (NOT file_previously_opened) AND (device_class = rmc$magnetic_tape_device) AND
            (cycle_object_p^.cycle_device_information <> NIL) THEN
        fsp$adjust_tape_defaults (cycle_object_p^.cycle_device_information^.magnetic_tape_device_info.density,
              static_label_attributes);
      IFEND;

      job_environment_information_p := cycle_object_p^.job_environment_information;

      IF file_request_attributes_p <> NIL THEN

{ Merge amp$file requests.

        merge_dynamic_requests (file_request_attributes_p, job_environment_information_p);
        IF NOT file_previously_opened THEN
          bap$merge_static_attributes (evaluated_file_reference, file_request_attributes_p,
                static_label_attributes, current_status);
          IF NOT current_status.normal THEN
            EXIT /get_file_attributes/; {----->
          IFEND;
        IFEND;
      IFEND;

      IF (target_device_class = rmc$terminal_device) AND ((static_label_attributes.page_length_source =
            amc$access_method_default) OR (static_label_attributes.page_width_source =
            amc$access_method_default)) THEN
        ifp$get_page_length_width (evaluated_file_reference.path_handle_info.path_handle, page_length_width,
              current_status);
        IF NOT current_status.normal THEN
          EXIT /get_file_attributes/; {----->
        IFEND;
      IFEND;

      assign_attribute_values;
    END /get_file_attributes/;

    IF NOT current_status.normal THEN
      IF (current_status.condition = ame$file_not_known) OR
            (current_status.condition = pfe$unknown_permanent_file) OR
            (current_status.condition = pfe$unknown_cycle) OR (current_status.condition = pfe$unknown_item) OR
            (current_status.condition = pfe$unknown_nth_subcatalog) THEN
        IF file_request_attributes_p <> NIL THEN
          PUSH job_environment_information_p;
          merge_amp$file_requests (status);
        ELSE
          get_default_attributes (evaluated_file_reference, device_class, file_attributes, status);
        IFEND;
      ELSE
        status := current_status;
      IFEND;
    IFEND;

  PROCEND amp$get_file_attributes;

?? TITLE := '[xdcl] AMP$VALIDATE_ATTRIBUTES', EJECT ??

  PROCEDURE [XDCL] amp$validate_attributes
    (    file: fst$file_reference;
         request_code: amt$last_operation;
         validation_ring: ost$valid_ring;
         attributes: ^amt$file_attributes;
     VAR status: ost$status);

    CONST
      old_open_req = 'AMP$OPEN';

    VAR
      amv$logging_options: [STATIC, READ, oss$job_paged_literal] amt$logging_options :=
            [amc$enable_parcels, amc$enable_media_recovery, amc$enable_request_recovery];

    VAR
      entry_p: ^amt$file_item,
      i: integer,
      key_is_good: boolean,
      value_is_good: boolean;

?? NEWTITLE := '[inline] VALIDATE_PROGRAM_NAME', EJECT ??

    PROCEDURE [INLINE] validate_program_name
      (    program_name: string ( * <= osc$max_name_size);
       VAR name_is_valid: boolean);

      TYPE
        char_set = set of char;

      VAR
        ignore_scan_found_char: boolean,
        non_name_chars: char_set,
        scan_index: 1 .. osc$max_name_size + 1;

      CASE program_name (1) OF
      = '#', '$', '@', '0' .. '9', 'A' .. 'Z', 'a' .. 'z', '[', '\', ']', '^', '_', '`', '{', '|', '}', '~' =
        non_name_chars := -$char_set ['#', '$', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '@',
              'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
              'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
              'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '[', '\', ']', '^', '_',
              '`', '{', '|', '}', '~'];
        #SCAN (non_name_chars, program_name, scan_index, ignore_scan_found_char);
        name_is_valid := program_name (scan_index, * ) = '';
      ELSE
        name_is_valid := FALSE;
      CASEND;

    PROCEND validate_program_name;
?? OLDTITLE, EJECT ??

    status.normal := TRUE;
    IF attributes = NIL THEN
      RETURN; {----->
    IFEND;

    FOR i := 1 TO UPPERBOUND (attributes^) DO
      value_is_good := TRUE;
      key_is_good := TRUE;
      entry_p := ^attributes^ [i];

      CASE entry_p^.key OF
      = amc$access_mode =
        value_is_good := (entry_p^.access_mode <= amv$access_mode);

      = amc$block_type =
        value_is_good := (entry_p^.block_type >= LOWERVALUE (amt$block_type))
{                  } AND (entry_p^.block_type <= UPPERVALUE (amt$block_type));

      = amc$character_conversion =
        value_is_good := (entry_p^.character_conversion >= LOWERVALUE (boolean))
{                  } AND (entry_p^.character_conversion <= UPPERVALUE (boolean));

      = amc$clear_space =
        value_is_good := (entry_p^.clear_space >= LOWERVALUE (ost$clear_file_space))
{                  } AND (entry_p^.clear_space <= UPPERVALUE (ost$clear_file_space));

      = amc$error_exit_name =
        IF entry_p^.error_exit_name <> osc$null_name THEN
          clp$only_validate_name (entry_p^.error_exit_name, value_is_good);
        IFEND;

      = amc$error_options =
        value_is_good := (entry_p^.error_options.error_action >= LOWERVALUE (amt$tape_error_action))
{                  } AND (entry_p^.error_options.error_action <= UPPERVALUE (amt$tape_error_action))
{                  } AND (entry_p^.error_options.perform_failure_recovery >= LOWERVALUE (boolean))
{                  } AND (entry_p^.error_options.perform_failure_recovery <= UPPERVALUE (boolean));

      = amc$file_access_procedure =
        IF entry_p^.file_access_procedure <> osc$null_name THEN
          clp$only_validate_name (entry_p^.file_access_procedure, value_is_good);
        IFEND;

      = amc$file_contents =
        clp$only_validate_name (entry_p^.file_contents, value_is_good);

      = amc$file_limit =
        value_is_good := (entry_p^.file_limit >= LOWERVALUE (amt$file_limit))
{                  } AND (entry_p^.file_limit <= amc$file_byte_limit);

      = amc$file_organization =
        value_is_good := (entry_p^.file_organization >= LOWERVALUE (amt$file_organization))
{                  } AND (entry_p^.file_organization <= UPPERVALUE (amt$file_organization));

      = amc$file_processor =
        clp$only_validate_name (entry_p^.file_processor, value_is_good);

      = amc$file_structure =
        clp$only_validate_name (entry_p^.file_structure, value_is_good);

      = amc$forced_write =
        value_is_good := (entry_p^.forced_write >= LOWERVALUE (amt$forced_write))
{                  } AND (entry_p^.forced_write <= UPPERVALUE (amt$forced_write));

      = amc$internal_code =
        value_is_good := (entry_p^.internal_code >= LOWERVALUE (amt$internal_code))
{                  } AND (entry_p^.internal_code <= UPPERVALUE (amt$internal_code));

      = amc$label_exit_name =
        IF entry_p^.label_exit_name <> osc$null_name THEN
          clp$only_validate_name (entry_p^.label_exit_name, value_is_good);
        IFEND;

      = amc$label_options =
        value_is_good := (entry_p^.label_options <= amv$label_options);

      = amc$label_type =
        value_is_good := (entry_p^.label_type >= LOWERVALUE (amt$label_type))
{                  } AND (entry_p^.label_type > UPPERVALUE (amt$label_type));

      = amc$line_number =
        value_is_good := (entry_p^.line_number.length >= LOWERVALUE (amt$line_number_length))
{                  } AND (entry_p^.line_number.length <= UPPERVALUE (amt$line_number_length))
{                  } AND (entry_p^.line_number.location >= LOWERVALUE (amt$line_number_location))
{                  } AND (entry_p^.line_number.location <= UPPERVALUE (amt$line_number_location));

      = amc$max_block_length =
        value_is_good := (entry_p^.max_block_length >= LOWERVALUE (amt$max_block_length))
{                  } AND (entry_p^.max_block_length <= UPPERVALUE (amt$max_block_length));

      = amc$max_record_length =
        value_is_good := (entry_p^.max_record_length >= LOWERVALUE (amt$max_record_length))
{                  } AND (entry_p^.max_record_length <= UPPERVALUE (amt$max_record_length));

      = amc$min_block_length =
        value_is_good := (entry_p^.min_block_length >= LOWERVALUE (amt$min_block_length))
{                  } AND (entry_p^.min_block_length <= UPPERVALUE (amt$min_block_length));

      = amc$min_record_length =
        value_is_good := (entry_p^.min_record_length >= LOWERVALUE (amt$min_record_length))
{                  } AND (entry_p^.min_record_length <= UPPERVALUE (amt$min_record_length));

      = amc$null_attribute =
        ;
      = amc$open_position =
        value_is_good := (entry_p^.open_position >= LOWERVALUE (amt$open_position))
{                  } AND (entry_p^.open_position <= UPPERVALUE (amt$open_position));

      = amc$padding_character =
        ;
      = amc$page_format =
        value_is_good := (entry_p^.page_format >= LOWERVALUE (amt$page_format))
{                  } AND (entry_p^.page_format <= UPPERVALUE (amt$page_format));

      = amc$page_length =
        value_is_good := (entry_p^.page_length >= LOWERVALUE (amt$page_length))
{                  } AND (entry_p^.page_length <= UPPERVALUE (amt$page_length));

      = amc$page_width =
        value_is_good := (entry_p^.page_width >= LOWERVALUE (amt$page_width))
{                  } AND (entry_p^.page_width <= UPPERVALUE (amt$page_width));

      = amc$preset_value =
        ;
      = amc$record_type =
        value_is_good := (entry_p^.record_type >= LOWERVALUE (amt$record_type))
{                  } AND (entry_p^.record_type <= UPPERVALUE (amt$record_type));

      = amc$return_option =
        value_is_good := (entry_p^.return_option >= LOWERVALUE (amt$return_option))
{                  } AND (entry_p^.return_option <= UPPERVALUE (amt$return_option));

      = amc$ring_attributes =
        IF request_code = amc$set_file_attributes_cmd THEN
          key_is_good := FALSE;
        ELSEIF NOT ((1 <= entry_p^.ring_attributes.r1)
{            } AND (entry_p^.ring_attributes.r1 <= entry_p^.ring_attributes.r2)
{            } AND (entry_p^.ring_attributes.r2 <= entry_p^.ring_attributes.r3)
{            } AND (entry_p^.ring_attributes.r3 <= 13)) THEN
          value_is_good := FALSE;
        ELSE
          CASE request_code OF
          = amc$change_file_attributes_cmd, amc$open_req, amc$override_file_attributes =
            ;
          ELSE
            IF validation_ring > entry_p^.ring_attributes.r1 THEN
              fsp$set_file_reference_abnormal (file, ame$ring_validation_error, request_code, '', status);
              RETURN; {----->
            IFEND;
          CASEND;
        IFEND;

      = amc$statement_identifier =
        value_is_good := ((entry_p^.statement_identifier.length >= LOWERVALUE (amt$statement_id_length))
{                  } AND (entry_p^.statement_identifier.length <= UPPERVALUE (amt$statement_id_length))
{                  } AND (entry_p^.statement_identifier.location >= LOWERVALUE (amt$statement_id_location))
{                  } AND (entry_p^.statement_identifier.location <= UPPERVALUE (amt$statement_id_location)));

      = amc$user_info =
        ;
      = amc$vertical_print_density =
        value_is_good := (entry_p^.vertical_print_density >= LOWERVALUE (amt$vertical_print_density))
{                  } AND (entry_p^.vertical_print_density <= UPPERVALUE (amt$vertical_print_density));

{ AAM

      = amc$average_record_length =
        value_is_good := (entry_p^.average_record_length >= LOWERVALUE (amt$average_record_length))
{                  } AND (entry_p^.average_record_length <= UPPERVALUE (amt$average_record_length));

      = amc$collate_table_name =
        IF entry_p^.collate_table_name <> osc$null_name THEN
          clp$only_validate_name (entry_p^.collate_table_name, value_is_good);
        IFEND;

      = amc$compression_procedure_name =
        IF (entry_p^.compression_procedure_name <> NIL)
{     } AND (entry_p^.compression_procedure_name^.name <> osc$null_name) THEN
          validate_program_name (entry_p^.compression_procedure_name^.name, value_is_good);
          IF value_is_good AND (entry_p^.compression_procedure_name^.object_library <> osc$null_name) THEN
            value_is_good := clf$file_reference_valid (entry_p^.compression_procedure_name^.object_library);
          IFEND;
        IFEND;

      = amc$data_padding =
        value_is_good := (entry_p^.data_padding >= LOWERVALUE (amt$data_padding))
{                  } AND (entry_p^.data_padding <= UPPERVALUE (amt$data_padding));

      = amc$dynamic_home_block_space =
        value_is_good := (entry_p^.dynamic_home_block_space >= LOWERVALUE (boolean))
{                  } AND (entry_p^.dynamic_home_block_space <= UPPERVALUE (boolean));

      = amc$embedded_key =
        value_is_good := (entry_p^.embedded_key >= LOWERVALUE (boolean))
{                  } AND (entry_p^.embedded_key <= UPPERVALUE (boolean));

      = amc$error_limit =
        value_is_good := (entry_p^.error_limit >= LOWERVALUE (amt$error_limit))
{                  } AND (entry_p^.error_limit <= UPPERVALUE (amt$error_limit));

      = amc$estimated_record_count =
        ;
      = amc$hashing_procedure_name =
        IF (entry_p^.hashing_procedure_name <> NIL)
{     } AND (entry_p^.hashing_procedure_name^.name <> osc$null_name) THEN
          validate_program_name (entry_p^.hashing_procedure_name^.name, value_is_good);
          IF value_is_good AND (entry_p^.hashing_procedure_name^.object_library <> osc$null_name) THEN
            value_is_good := clf$file_reference_valid (entry_p^.hashing_procedure_name^.object_library);
          IFEND;
        IFEND;

      = amc$index_levels =
        value_is_good := (entry_p^.index_levels >= LOWERVALUE (amt$index_levels))
{                  } AND (entry_p^.index_levels <= UPPERVALUE (amt$index_levels));

      = amc$index_padding =
        value_is_good := (entry_p^.index_padding >= LOWERVALUE (amt$index_padding))
{                  } AND (entry_p^.index_padding <= UPPERVALUE (amt$index_padding));

      = amc$initial_home_block_count =
        value_is_good := (entry_p^.initial_home_block_count >= LOWERVALUE (amt$initial_home_block_count))
{                  } AND (entry_p^.initial_home_block_count <= UPPERVALUE (amt$initial_home_block_count));

      = amc$key_length =
        value_is_good := (entry_p^.key_length >= LOWERVALUE (amt$key_length))
{                  } AND (entry_p^.key_length <= UPPERVALUE (amt$key_length));

      = amc$key_position =
        value_is_good := (entry_p^.key_position >= LOWERVALUE (amt$key_position))
{                  } AND (entry_p^.key_position <= UPPERVALUE (amt$key_position));

      = amc$key_type =
        value_is_good := (entry_p^.key_type >= LOWERVALUE (amt$key_type))
{                  } AND (entry_p^.key_type <= UPPERVALUE (amt$key_type));

      = amc$loading_factor =
        value_is_good := (entry_p^.loading_factor >= LOWERVALUE (amt$loading_factor))
{                  } AND (entry_p^.loading_factor <= UPPERVALUE (amt$loading_factor));

      = amc$lock_expiration_time =
        value_is_good := (entry_p^.lock_expiration_time >= LOWERVALUE (amt$lock_expiration_time))
{                  } AND (entry_p^.lock_expiration_time <= UPPERVALUE (amt$lock_expiration_time));

      = amc$logging_options =
        value_is_good := entry_p^.logging_options <= amv$logging_options;

      = amc$log_residence =
        IF (entry_p^.log_residence <> NIL)
{     } AND (entry_p^.log_residence^ <> osc$null_name) THEN
          value_is_good := clf$file_reference_valid (entry_p^.log_residence^);
        IFEND;

      = amc$message_control =
        value_is_good := entry_p^.message_control <= amv$message_control;

      = amc$record_limit =
        value_is_good := (entry_p^.record_limit >= LOWERVALUE (amt$record_limit))
{                  } AND (entry_p^.record_limit <= UPPERVALUE (amt$record_limit));

      = amc$records_per_block =
        value_is_good := (entry_p^.records_per_block >= LOWERVALUE (amt$records_per_block))
{                  } AND (entry_p^.records_per_block <= UPPERVALUE (amt$records_per_block));

      ELSE
        key_is_good := FALSE;
      CASEND;

      IF NOT key_is_good THEN
        IF status.normal OR (status.condition <> ame$improper_file_attrib_key) THEN
          IF request_code <> amc$open_req THEN
            fsp$set_file_reference_abnormal (file, ame$improper_file_attrib_key, request_code,
                  'FILE_ATTRIBUTES', status);
          ELSE
            bap$set_file_reference_abnormal (file, ame$improper_file_attrib_key, old_open_req,
                  'ACCESS_SELECTIONS', status);
          IFEND;
          osp$append_status_integer (osc$status_parameter_delimiter, i, 10, FALSE, status);
        ELSE
          osp$append_status_integer (',', i, 10, FALSE, status);
        IFEND;
      ELSEIF NOT value_is_good THEN
        IF status.normal THEN
          IF request_code <> amc$open_req THEN
            fsp$set_file_reference_abnormal (file, ame$improper_file_attrib_value, request_code,
                  'FILE_ATTRIBUTES', status);
          ELSE
            bap$set_file_reference_abnormal (file, ame$improper_file_attrib_value, old_open_req,
                  'ACCESS_SELECTIONS', status);
          IFEND;
          osp$append_status_parameter (osc$status_parameter_delimiter, amv$attribute_names [entry_p^.key],
                status);
        ELSEIF status.condition = ame$improper_file_attrib_value THEN
          osp$append_status_parameter (',', amv$attribute_names [entry_p^.key], status);
        IFEND;
      IFEND;
    FOREND;

  PROCEND amp$validate_attributes;

?? TITLE := 'get_default_attributes', EJECT ??

  PROCEDURE get_default_attributes
    (    evaluated_file_reference: fst$evaluated_file_reference;
         device_class: rmt$device_class;
     VAR file_attributes: amt$get_attributes;
     VAR status: ost$status);

    VAR
      default_file_attributes: bat$static_label_attributes,
      default_new_retention: fst$retention,
      default_new_retention_specified: boolean,
      entry_p: ^amt$get_item,
      i: integer,
      i_string: ^ost$string,
      ignore_status: ^ost$status;

    status.normal := TRUE;
    bap$get_default_file_attribs (default_file_attributes, default_new_retention_specified,
          default_new_retention, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    FOR i := 1 TO UPPERBOUND (file_attributes) DO
      entry_p := ^file_attributes [i];
      CASE entry_p^.key OF
      = amc$access_mode =
        entry_p^.access_mode := fmv$system_file_attributes.dynamic_label.access_mode;
        entry_p^.source := fmv$system_file_attributes.dynamic_label.access_mode_source;
      = amc$application_info =
        entry_p^.application_info := fmv$system_file_attributes.descriptive_label.application_info;
        entry_p^.source := fmv$system_file_attributes.descriptive_label.application_info_source;
      = amc$block_type =
        entry_p^.block_type := default_file_attributes.block_type;
        entry_p^.source := default_file_attributes.block_type_source;
      = amc$character_conversion =
        entry_p^.character_conversion := default_file_attributes.character_conversion;
        entry_p^.source := default_file_attributes.character_conversion_source;
      = amc$clear_space =
        entry_p^.clear_space := default_file_attributes.clear_space;
        entry_p^.source := default_file_attributes.clear_space_source;
      = amc$device_class =
        entry_p^.device_class := device_class;
        entry_p^.source := amc$open_request;
      = amc$error_exit_name =
        entry_p^.error_exit_name := fmv$system_file_attributes.dynamic_label.error_exit_name;
        entry_p^.source := fmv$system_file_attributes.dynamic_label.error_exit_name_source;
      = amc$error_options =
        entry_p^.error_options := fmv$system_file_attributes.dynamic_label.error_options;
        entry_p^.source := fmv$system_file_attributes.dynamic_label.error_options_source;
      = amc$file_access_procedure =
        entry_p^.file_access_procedure := default_file_attributes.file_access_procedure;
        entry_p^.source := default_file_attributes.file_access_procedure_source;
      = amc$file_contents =
        entry_p^.file_contents := default_file_attributes.file_contents;
        entry_p^.source := default_file_attributes.file_contents_source;
      = amc$file_length =
        entry_p^.file_length := fmv$global_file_information.eoi_byte_address;
        entry_p^.source := amc$local_file_information;
      = amc$file_limit =
        entry_p^.file_limit := default_file_attributes.file_limit;
        entry_p^.source := default_file_attributes.file_limit_source;
      = amc$file_organization =
        entry_p^.file_organization := default_file_attributes.file_organization;
        entry_p^.source := default_file_attributes.file_organization_source;
      = amc$file_processor =
        entry_p^.file_processor := default_file_attributes.file_processor;
        entry_p^.source := default_file_attributes.file_processor_source;
      = amc$file_structure =
        entry_p^.file_structure := default_file_attributes.file_structure;
        entry_p^.source := default_file_attributes.file_structure_source;
      = amc$forced_write =
        entry_p^.forced_write := default_file_attributes.forced_write;
        entry_p^.source := default_file_attributes.forced_write_source;
      = amc$global_access_mode =
        entry_p^.global_access_mode := fmv$system_file_attributes.descriptive_label.global_access_mode;
        entry_p^.source := fmv$system_file_attributes.descriptive_label.global_access_mode_source;
      = amc$global_file_address =
        entry_p^.global_file_address := fmv$global_file_information.positioning_info.record_info.
              current_byte_address;
        entry_p^.source := amc$local_file_information;
      = amc$global_file_name =
        entry_p^.global_file_name := fmv$system_file_attributes.descriptive_label.global_file_name;
        entry_p^.source := fmv$system_file_attributes.descriptive_label.global_file_name_source;
      = amc$global_file_position =
        entry_p^.global_file_position := fmv$global_file_information.positioning_info.record_info.
              file_position;
        entry_p^.source := amc$local_file_information;
      = amc$global_share_mode =
        entry_p^.global_share_mode := fmv$system_file_attributes.descriptive_label.global_share_mode;
        entry_p^.source := fmv$system_file_attributes.descriptive_label.global_share_mode_source;
      = amc$internal_code =
        entry_p^.internal_code := default_file_attributes.internal_code;
        entry_p^.source := default_file_attributes.internal_code_source;
      = amc$label_exit_name =
        entry_p^.label_exit_name := fmv$system_file_attributes.dynamic_label.label_exit_name;
        entry_p^.source := fmv$system_file_attributes.dynamic_label.label_exit_name_source;
      = amc$label_options =
        entry_p^.label_options := fmv$system_file_attributes.dynamic_label.label_options;
        entry_p^.source := fmv$system_file_attributes.dynamic_label.label_options_source;
      = amc$label_type =
        entry_p^.label_type := default_file_attributes.label_type;
        entry_p^.source := default_file_attributes.label_type_source;
      = amc$line_number =
        entry_p^.line_number := default_file_attributes.line_number;
        entry_p^.source := default_file_attributes.line_number_source;
      = amc$max_block_length =
        entry_p^.max_block_length := default_file_attributes.max_block_length;
        entry_p^.source := default_file_attributes.max_block_length_source;
      = amc$max_record_length =
        entry_p^.max_record_length := default_file_attributes.max_record_length;
        entry_p^.source := default_file_attributes.max_record_length_source;
      = amc$min_block_length =
        entry_p^.min_block_length := default_file_attributes.min_block_length;
        entry_p^.source := default_file_attributes.min_block_length_source;
      = amc$min_record_length =
        entry_p^.min_record_length := default_file_attributes.min_record_length;
        entry_p^.source := default_file_attributes.min_record_length_source;
      = amc$null_attribute =
        ;
      = amc$open_position =
        entry_p^.open_position := fmv$system_file_attributes.dynamic_label.open_position;
        entry_p^.source := fmv$system_file_attributes.dynamic_label.open_position_source;
      = amc$padding_character =
        entry_p^.padding_character := default_file_attributes.padding_character;
        entry_p^.source := default_file_attributes.padding_character_source;
      = amc$page_format =
        entry_p^.page_format := default_file_attributes.page_format;
        entry_p^.source := default_file_attributes.page_format_source;
      = amc$page_length =
        entry_p^.page_length := default_file_attributes.page_length;
        entry_p^.source := default_file_attributes.page_length_source;
      = amc$page_width =
        entry_p^.page_width := default_file_attributes.page_width;
        entry_p^.source := default_file_attributes.page_width_source;
      = amc$permanent_file =
        entry_p^.permanent_file := fmv$system_file_attributes.descriptive_label.permanent_file;
        entry_p^.source := fmv$system_file_attributes.descriptive_label.permanent_file_source;
      = amc$preset_value =
        entry_p^.preset_value := default_file_attributes.preset_value;
        entry_p^.source := default_file_attributes.preset_value_source;
      = amc$private_read =
        entry_p^.private_read := FALSE;
        entry_p^.source := amc$undefined_attribute;
      = amc$record_delimiting_character =
        entry_p^.record_delimiting_character := default_file_attributes.record_delimiting_character;
        entry_p^.source := default_file_attributes.record_delimiting_char_source;
      = amc$record_type =
        entry_p^.record_type := default_file_attributes.record_type;
        entry_p^.source := default_file_attributes.record_type_source;
      = amc$return_option =
        entry_p^.return_option := fmv$system_file_attributes.dynamic_label.return_option;
        entry_p^.source := fmv$system_file_attributes.dynamic_label.return_option_source;
      = amc$ring_attributes =
        entry_p^.ring_attributes := default_file_attributes.ring_attributes;
        entry_p^.source := default_file_attributes.ring_attributes_source;
      = amc$shared_queue =
        entry_p^.shared_queue := osc$null_name;
        entry_p^.source := amc$access_method_default;
      = amc$statement_identifier =
        entry_p^.statement_identifier := default_file_attributes.statement_identifier;
        entry_p^.source := default_file_attributes.statement_identifier_source;
      = amc$user_info =
        entry_p^.user_info := default_file_attributes.user_info;
        entry_p^.source := default_file_attributes.user_info_source;
      = amc$vertical_print_density =
        entry_p^.vertical_print_density := default_file_attributes.vertical_print_density;
        entry_p^.source := default_file_attributes.vertical_print_density_source;

{ aam

      = amc$average_record_length =
        entry_p^.average_record_length := default_file_attributes.average_record_length;
        entry_p^.source := default_file_attributes.average_record_length_source;
      = amc$collate_table_name =
        entry_p^.collate_table_name := default_file_attributes.collate_table_name;
        entry_p^.source := default_file_attributes.collate_table_name_source;
      = amc$compression_procedure_name =
        IF entry_p^.compression_procedure_name <> NIL THEN
          entry_p^.compression_procedure_name^ := default_file_attributes.compression_procedure_name;
          entry_p^.source := default_file_attributes.compression_proc_name_source;
        IFEND;
      = amc$data_padding =
        entry_p^.data_padding := default_file_attributes.data_padding;
        entry_p^.source := default_file_attributes.data_padding_source;
      = amc$dynamic_home_block_space =
        entry_p^.dynamic_home_block_space := default_file_attributes.dynamic_home_block_space;
        entry_p^.source := default_file_attributes.dynamic_home_block_space_source;
      = amc$embedded_key =
        entry_p^.embedded_key := default_file_attributes.embedded_key;
        entry_p^.source := default_file_attributes.embedded_key_source;
      = amc$error_limit =
        entry_p^.error_limit := fmv$system_file_attributes.dynamic_label.error_limit;
        entry_p^.source := fmv$system_file_attributes.dynamic_label.error_limit_source;
      = amc$estimated_record_count =
        entry_p^.estimated_record_count := default_file_attributes.estimated_record_count;
        entry_p^.source := default_file_attributes.estimated_record_count_source;
      = amc$hashing_procedure_name =
        IF entry_p^.hashing_procedure_name <> NIL THEN
          entry_p^.hashing_procedure_name^ := default_file_attributes.hashing_procedure_name;
          entry_p^.source := default_file_attributes.hashing_procedure_name_source;
        IFEND;
      = amc$index_levels =
        entry_p^.index_levels := default_file_attributes.index_levels;
        entry_p^.source := default_file_attributes.index_levels_source;
      = amc$index_padding =
        entry_p^.index_padding := default_file_attributes.index_padding;
        entry_p^.source := default_file_attributes.index_padding_source;
      = amc$initial_home_block_count =
        entry_p^.initial_home_block_count := default_file_attributes.initial_home_block_count;
        entry_p^.source := default_file_attributes.initial_home_block_count_source;
      = amc$key_length =
        entry_p^.key_length := default_file_attributes.key_length;
        entry_p^.source := default_file_attributes.key_length_source;
      = amc$key_position =
        entry_p^.key_position := default_file_attributes.key_position;
        entry_p^.source := default_file_attributes.key_position_source;
      = amc$key_type =
        entry_p^.key_type := default_file_attributes.key_type;
        entry_p^.source := default_file_attributes.key_type_source;
      = amc$loading_factor =
        entry_p^.loading_factor := default_file_attributes.loading_factor;
        entry_p^.source := default_file_attributes.loading_factor_source;
      = amc$lock_expiration_time =
        entry_p^.lock_expiration_time := default_file_attributes.lock_expiration_time;
        entry_p^.source := default_file_attributes.lock_expiration_time_source;
      = amc$logging_options =
        entry_p^.logging_options := default_file_attributes.logging_options;
        entry_p^.source := default_file_attributes.logging_options_source;
      = amc$log_residence =
        IF entry_p^.log_residence <> NIL THEN
          entry_p^.log_residence^ := default_file_attributes.log_residence;
          entry_p^.source := default_file_attributes.log_residence_source;
        IFEND;
      = amc$message_control =
        entry_p^.message_control := fmv$system_file_attributes.dynamic_label.message_control;
        entry_p^.source := fmv$system_file_attributes.dynamic_label.message_control_source;
      = amc$record_limit =
        entry_p^.record_limit := default_file_attributes.record_limit;
        entry_p^.source := default_file_attributes.record_limit_source;
      = amc$records_per_block =
        entry_p^.records_per_block := default_file_attributes.records_per_block;
        entry_p^.source := default_file_attributes.records_per_block_source;

      ELSE
        IF status.normal THEN
          PUSH ignore_status;
          PUSH i_string;
          clp$convert_integer_to_string (i, 10, FALSE, i_string^, ignore_status^);
          fsp$set_evaluated_file_abnormal (evaluated_file_reference, ame$improper_file_attrib_key,
                amc$get_file_attributes_req, 'FILE_ATTRIBUTES', status);
          osp$append_status_parameter (osc$status_parameter_delimiter, i_string^.value (1, i_string^.size),
                status);
        ELSE
          clp$convert_integer_to_string (i, 10, FALSE, i_string^, ignore_status^);
          osp$append_status_parameter (',', i_string^.value (1, i_string^.size), status);
        IFEND;
      CASEND;
    FOREND;

  PROCEND get_default_attributes;

?? TITLE := '[inline] MERGE_DYNAMIC_REQUESTS', EJECT ??

  PROCEDURE [INLINE] merge_dynamic_requests
    (    file_request_attributes: ^amt$file_attributes;
         job_environment_information: {input/output} ^fst$job_environment_information);

    VAR
      entry_p: ^amt$file_item,
      index: integer;

    IF job_environment_information <> NIL THEN
      FOR index := 1 TO UPPERBOUND (file_request_attributes^) DO
        entry_p := ^file_request_attributes^ [index];
        CASE entry_p^.key OF
        = amc$access_mode =
          IF job_environment_information^.attachment_options_sources.access_modes_source <>
                amc$file_command THEN
            #UNCHECKED_CONVERSION (entry_p^.access_mode, job_environment_information^.setfa_access_modes);
            job_environment_information^.attachment_options_sources.access_modes_source := amc$file_request;
          IFEND;
        = amc$error_exit_name =
          IF job_environment_information^.attachment_options_sources.error_exit_name_source <>
                amc$file_command THEN
            #TRANSLATE (osv$lower_to_upper, entry_p^.error_exit_name,
                  job_environment_information^.error_exit_procedure_name);
            job_environment_information^.attachment_options_sources.error_exit_name_source :=
                  amc$file_request;
          IFEND;
        = amc$error_limit =
          IF job_environment_information^.attachment_options_sources.error_limit_source <>
                amc$file_command THEN
            job_environment_information^.error_limit := entry_p^.error_limit;
            job_environment_information^.attachment_options_sources.error_limit_source := amc$file_request;
          IFEND;
        = amc$error_options =
          ;
        = amc$label_exit_name =
          IF job_environment_information^.attachment_options_sources.label_exit_name_source <>
                amc$file_command THEN
            #TRANSLATE (osv$lower_to_upper, entry_p^.label_exit_name,
                  job_environment_information^.label_exit_procedure_name);
            job_environment_information^.attachment_options_sources.label_exit_name_source :=
                  amc$file_request;
          IFEND;
        = amc$message_control =
          IF job_environment_information^.attachment_options_sources.message_control_source <>
                amc$file_command THEN
            job_environment_information^.message_control := entry_p^.message_control;
            job_environment_information^.attachment_options_sources.message_control_source :=
                  amc$file_request;
          IFEND;
        = amc$open_position =
          IF job_environment_information^.attachment_options_sources.open_position_source =
                amc$access_method_default THEN

{ Open position was not specified by SETFA or a file_reference.

            job_environment_information^.open_position := entry_p^.open_position;
            job_environment_information^.attachment_options_sources.open_position_source := amc$file_request;
          IFEND;
        ELSE
        CASEND;
      FOREND;
    IFEND;

  PROCEND merge_dynamic_requests;
?? OLDTITLE, EJECT ??
MODEND amm$file_structure_functions;
