I'm trying to filter out some records from a PS based on some conditions. I have written a sort card for that but I also want to have the filtered out records in a separate file. I am not able to get all the filtered out triggers in my second file.
Just off the top of my head, I would assume that the SUM FIELDS=NONE will effectively remove duplicate records from BOTH output files, meaning that yes, you may not see ALL filtered out records in OUT2 - those with duplicate sort fields will be eliminated due to the SUM FIELDS=NONE.
DFSORT processes your control statements in the following order:
So the summed records will indeed be removed before OUTFIL sees them.
It's not clear what you're really trying to do. Please show an example of the records in your input file (relevant fields only) and what you expect for the output files. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field.