I have the following requirement. I have one input file which has the following type of records.
1. Header records have first byte as H.
2. Detail records have first byte as D.
3. Trailer records have first byte as T.
The requirement is to just count number of records seperately header, detail and trailer records in the input file using SORT.
I want just counts of header, detail and trailer records in the input file.
if Input is:
Hxxxxxx
Htttttt
Hyyyyyyy
Dddddddd
Deeeeeee
Dffffffff
Dgggggg
Deeeeee
Tnnnnn
Tbbbbb
My output should be as follows and it should be directed to SYSOUT or to a DATASET:
No. of Header Records in input file : 3
No. of Detail Records in input file : 5
No. of Trailer Records in input file : 2
Can we do it using DFSORT/SYNCSORT......as I should use DFSORT/SYNCSORT only.....
One more thing...how to remove the 1 before RECORDS in the output....
Pavan
ICETOOL and SYNCTOOL ARE sort components,
what' s wrong in using them ?? ...
don' t tell me that those are corporate directives :-)
I might make some comments on people stupidity and incompetence...
since You asked for a "SYSOUT" dataset, the first byte of SYSOUTs is
by tradition the printer control character, the 1 means skip to new page
//SYSIN DD *
SORT FIELDS=(1,1,CH,A)
OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),
OVERLAY=(C'NO. OF RECORDS IN HEADER :')),
IFTHEN=(WHEN=(1,1,CH,EQ,C'D'),
OVERLAY=(C'NO. OF RECORDS IN DETAIL :')),
IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),
OVERLAY=(C'NO. OF RECORDS IN TRAILER :'))
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,27,
TRAILER3=(1,27,30:COUNT=(EDIT=(IIIIT))))
/*