
database engdb end

output
  page length 66
  top margin 5
  bottom margin 3
  left margin 0

{xxx customize here xxx}
{report to "/s1/users/smlieu/chron/bugs/reports/open.infx"}

end

select 
       gnats.gnatsid        pid, 
       gnats.category      pcat, 
       gnats.synopsis      psyn, 
       gnats.severity      psev, 
       o_gnats.gnatsstate   ostate,
       old.stateStr       oldstr, 
       new.stateStr       newstr,
       sevstr
  from gnats, 
       o_gnats, 
       stateCode          old, 
       stateCode          new, 
       severityCode
  where (o_gnats.gnatsid = gnats.gnatsid and
         o_gnats.gnatsstate <> gnats.gnatsstate) and
         o_gnats.gnatsstate = old.stateNum and
           gnats.gnatsstate = new.stateNum and
           gnats.severity  = severityCode.sevNum
  order by pcat, ostate
end

format
  page header

{xxx customize here xxx}
    print column 1, "*** GNATS SUMMARY - STATE CHANGES for week ending ",
          column 42, date,
          column 55, " ***",
          column 100, "Page", pageno
    skip 2 lines

    print column  3, "PR #", 
          column 15, "Program",
          column 27, "Severity",
          column 43, "From State",
          column 55, "To State",
          column 67, "Synopsis"
    skip 1 line

on every row 
  print column  3, pid clipped,
        column 15, pcat clipped,
        column 27, sevstr clipped,
        column 43, oldstr clipped,
        column 55, newstr clipped, 
        column 67, psyn

end
