
  PROCEDURE [INLINE] bai$write_previous_block
    (    file_identifier: amt$file_identifier;
     VAR status: ost$status);

?? PUSH (LISTEXT := ON) ??

{ The purpose of this request is to cause the previous partial
{ block to be completed, then written to tape.  This is necessary
{ when a partial block has been started, but not completed
{ before repositioning or closing the file.

*copy bah$inline_proc_documentation

    CONST
      terminate_previous_block = TRUE;

    IF (tape_descriptor^.tape_attachment_information.record_type =
          amc$ansi_spanned) OR (tape_descriptor^.tape_attachment_information.
          record_type = amc$ansi_variable) THEN
      put_data (file_identifier, amc$put_next_req, NIL, 0, amc$terminate,
            terminate_previous_block, {convert_if_ebcdic} TRUE, status);
    ELSE
      put_data (file_identifier, amc$put_next_req, NIL, 0, amc$terminate,
            terminate_previous_block, {convert_if_ebcdic} FALSE, status);
    IFEND;

    gfi^.positioning_info.record_info.file_position := amc$eor;
    IF NOT status.normal AND (status.condition = ame$end_of_tape_op_completed)
          THEN
      status.normal := TRUE; {ignore EOT in this case}
    IFEND;

  PROCEND bai$write_previous_block;

*copyc amt$file_identifier
*copyc bat$task_file_table
*copyc ost$status
*copyc amt$call_block
?? POP ??
