query that does functionality of listagg without use of it
You can use a recursive common table expression. I have used a tmp table to enumerate the employees:

with tmp (empname, department, rn) as (
        select empname, department
             , row_number() over (partition by department 
                                  order by empname) as rn 
        from employees
), cte (empname, department, rn) as ( 
        select cast(empname as varchar(100)) as empname
             , department, rn 
        from tmp 
        where rn = 1 
        union all 
        select rtrim(c.empname) || ', ' || t.empname
             , t.department, c.rn+1 
        from tmp t
           , cte c 
        where t.department = c.department 
          and c.rn + 1 = t.rn
) 
select empname, department 
from cte c1 
where rn = (select max(rn) 
            from cte c2 
            where c1.department = c2.department)