Someone might be able to offer a suggestion, but more information might be required. For instance, is this process to be used in a Gendata/Genprint type (batch) run or are you describing an interactive (IDS/DocServer, ala Web enabled) solution? Those would be completely different situations where you are trying to count transactions and output. If it is a batch setup, please describe which components you actually run. For instance, Gentran/Gendata/Genprint; or Gendata/GenPrint; or just Gendata as a single step. The combination that you use probably offers different opportunities to obtain the information you seek.
This is required for Gendata/Genprint type (batch) run.
We run gentnw32, gendaw32 and genptw32.(Gentran/Gendata/Genprint)
I'm still not sure there is enough information to offer a complete answer. After a Gendata run, you will normally have what is called a NEWTRN (new tran) file - typically with a .DAT extension. All of the transactions that passed in will be listed there. Typically, the SentToManualBatch column of that file can be used to determine that transactions were batched successfully; or show 'M' for transactions that will be sent to WIP (the manual batch); or 'E' for transactions sent to the error batch. The actual "batch" (BCH) files will contain the transactions with specific recipient codes. If you have multiple recipients for each transaction, then there will be multiple records per transaction. That's why counting the records in the NewTrn file is probably more appropriate if all you care about is the total transaction count.