But I think even if you dont give nX, spaces will be put after count till LRECL,correct me if wrong?
Ok, you're wrong. DFSORT does not pad the trailer record with blanks to the LRECL when the RECFM is VB.
The RECFM here is VB. That means each record has an RDW with a record length. When DFSORT writes the trailer record, it determines the length of the record and puts that in the RDW. So, for example, the trailer record might look like this:
That's a 15-byte record, so it could cause that error message.
If you add blanks to the end of the trailer record, then DFSORT adjusts the length of the record accordingly. So, for example, if you add 6 blanks (b) the record would look like this:
That's a 21-byte record, so it would not cause that error message.
Of course, I don't know what else is going on here since the OP didn't show the complete job, but adding blanks in TRAILER1 will increase the length of the trailer record to include the added blanks (and only the added blanks).