By default a batch program cannot do an EXFMT command because it does not have a DSPF opened.
I know there is a way to allocate one but it has been too many years and I do not remember how.
That being said, I would say you may have a bad design in your process.
What are you trying to do?
You can interact with a batch program in other ways, like messages, *DTAARA, and others.
Tell us what/why you are trying to do and you will get specific advice.