It’s been a while for me too since working with EDI and TN, but I have notes from an old document that describes the TN can manage the control numbers.
When batching and enveloping, transaction set control numbers within a group always start at 1 and increment by 1 for each additional transaction set. Group and interchange control numbers use the EDI control number table managed by TN for each sender/receiver combination.
TN can manage this for you. I don’t think you need to use custom services to assign control numbers. But you will need to call the right services when creating the document/batch with the right parameters.
https://documentation.softwareag.com/webmethods/compendiums/v10-3/C_B2B_Integration/index.html#page/b2b-integration-compendium%2Fto-defining_control_num_info_3.html%23
The “I did this long ago” was before TN console was retired and its functions moved to MWS. So I cannot provide specific “look at these MWS pages” but I do know it is possible to set it up so that you do not need to manage the IC and group control numbers directly.
#Integration-Server-and-ESB#B2B-Integration#webMethods