rgssources is usually first invoked within the PCMS or within rgsproc. In PCMS usage the command should be
rgssources filemode=create srclist=rgssrclist.ds<or whatever> atthkset=<att hist file> enablefilter=yes withepicset=yes epicset=<epic source list> instrument=<rgs1 or 2> exposure=<exposure number> primestyle=auto
enablefilter ensures that only epic sources within the RGA filed of view are selected; primestyle=auto forces rgssources to choose a prime source within the field of view. At present, given primestyle=auto, the proposal source is chosen if it is within the field of view; the brightest in-field epic source if not; with the pointing position as a final fallback.