?? PUSH (LISTEXT := ON) ??
*copyc ame$access_validation_errors
*copyc bat$task_file_table
*copyc ost$status
*copyc pft$usage_selections
*copyc amp$set_file_instance_abnormal
*copyc bai$gfi
*copyc bai$static_label
?? POP ??

  PROCEDURE [INLINE] bai$check_access_mode
    (    file_identifier: amt$file_identifier;
         static_label: ^bat$instance_static_attributes;
         access_mode: pft$usage_selections;
         operation: amt$fap_operation;
     VAR status: ost$status);

    CASE operation OF

*copy bac$read_requests

      IF operation <> amc$skip_req THEN
        IF NOT (pfc$read IN access_mode) THEN
          amp$set_file_instance_abnormal (file_identifier,
                ame$improper_access_attempt, operation, ' READ', status);
        IFEND;
      IFEND;

*copy bac$write_requests

      IF operation <> amc$replace_req THEN
        IF (gfi^.positioning_info.record_info.current_byte_address <
              gfi^.eoi_byte_address) THEN
          IF NOT (pfc$shorten IN access_mode) THEN
            amp$set_file_instance_abnormal (file_identifier,
                  ame$improper_access_attempt, operation, ' SHORTEN', status);
          ELSE
{           update_segment_length := TRUE;
          IFEND;
        ELSE
          IF NOT (pfc$append IN access_mode) THEN
            amp$set_file_instance_abnormal (file_identifier,
                  ame$improper_access_attempt, operation, ' APPEND', status);
          IFEND;
        IFEND;
      ELSE { replace_previous_record }
        IF NOT (pfc$modify IN access_mode) THEN
          amp$set_file_instance_abnormal (file_identifier,
                ame$improper_access_attempt, operation, ' MODIFY', status);
        IFEND;
      IFEND;

    ELSE
    CASEND;

  PROCEND bai$check_access_mode;
