Hi Enricho
My requirement is as follows
There is an input file with header identified with first two bytes as zero (s9(04 ) comp), then detailed record with first two bytes as a non zero value (partition number s9(04) comp) then trailer record as 999 as the first two bytes with record count starting at position 11 (s9(09) comp). The record length of the file is 34. I have to concatenate 2 input files and get output file with one header, set of detailed records sorted in ascending order using first 2 bytes then trailer updated with correct record count from the two files. I tried to arrive at the below sort card to work in V1.R10. But not yielding the result

as I am not much familiar with DFSORT.
SORT FIELDS=(1,2,BI,A)
INCLUDE COND=(1,2,BI,NE,0)
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(35:SEQNUM,04,BI)),
IFTHEN=(WHEN=(1,2,PD,EQ,999),
OVERLAY=(11:35,04,BI,SUB,2,TO=BI,LENGTH=04))
The output file that I get is not having header record. It gives me two 999 records at the end.
Quick response will be very much helpful as we have a code move up tonight.
Thanks in advance
Prasanna G.