You are missing the MAX(DSSEQ) in your select.
Try something like this
select distinct s.DSBLC, s.DSRMB,DOlnm, DOfnm, SGTXT, BDldd,s.DSUSR,s.maxseq from
(select DSBLC,DSRMB,BDLDD,DSUSR,max(DSSEQ) as maxseq from DSfill09
Group by DSBLC,DSRMB,BDLDD,DSUSR) s
join BDfil on BDBLC = s.DSBLC and BDRMB = s.DSRMB
join SGfil on SGBLC = s.DSBLC and SGRMB = s.DSRMB and SGseq = s.maxseq
join DOfil on DOBLC = s.DSBLC and DORMB = s.DSRMB and DOnum = 9
where DScde = '***' and DSdte = 061319 and SGtxt like '%XYZ:%EXTRACT%' and DStyp = 'R'
Order by DSBLC, DSRMB