rgssources is usually first invoked within the PCMS or within rgsproc. In PCMS usage the command should be
rgssources filemode=create instexpid=<instrument file> srclist=rgssrclist.ds<or whatever> attstyle=median medianset=<att hist file> withepicset=yes epicset=<epic source list> doconfusion=yes primestyle=auto flagepicsrcoutoffov=yes enablefilter=yes
enablefilter ensures that only epic sources within the RGA filed of view are selected (sources out of FOV are flagged); primestyle=auto forces rgssources to choose a prime source in arguably the most reasonable way (see section 3.5 for the outline of the criteria/algorithm or section 7 for the detailed algorithm).