?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Operator Facility : Report Status Error' ??
MODULE ofm$report_status_error;

{ PURPOSE:
{   This module writes a status message to the job log.

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
*copyc pmp$log
*copyc osp$unpack_status_condition

?? TITLE := 'ofp$report_status_error', EJECT ??

{ PURPOSE:
{   This procedure writes a status message to the job log.
{ DESIGN:
{   The format of the message is two lines. The first line is a
{   descriptive message on where the error occurred.  The second
{   line identifies the type of error by using the status_identifier
{   and status_condition of the passed status parameter.

  PROCEDURE [XDCL, #GATE] ofp$report_status_error
    (    error_status: ost$status;
         message: string ( * ));

    VAR
      identifier: ost$status_identifier,
      ignore_status: ost$status,
      log_message: ost$string,
      number: ost$status_condition_number,
      number_length: integer,
      number_string: string (10);

    { Write the message to the log.

    log_message.value := 'Status error on ';
    log_message.size := 16;
    log_message.value (log_message.size + 1, STRLENGTH (message)) := message;
    log_message.size := log_message.size + STRLENGTH (message);
    pmp$log (log_message.value (1, log_message.size), ignore_status);

    { Write the status identifier and condition code to the log.

    osp$unpack_status_condition (error_status.condition, identifier, number);
    STRINGREP (number_string, number_length, number);
    log_message.value := 'io=';
    log_message.size := 3;
    log_message.value (log_message.size + 1, #SIZE (identifier)) := identifier;
    log_message.size := log_message.size + #SIZE (identifier);
    log_message.value (log_message.size + 1, 7) := '; cond=';
    log_message.size := log_message.size + 7;
    log_message.value (log_message.size + 1, number_length) := number_string;
    log_message.size := log_message.size + number_length;
    pmp$log (log_message.value (1, log_message.size), ignore_status);

  PROCEND ofp$report_status_error;
MODEND ofm$report_status_error;
