select distinct
    d00.nr01  as t_nr01,
    d00.p19   as t_p19,
    d00.p2   as t_p2,
    d00.p3   as t_p3,
    d00.p0114 as t_p0114,
    d00.p0115 as t_p0115,
    d00.p0116 as t_p0116,
    d00.p900  as t_ucode,
    '' as t_text,
    us0.p100  as t_uname,
    us5.pc101 as t_umail,
    us5.pc105 as t_uphone,
    us5.pc106 as t_umobile,
 
    {np_mhn}  as t_msg,
    {np_type} as t_type,
    {peg_str1}.p01   as t_p11,
    {peg_str1}.p04   as t_p2

FROM {peg_str1}, d00
LEFT JOIN us0 ON us0.p01=d00.p900
LEFT JOIN us5 ON us5.p01=d00.p900
WHERE d00.nr01={peg_str1}.p00
   && {peg_str2}
   && {p_ascwhere} ;
