I am using SYNCSORT FOR Z/OS 1.3.2.1R. I need to re-create the Header and trailer(elimate the duplicates) for a set of detailed records
RECFM=FB and LRECL=80
However.....its abending showing error near the COUNT in the Header. Can we use the COUNT parameter in the HEADER field or is it limited to TRAILER alone?
Arun,
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.
Gerry,
Here is the sysout.
Code:
SYSIN :
SORT FIELDS=(2,10,CH,A)
OMIT COND=(1,1,CH,EQ,C'H',OR,1,1,CH,EQ,C'T')
OUTFIL FILES=OUT,REMOVECC,
HEADER1=(1:C'H',2:DATENS=(4MD),COUNT=(M11,LENGTH=9)),
*
TRAILER1=(1:C'T',COUNT=(M11,LENGTH=9))
OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,
BUILD=(80X),
TRAILER1=('NEWCT,''',COUNT=(M11,LENGTH=9),C'''')
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
Quote:
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: 19243 Location: Inside the Matrix
Hello,
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
[Rant]
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.
[/Rant]
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
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.....
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Possibly i read this wrong, but sounded like the data was created in one "pass" and the the first record was then re-read and updated directly with no additional reading of the rest of the records.
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.