Formating and Parsing Autosys output

if you want to parse the output from an autosys you can use the below

autorep -j Prefix_% | awk '{
  if ($6 ~ /^[0-9]/)
    printf "%-20s \t\t  %-20s\n",$1,$5 ;
  else if ($6 ~ /^[A-Z]/)
    printf "%-20s \t\t  %-20s\n",$1,$6;
  else
    printf "%-20s \t\t  %-20s\n",$1,$4
}' | awk '{
  if ($2 ~ /FA|TE/ )
    printf "%-20s \t\t  %-20s\n",$1,$2;
}' | sort -rk2
 

This will give only the Failed and terminated jobs add SU instead of FA|TE to get ony the succeded jobs

Enjoy:b:

Please post the input and expected output using code tags, thanks.