The REXX snippet below should provide what you need.
I appended TEST to do a syntax check, since I did not want to load the Agent Definition file.
Agent definition file is delimited by leading and trailing pairs(2) of single tick marks(single quotes)
You could repeat the code for the second command or concatenate the 2 commands and use a semi-colon as a delimiter.
Z=OUTTRAP('LINE.')
'NEWSTACK'
QUEUE 'LOADAGDF ''PRODUC.CYBER.ESPPARM(AGENTDEF)'' TEST' /* TEST used for syntax checking */
QUEUE 'END'
ADDRESS TSO "ESP SUB(<ESP ID>)" /* Replace <ESP ID> with correct value */
'DELSTACK'
Z=OUTTRAP('OFF')
DO I = 1 TO LINE.0
SAY LINE.I
END
When I run it on my system I get the following output:
Agent Definition Table test has been correctly processed