Hi,
there is a number of virtual agent variables that contain information about the agent:
https://docs.automic.com/documentation/webhelp/english/AA/12.3/DOCU/12.3/Automic%20Automation%20Guides/help.htm#AWA/AdministrationPerspective/AG_Agent_Variables.htm
You can use a script like this to get the file name:
:SET &PATH#=GET_VAR(UC_EX_PATH_JOBREPORT,"<name of the agent>")
:SET &ID7#=RUNNR2ALPHA(<runid of the job>)
:SET &FILE#="&PATH#O&ID7#.TXT"
:PRINT &FILE#
Regards, Markus