I have around 10 gdg's. I need to concatinate using sort under following condition.
All of my files will have a header and trailer record.I need to skip copying file if trailer records contain total record count as 0000.
It's not clear what you mean by this. If you need more help with it, please show an example of the records in your input files and what you expect for output, and explain the "rules" for getting from input to output.
Also give the RECFM and LRECL of the input files, and the starting position, length and format of all relevant fields (e.g. the 'TRAILER' identifier and the count field).
The record type is as follows
Record format . . . : VB
Record length . . . : 579
The problem is if any of the above generations is having only header and trailer record the job gets abended (i.e., The trailer record contains 000000 as no of records). I have manually browse each of latest generation for above gdg's and if its empty comment it out in job manually.
Now i want to add a step before this using ICETOOL to do this check automatically and create a file which i can use here as input in this step. I am just trying to put a condition in sort which will copy data from current generation to new output file only if trailer record contains value >0. This chekking has to be done to all the above generations and there will be a single output merge file which i can use as input to current step.
I hope i am clear please let me know in case if you have any questions
Thank you for the reply, Presently thats what i am planning to do. The only problem i see in this approach is i need to have 9 steps seperately for all the gdg's.
I am checking if there are any other better solutions to this problem or some how i can reduce the amount of code in this solution?
how i can reduce the amount of code in this solution
I doubt you can reduce the amount of code. Frank has used just 3 lines which can be saved in 2 datasets (or 2 PDS members). All that needs to change from step to step is the DSN and you could maybe use variable substitution in a procedure to reduce the coding of this.