That is a part of the requirement to have the count in the Header as well. Currently the program which creates this file is opening the file in I-O mode and re-writing the Header to have the count.
Here is the sysout.
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
I am looking to achieve this in a single pass.Any pointers will be real helpful.
Since the data is (probably) already in the sequence you need to count, do one pass as copy with the omits and generate the header and trailer as a two record trailer. Then re-sort to re-sequence the headers to their proper location.
Seems a more elegant solution than re-reading the file in i/o mode......
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
But still has to pass all of the data "again". . . I realize that lots of files are only a few records, but my "little" files are multi-million records. . . Extra passes/sorts of data are not my friend
Personally, i believe it is nonsense to require the total record count in the first record ("header" or otherwise) . . . But there are lots of nonsensical requirements.
Currently the OP is sortiing the entire file (pass one) and then (COBOL?) reading the entire file to get the trailer counts and rewriting the headers (pass two).
I would think that two sort passes would be a lot quicker than the one i/o pass.....
The existing process is
1.Table unload of the data.
2.Process the records in a cobol program which creates the header and trailer. The same program updates the header for the file in I-O mode in the end.
Both 1 and 2 are happening for a set of records using different selection process(Job1 thru 3) and getting concatenated as an input file to process in the subsquent job(Job4).
the input for this job will have multiple header and trailers with different counts in various files.
Before the job process this file i have to feed the updated count in the Header and Trailer.