I have not used triggers but upon checking the IBM site they can call a CLP program. You could call a CLP program with the trigger that submits a second CLP into the same job queue that the inital program is running and have that program clear the file. This will work in a single threaded job queue only.
If you a worried about the job cue being stacked up you could send the job to jobq Qctl with the CLP having a dlyjob command ahead of the clrpfm.
Because this is a trigger function, any submission to a job queue will regularly cause more trouble than desired. And if the trigger is CL and it accesses the file, or if the CLRPFM is intended to clear the file that was triggered, then it not only isn’t going to work but it also doesn’t make sense.
A file accessed by a CL program is always going to be in use until after the CLP ends. And by definition, a file is obviously ‘in use’ if a trigger is currently executing. A CLRPFM issued by a trigger against the triggered file is going to contradict the database logic of having a trigger program executing before control is returned to whatever processed invoked the trigger.
Whatever the reasoning is for this question, it needs to be significantly clarified before any reasonable answer can be given. At the moment, the question doesn’t make sense.