Quoting Mr. Boyo's reponse to your last post on this forum wherein you pointed out TRAILER1 worked without BUILD
BillyBoyo wrote:That is because your records present to OUTFIL are at least 36 bytes long. If your OUTFIL records are shorter than the HEADERn/TRAILERn output, you get a run-time failure.
Now, this is where BUILD is actually helpful- it helps you Build your output in the desired format
; Change your OUTFIL to below code, and see what happens:
Note: There are other ways of doing this too, for example tweaking the data with INREC and so on.