Hello,
Couple of queries:
a. Which SORT product you have: DFSORT or SYNCSORT; the solution provided by Mr. ottoelflaco is a SYNCSORT solution going by the 'SUM FIELDS=NONE,XSUM' statement and will not work with DFSORT.
b. The time-stamp data start and end-position are not consistent for all records; can you please specify the column numbers where they start; or are your records of variable length?
c. The last line of your post is tad-bit confusing; when you say 'write only one record', do you mean you want only this one record written in output or the other two records with different value in field-1 as well:
Namrata_Singri wrote:it should write only one record in output file if the date and timestamp is same in input file like record3
(178 PQR 20160620 051122).
Coded
d. Do you want the header line preserved in output?
Namrata_Singri wrote:
Feild1 feild2 date(yyyymmdd) timestamp(hhmmss)
123 ABC 20160620 083938
123 ABC 20160620 053623
145 LMN 20160619 123456
145 LMN 20160620 116712
178 PQR 20160620 051122
178 PQR 20160620 051122
e. Do you want the final output to be sorted or do you want the original order preserved?
f. Lastly, your SORT keys vs your output do not match, for example - if your SORT key is Field-1, date and time-stamp, then both records for field-1 = 123, will be retained, as 'timestamp' is not duplicate there.
If the above queries pertaining to the SORT key are cleared, then this will require a simple SUM FIELDS=NONE; in case this does get a bit complicated, then an ICETOOL with DISCARD operator should give you what is needed.