The redshift-space two-point correlation functionof galaxy groups in the CfA2 and SSRS2 surveys