You could concatentate all your 22 datasets on SORTIN.
I would split the task into two parts. Firstly all the detail records on one dataset and the trailers on a seperate one.
From the detail records, I'd generate new trailer records.
I'd SUM the original trailers.
Extract the new trailers.
Compare the new trailers to the summerd original trailers.
This approach should ensure correct trailers, and identify any problems already existing.
You would need to identify from each detail record which trailer it is to be added to.
If you are totally secure with the existing contents of the trailers, you could ignore the generation of new trailers and the checking. Split the files as above, SUM the trailers and then do a SORT COPY with the two new files concatenated on the SORTIN.
If you want that approach in one step (maybe your files are huge), check out your documentation of Synctool.