Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
You will most likely have better(?) success if you write a program to do this.
If you search in the forum (COBOL, i believe) you will find code that retrieves the current dsn for the file being read. If you concatenate your input files and retrieve the dsn for each read, you will be able to create the report you describe as well as manage the totals you need. You will need to get the dsn each read to know when the dsn changes so it can be put in the "header".