*copyc OSD$DEFAULT_PRAGMATS
?? NEWTITLE := 'NOS/VE : Interactive Facility' ??
?? NEWTITLE := '  [XDCL] iip$report_logical_error' ??
MODULE iim$report_logical_error;

?? PUSH (LISTEXT := ON) ??
*copyc IIT$CONNECTION_DESCRIPTION
*copyc IIP$ASCII_170_TO_HEX
*copyc OST$STATUS
*copyc PMP$LOG
?? POP ??

?? TITLE := 'PROCEDURE [XDCL] iip$report_logical_error', EJECT ??

  PROCEDURE [XDCL] iip$report_logical_error (VAR msg:
    iit$input_supervisory_message);

    CONST
      legend_1 = 'Logical error:',
      legend_2 = 'Reason:    ',
      legend_3 = 'ABH:                ',
      legend_4 = 'WORD:                ';

    VAR
      line: string (60),
      i: integer,
      status: ost$status;

{ Log the kind of error report that is to follow

    line (1, 14) := legend_1;
    pmp$log (line (1, 14), status);

{ Log the logical error reason code

    line (1, 11) := legend_2;
    STRINGREP (line (8, 4), i, msg.errlgl_reason);
    pmp$log (line (1, 11), status);

{ Log the hex representation of the bad block header

    line (1, 20) := legend_3;
    iip$ascii_170_to_hex (msg.errlgl_bad_header, line (6, 15));
    pmp$log (line (1, 20), status);

{ Log the hex representation of the first word of the bad block

    line (1, 21) := legend_4;
    iip$ascii_170_to_hex (msg.errlgl_first_word_of_block, line (7, 15));
    pmp$log (line (1, 21), status);

  PROCEND iip$report_logical_error;
MODEND
