PROC log_terminated_task, logtt (
  task_name, tn: name = $required
  to, t: key job, system = job
  status)

  create_variable scratch kind=string value=$unique
  create_variable line kind=string

  display_message to=$value(to) m=' $!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$!$'
  display_message to=$value(to) m=' $!$!$     '//$string($value(task_name))//' terminated with'

  set_file_attributes $fname(scratch) fc=legible fs=data pf=continuous pw=$max_string
  display_value $task_status($value(task_name)) output=$fname(scratch)
  accept_line line input=$fname(scratch)
  detach_file $fname(scratch)
  display_message to=$value(to) m=line
  display_message to=$value(to) m=' $!$!$-------------------------------------------------------$!$!$'

PROCEND log_terminated_task
