haneef wrote:FILE AMZ6P VS UPDATE
If your task is putting headers and trailers onto a file, we'd have to know if there is other data already on the file. If the VSAM file is a KSDS, already populated, to get your header at the front of the file, you'd need to use WRITE ADD, not PUT, and the same with the trailer (unless you sequentially read all the records on the file until EOF, then the PUT would work for the trailer).
Of course, you could delete/define the file before your ETP runs, but then the file should be defined as VS CREATE, not VS UPDATE.
The unwanted data in your file could simply be from previous runs of your program. We'd need to know how your VSAM file is defined. I really don't know what a PUT would do on a KSDS without some other IO function first (READ, POINT, GET).