*copyc osd$default_pragmats
MODULE srm$validate_compatibility;

{
{ PURPOSE:
{    This module validates upward and downward compatibility of the
{ file label between different systems.
{
{        SRP$VALIDATE_COMPATIBILITY (P_FILE_LABEL, P_FILE_LABEL_HEADER,
{              LOCAL_FILE_NAME, STATUS)
{
{ P_FILE_LABEL: (input) This parameter specifies the file label to be
{        validated.
{
{ P_FILE_LABEL_HEADER: (input) This parameter specifies the header in
{        the file label.
{
{ LOCAL_FILE_NAME: (input) This parameter specifies the local name of the
{        file whose label is to be validated.
{
{ STATUS: (output) This parameter returns the request status.
{
?? PUSH (LISTEXT := ON) ??
*copyc fmc$current_revision_level
*copyc fmc$unique_label_id
*copyc ame$attribute_validation_errors
*copyc ame$lfn_program_actions
*copyc amt$file_reference
*copyc amt$local_file_name
*copyc amt$logging_options
*copyc amt$path_name
*copyc bat$v1_max_block_length
*copyc clt$file
*copyc fmt$file_attribute_keys
*copyc fmt$file_label
*copyc fmt$static_label_header
*copyc fmt$static_label_item
*copyc ost$name
*copyc pmt$program_name
?? POP ??
*copyc clp$convert_string_to_file
*copyc clp$validate_name
*copyc osp$append_status_integer
*copyc osp$append_status_parameter
*copyc osp$set_status_abnormal
?? TITLE := '[XDCL] srp$validate_compatibility', EJECT ??

  PROCEDURE [XDCL] srp$validate_compatibility (file_label_p: fmt$p_file_label;
        p_file_label_header: ^fmt$static_label_header;
        local_file_name: amt$local_file_name;
    VAR status: ost$status);

    TYPE
      attribute_keys = SET OF fmt$file_attribute_keys;

    VAR
      attributes_are_compatible: boolean,
      entry_point_refs: [STATIC] attribute_keys := $attribute_keys
        [fmc$file_access_procedure, fmc$collate_table_name],
      i: integer,
      job_label: ^SEQ ( * ),
      names: [STATIC] attribute_keys := $attribute_keys
        [fmc$file_contents, fmc$file_processor, fmc$file_structure],
      p_file_label: ^SEQ ( * ),
      static_label_item: ^fmt$static_label_item,
      str: ^string ( * ),
      user_attributes: ^SEQ ( * ),
      x: ^cell;

    PROCEDURE [INLINE] set_status_abnormal (level: fmt$revision_level;
          text: string ( * );
      VAR status: ost$status);

      osp$set_status_abnormal (amc$access_method_id,
            ame$incompatible_attributes, local_file_name, status);
      osp$append_status_integer (osc$status_parameter_delimiter, level, 10,
            false, status);
      osp$append_status_parameter (osc$status_parameter_delimiter, text,
            status);
    PROCEND set_status_abnormal;


    { validate downward compatibility }

    p_file_label := file_label_p; {assign seq ptr to local variable}

    FOR i := fmc$ring_attributes TO fmc$highest_current_attribute DO
      IF p_file_label_header^.attribute_present [i] THEN
        NEXT static_label_item: [i] IN p_file_label;
        IF static_label_item = NIL THEN
          set_status_abnormal (p_file_label_header^.revision_level,
                'downward', status);
          RETURN;
        IFEND;

        IF i IN entry_point_refs THEN
          NEXT str: [static_label_item^.entry_point_name_length] IN p_file_label;
          IF str = NIL THEN
            set_status_abnormal (p_file_label_header^.revision_level,
                  'downward', status);
            RETURN;
          IFEND;
          IF static_label_item^.entry_point_path_length > 0 THEN
            NEXT str: [static_label_item^.entry_point_path_length] IN p_file_label;
            IF str = NIL THEN
              set_status_abnormal (p_file_label_header^.revision_level,
                    'downward', status);
              RETURN;
            IFEND;
          IFEND;
        IFEND;

        IF i IN names THEN
          NEXT str: [static_label_item^.name_length] IN p_file_label;
          IF str = NIL THEN
            set_status_abnormal (p_file_label_header^.revision_level,
                  'downward', status);
            RETURN;
          IFEND;
        IFEND;

        IF i = fmc$user_info THEN
          NEXT str: [32] IN p_file_label;
          IF str = NIL THEN
            set_status_abnormal (p_file_label_header^.revision_level,
                  'downward', status);
            RETURN;
          IFEND;
        IFEND;

      IFEND;
    FOREND;
    FOR i := fmc$highest_current_attribute + 1 TO
          p_file_label_header^.highest_attribute_supported DO
      IF p_file_label_header^.attribute_present [i] THEN
        set_status_abnormal (p_file_label_header^.revision_level,
              'downward', status);
        RETURN;
      IFEND;
    FOREND;

    IF p_file_label_header^.user_attribute_length > 0 THEN
      NEXT user_attributes: [[REP p_file_label_header^.user_attribute_length
            OF cell]] IN p_file_label;
    IFEND;
    IF p_file_label_header^.job_routing_label_size > 0 THEN
      NEXT job_label: [[REP p_file_label_header^.job_routing_label_size
            OF cell]] IN p_file_label;
    IFEND;
    NEXT x IN p_file_label;
    IF x <> NIL THEN
      set_status_abnormal (p_file_label_header^.revision_level,
            'downward', status);
      RETURN;
    IFEND;
    srp$validate_attributes (p_file_label, attributes_are_compatible, status);
    IF NOT attributes_are_compatible THEN
      set_status_abnormal (p_file_label_header^.revision_level,
            'downward', status);
    IFEND;

  PROCEND srp$validate_compatibility;


?? TITLE := '[XDCL] srp$validate_attributes', EJECT ??

  PROCEDURE [XDCL] srp$validate_attributes (p_static_label: ^SEQ ( * );
    VAR attributes_are_compatible: boolean;
    VAR status: ost$status);


    VAR
      static_label: ^SEQ ( * ),
      checksum: ^integer,
      header: ^fmt$static_label_header,
      attribute_key: fmt$file_attribute_keys,
      static_label_item: ^fmt$static_label_item,
      collate_table_name: pmt$program_name,
      compression_procedure_name: pmt$program_name,
      compression_procedure_path: amt$path_name,
      hashing_procedure_name: pmt$program_name,
      hashing_procedure_path: amt$path_name,
      fap_name: pmt$program_name,
      file_contents,
      file_processor,
      file_structure: pmt$program_name,
      validated_name: ost$name,
      ignore_file: clt$file,
      ignore_path: amt$path_name,
      ignore_found: boolean,
      str: ^string ( * );

    PROCEDURE [INLINE] get_entry_point_reference (VAR name: pmt$program_name;
      VAR path: amt$file_reference);

      NEXT str: [static_label_item^.entry_point_name_length] IN static_label;
      name := str^;
      IF static_label_item^.entry_point_path_length > 0 THEN
        NEXT str: [static_label_item^.entry_point_path_length] IN static_label;
        path := str^;
      IFEND;
    PROCEND get_entry_point_reference;

    PROCEDURE [INLINE] get_name (VAR name: pmt$program_name);

      NEXT str: [static_label_item^.name_length] IN static_label;
      name := str^;
    PROCEND get_name;

    status.normal := TRUE;
    attributes_are_compatible := TRUE;

    static_label := p_static_label; {assign seq ptr to local variable}

    IF static_label <> NIL THEN
      RESET static_label;
      NEXT checksum IN static_label;
      IF checksum = NIL THEN
        osp$set_status_abnormal (amc$access_method_id,
              ame$damaged_file_attributes,
              'BAD LABEL DETECTED in srp$validate_attributes', status);
        RETURN;
      IFEND;
      NEXT header IN static_label;
      IF header^.unique_character <> fmc$unique_label_id THEN
        osp$set_status_abnormal (amc$access_method_id,
              ame$damaged_file_attributes,
              'INVALID STATIC LABEL DETECTED in srp$validate_attributes',
              status);
        RETURN;
      IFEND;
      IF header^.file_previously_opened THEN
        IF NOT ((1 <= header^.ring_attributes.r1) AND
              (header^.ring_attributes.r1 <= header^.
              ring_attributes.r2) AND (header^.ring_attributes.r2
              <= header^.ring_attributes.r3) AND (header^.
              ring_attributes.r3 <= 13)) THEN
          attributes_are_compatible := FALSE;
        IFEND;
      IFEND;
      IF header^.highest_attribute_present > 0 THEN
        attribute_key := fmc$average_record_length;
        WHILE (attribute_key <= header^.highest_attribute_present) AND
              (attributes_are_compatible) DO
          CASE attribute_key OF
          = fmc$block_type =
            IF header^.attribute_present [fmc$block_type] THEN
              NEXT static_label_item: [fmc$block_type] IN static_label;
              IF (static_label_item^.block_type < LOWERVALUE (amt$block_type))
                    OR (static_label_item^.block_type > UPPERVALUE
                    (amt$block_type)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$character_conversion =
            IF header^.attribute_present [fmc$character_conversion] THEN
              NEXT static_label_item: [fmc$character_conversion] IN
                    static_label;
              IF (static_label_item^.character_conversion < LOWERVALUE
                    (boolean)) OR (static_label_item^.character_conversion >
                    UPPERVALUE (boolean)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$clear_space =
            IF header^.attribute_present [fmc$clear_space] THEN
              NEXT static_label_item: [fmc$clear_space] IN static_label;
              IF (static_label_item^.clear_space < LOWERVALUE
                    (ost$clear_file_space)) OR (static_label_item^.clear_space
                    > UPPERVALUE (ost$clear_file_space)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$file_access_procedure =
            IF header^.attribute_present [fmc$file_access_procedure] THEN
              NEXT static_label_item: [fmc$file_access_procedure] IN
                    static_label;
              get_entry_point_reference (fap_name, ignore_path);
              clp$validate_name (fap_name, validated_name,
                    attributes_are_compatible);
            IFEND;
          = fmc$file_contents =
            IF header^.attribute_present [fmc$file_contents] THEN
              NEXT static_label_item: [fmc$file_contents] IN static_label;
              get_name (file_contents);
              clp$validate_name (file_contents, validated_name,
                    attributes_are_compatible);
            IFEND;
          = fmc$file_limit =
            IF header^.attribute_present [fmc$file_limit] THEN
              NEXT static_label_item: [fmc$file_limit] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$file_organization =
            IF header^.attribute_present [fmc$file_organization] THEN
              NEXT static_label_item: [fmc$file_organization] IN static_label;
              IF (static_label_item^.file_organization < LOWERVALUE
                    (amt$file_organization)) OR (static_label_item^.
                    file_organization > UPPERVALUE (amt$file_organization))
                    THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$file_processor =
            IF header^.attribute_present [fmc$file_processor] THEN
              NEXT static_label_item: [fmc$file_processor] IN static_label;
              get_name (file_processor);
              clp$validate_name (file_processor, validated_name,
                    attributes_are_compatible);
            IFEND;
          = fmc$file_structure =
            IF header^.attribute_present [fmc$file_structure] THEN
              NEXT static_label_item: [fmc$file_structure] IN static_label;
              get_name (file_structure);
              clp$validate_name (file_structure, validated_name,
                    attributes_are_compatible);
            IFEND;
          = fmc$forced_write =
            IF header^.attribute_present [fmc$forced_write] THEN
              NEXT static_label_item: [fmc$forced_write] IN static_label;
              IF (static_label_item^.forced_write < LOWERVALUE
                    (amt$forced_write)) OR (static_label_item^.forced_write >
                    UPPERVALUE (amt$forced_write)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$internal_code =
            IF header^.attribute_present [fmc$internal_code] THEN
              NEXT static_label_item: [fmc$internal_code] IN static_label;
              IF (static_label_item^.internal_code < LOWERVALUE
                    (amt$internal_code)) OR (static_label_item^.internal_code >
                    UPPERVALUE (amt$internal_code)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$label_type =
            IF header^.attribute_present [fmc$label_type] THEN
              NEXT static_label_item: [fmc$label_type] IN static_label;
              IF (static_label_item^.label_type < LOWERVALUE (amt$label_type))
                    OR (static_label_item^.label_type > UPPERVALUE
                    (amt$label_type)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$line_number =
            IF header^.attribute_present [fmc$line_number] THEN
              NEXT static_label_item: [fmc$line_number] IN static_label;
              IF (static_label_item^.line_number.length < LOWERVALUE
                    (amt$line_number_length)) OR (static_label_item^.
                    line_number.length > UPPERVALUE (amt$line_number_length))
                    OR (static_label_item^.line_number.location < LOWERVALUE
                    (amt$line_number_location)) OR (static_label_item^.
                    line_number.location > UPPERVALUE
                    (amt$line_number_location)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$max_block_length =
            IF header^.attribute_present [fmc$max_block_length] THEN
              NEXT static_label_item: [fmc$max_block_length] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (bat$v1_max_block_length)) OR (static_label_item^.integer_value
                    > UPPERVALUE(bat$v1_max_block_length)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$max_record_length =
            IF header^.attribute_present [fmc$max_record_length] THEN
              NEXT static_label_item: [fmc$max_record_length] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$min_block_length =
            IF header^.attribute_present [fmc$min_block_length] THEN
              NEXT static_label_item: [fmc$min_block_length] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$min_record_length =
            IF header^.attribute_present [fmc$min_record_length] THEN
              NEXT static_label_item: [fmc$min_record_length] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$padding_character =
            IF header^.attribute_present [fmc$padding_character] THEN
              NEXT static_label_item: [fmc$padding_character] IN static_label;
              IF (static_label_item^.padding_character < LOWERVALUE
                    (static_label_item^.padding_character)) OR
                    (static_label_item^.padding_character > UPPERVALUE
                    (static_label_item^.padding_character)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$page_format =
            IF header^.attribute_present [fmc$page_format] THEN
              NEXT static_label_item: [fmc$page_format] IN static_label;
              IF (static_label_item^.page_format < LOWERVALUE
                    (amt$page_format)) OR (static_label_item^.page_format >
                    UPPERVALUE (amt$page_format)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$page_length =
            IF header^.attribute_present [fmc$page_length] THEN
              NEXT static_label_item: [fmc$page_length] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$page_width =
            IF header^.attribute_present [fmc$page_width] THEN
              NEXT static_label_item: [fmc$page_width] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$preset_value =
            IF header^.attribute_present [fmc$preset_value] THEN
              NEXT static_label_item: [fmc$preset_value] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$record_type =
            IF header^.attribute_present [fmc$record_type] THEN
              NEXT static_label_item: [fmc$record_type] IN static_label;
              IF (static_label_item^.record_type < LOWERVALUE
                    (amt$record_type)) OR (static_label_item^.record_type >
                    UPPERVALUE (amt$record_type)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$statement_identifier =
            IF header^.attribute_present [fmc$statement_identifier] THEN
              NEXT static_label_item: [fmc$statement_identifier] IN
                    static_label;
              IF ((static_label_item^.statement_identifier.length < LOWERVALUE
                    (amt$statement_id_length)) OR (static_label_item^.
                    statement_identifier.length > UPPERVALUE
                    (amt$statement_id_length)) OR (static_label_item^.
                    statement_identifier.location < LOWERVALUE
                    (amt$statement_id_location)) OR (static_label_item^.
                    statement_identifier.location > UPPERVALUE
                    (amt$statement_id_location))) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$user_info =
            IF header^.attribute_present [fmc$user_info] THEN
              NEXT static_label_item: [fmc$user_info] IN static_label;
              IF static_label_item^.user_info_present THEN
                NEXT str: [32] IN static_label;
              IFEND;
            IFEND;
          = fmc$vertical_print_density =
            IF header^.attribute_present [fmc$vertical_print_density] THEN
              NEXT static_label_item: [fmc$vertical_print_density] IN
                    static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$average_record_length =
            IF header^.attribute_present [fmc$average_record_length] THEN
              NEXT static_label_item: [fmc$average_record_length] IN
                    static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$collate_table =
            IF header^.attribute_present [fmc$collate_table] THEN
              NEXT static_label_item: [fmc$collate_table] IN static_label;
            IFEND;
          = fmc$collate_table_name =
            IF header^.attribute_present [fmc$collate_table_name] THEN
              NEXT static_label_item: [fmc$collate_table_name] IN static_label;
              get_entry_point_reference (collate_table_name, ignore_path);
              IF collate_table_name <> osc$null_name THEN
                clp$validate_name (collate_table_name, validated_name,
                      attributes_are_compatible);
              IFEND;
            IFEND;
          = fmc$compression_procedure_name =
            IF header^.attribute_present [fmc$compression_procedure_name] THEN
              attributes_are_compatible := FALSE;
            IFEND;
          = fmc$data_padding =
            IF header^.attribute_present [fmc$data_padding] THEN
              NEXT static_label_item: [fmc$data_padding] IN static_label;
              IF (static_label_item^.data_padding < LOWERVALUE
                    (amt$data_padding)) OR (static_label_item^.data_padding >
                    UPPERVALUE (amt$data_padding)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$dynamic_home_block_space =
            IF header^.attribute_present [fmc$dynamic_home_block_space] THEN
              attributes_are_compatible := FALSE;
            IFEND;
          = fmc$embedded_key =
            IF header^.attribute_present [fmc$embedded_key] THEN
              NEXT static_label_item: [fmc$embedded_key] IN static_label;
              IF (static_label_item^.embedded_key < LOWERVALUE (boolean)) OR
                    (static_label_item^.embedded_key > UPPERVALUE (boolean))
                    THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$estimated_record_count =
            IF header^.attribute_present [fmc$estimated_record_count] THEN
              NEXT static_label_item: [fmc$estimated_record_count] IN
                    static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$hashing_procedure_name =
            IF header^.attribute_present [fmc$hashing_procedure_name] THEN
              attributes_are_compatible := FALSE;
            IFEND;
          = fmc$index_levels =
            IF header^.attribute_present [fmc$index_levels] THEN
              NEXT static_label_item: [fmc$index_levels] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$index_padding =
            IF header^.attribute_present [fmc$index_padding] THEN
              NEXT static_label_item: [fmc$index_padding] IN static_label;
              IF (static_label_item^.index_padding < LOWERVALUE
                    (amt$index_padding)) OR (static_label_item^.index_padding >
                    UPPERVALUE (amt$index_padding)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$initial_home_block_count =
            IF header^.attribute_present [fmc$initial_home_block_count] THEN
              attributes_are_compatible := FALSE;
            IFEND;
          = fmc$key_length =
            IF header^.attribute_present [fmc$key_length] THEN
              NEXT static_label_item: [fmc$key_length] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$key_position =
            IF header^.attribute_present [fmc$key_position] THEN
              NEXT static_label_item: [fmc$key_position] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$key_type =
            IF header^.attribute_present [fmc$key_type] THEN
              NEXT static_label_item: [fmc$key_type] IN static_label;
              IF (static_label_item^.key_type < LOWERVALUE (amt$key_type)) OR
                    (static_label_item^.key_type > UPPERVALUE (amt$key_type))
                    THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$loading_factor =
            IF header^.attribute_present [fmc$loading_factor] THEN
              attributes_are_compatible := FALSE;
            IFEND;
          = fmc$lock_expiration_time =
            IF header^.attribute_present [fmc$lock_expiration_time] THEN
              attributes_are_compatible := FALSE;
            IFEND;
          = fmc$logging_options =
            IF header^.attribute_present [fmc$logging_options] THEN
              attributes_are_compatible := FALSE;
            IFEND;
          = fmc$log_residence =
            IF header^.attribute_present [fmc$log_residence] THEN
              attributes_are_compatible := FALSE;
            IFEND;
          = fmc$record_limit =
            IF header^.attribute_present [fmc$record_limit] THEN
              NEXT static_label_item: [fmc$record_limit] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          = fmc$records_per_block =
            IF header^.attribute_present [fmc$records_per_block] THEN
              NEXT static_label_item: [fmc$records_per_block] IN static_label;
              IF (static_label_item^.integer_value < LOWERVALUE
                    (static_label_item^.integer_value)) OR (static_label_item^.
                    integer_value > UPPERVALUE (static_label_item^.
                    integer_value)) THEN
                attributes_are_compatible := FALSE;
              IFEND;
            IFEND;
          ELSE
            attributes_are_compatible := FALSE;
          CASEND;
          attribute_key := attribute_key + 1;
        WHILEND;
      IFEND;
    IFEND;

  PROCEND srp$validate_attributes;

MODEND srm$validate_compatibility;
