
  PROCEDURE [INLINE] bai$put_record_header_for_putp;

    CASE call_block.putp.term_option OF
    = amc$start =
      IF start_of_data THEN
        rh.header_type := bac$start_record;
      ELSE
        rh.header_type := bac$continued_record;
      IFEND;

    = amc$continue =
      rh.header_type := bac$continued_record;

    = amc$terminate =
      IF gfi^.positioning_info.record_info.file_position = amc$mid_record THEN
        IF end_of_data THEN
          rh.header_type := bac$end_record;
        ELSE
          rh.header_type := bac$continued_record;
        IFEND;
      ELSE
        IF start_of_data THEN
          IF end_of_data THEN
            rh.header_type := bac$full_record;
          ELSE
            rh.header_type := bac$start_record;
          IFEND;
        ELSE
          IF end_of_data THEN
            rh.header_type := bac$end_record;
          ELSE
            rh.header_type := bac$continued_record;
          IFEND;
        IFEND;
      IFEND;
    ELSE
      amp$set_file_instance_abnormal (file_identifier,
            ame$improper_term_option, call_block.operation, ' ', status);
      RETURN; {----->
    CASEND;

    rh.length := put_size;
    rh.previous_header_fba := 0;
    rh.unique_id := bac$record_header_unique_id;

    put_data (file_identifier, operation, #LOC (rh), rhl, term_option,
          terminate_previous_block, {convert_if_ebcdic =} FALSE, status);

    IF status.normal THEN
      last_record_header_p := ^tape_descriptor^.
            put_tape_block_buffer^ [block_info^.current_block_byte_address +
            1 - rhl];
    IFEND;
    start_of_data := FALSE;

  PROCEND bai$put_record_header_for_putp;
