I have small issue, while updating count in Trailer record which is in declared Fixed dec(15,0).
In our shop we have only SORT, I read some articles which is related to trailer count, unfortunately not succeeded.
input file having header, detail and trailer records. Omit the some bad records, count the detail records and update to trailer record.
bad records criteria is OMIT COND=(52,1,CH,EQ,C'N')
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
1. Please use some better topic-titles. You've used the Forum name.
2. Second, Submit this Job and post us the SYSOUT, so we know, what SORT product you are using:
You should remember that ...
replying on a forum is
on voluntary base
on our own time
free of charge
therefore
there is no commitment on our side
there should be no expectation on Your side
You should also consider that many - too many - topics/issues have been debated to death
so many of us are getting tired of reposting the same info code snippets over and over
if You search the forum and look at the manuals You will find certainly what You look for
also looking at the DFSORT documents You might find solution easily portable to SYNCSORT
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You're nearly there, you just have not got the data propogated from one record to the next.
You do that with PUSH.
PUSH requires WHEN=GROUP.
WHEN=GROUP is processed after WHEN=INIT and before WHEN=(logical expression).
So, change your OUTREC to INREC and just set the sequence number as you have it (remove the IFOUTLEN).
On a new OUTREC, with the IFOUTLEN, use WHEN=GROUP to start at the detail record, with RECORDS=2, and PUSH the sequence number (can be done to the same posisition).
Then you should find your code for the trailer works.