zOs/SQL/PVM77

select
            char(mon) || '; '
         || arbid || '; '
         || char(sum(erstPag#)) || '; '
         || char(sum(erstCou#))
    from
        (select
                year(ldatum) * 100 + month(lDatum) as mon,
                left(erstJob,4) arbid,
                erstPag#,
                erstCou#
            from OA1T.vpv013a1a
            where mandant = '0034'
                and left(erstJob,2)
                    in ('W0', 'W1', 'W2', 'W3', 'W4', 'W5')
                and lDatum between '20050601' and  '20050631'
        ) t1
    group by      arbid , mon
    order by      arbid , mon