Thank you very much
-----Original Message----- From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of Sri h Kolusu Sent: Friday, July 24, 2020 12:40 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Help with technique to identify data for last time/date an event occurred Lizette, It is quite simple with DFSORT. Your output is missing the JOB123A 121156 22JUL2020 1300 record. Assuming that it is a typo, use the following DFSORT JCL The date field is at position 18 (day 18-19 month 20-22 year 23-26) //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * ----+----1----+----2----+----3----+----4----+----5----+ JOBN1 JOBNO DATE-RAN TIME-RAN CONDITION-CODE JOB123 123456 22JUL2020 1000 0 JOB123 123356 22JUL2020 0000 0 JOB123 120056 22JUL2020 0100 0 JOB123A 121156 22JUL2020 1300 0 JOB123B 122356 22JUL2020 0100 0 JOB123B 125656 22JUL2020 1325 0 JOB123C 120956 22JUL2020 1300 0 JOB123D 121756 22JUL2020 2300 0 //SORTOUT DD SYSOUT=* //SYSIN DD * OPTION SKIPREC=1 $ SKIP HEADER INREC OVERLAY=(81:23,4,UFF,EDIT=(TTTT), $ YEAR 20,3,CHANGE=(2,C'JAN',C'01', $ MONTH TO NUM C'FEB',C'02', C'MAR',C'03', C'APR',C'04', C'MAY',C'05', C'JUN',C'06', C'JUL',C'07', C'AUG',C'08', C'SEP',C'09', C'OCT',C'10', C'NOV',C'11', C'DEC',C'12'), NOMATCH=(C'00'), 18,2,UFF,EDIT=(TT)) $ DAY SORT FIELDS=(01,8,CH,A, $ JOBNAME 81,8,UFF,A, $ RUNDATE 31,4,UFF,A) $ RUNTIME OUTFIL REMOVECC,NODETAIL, BUILD=(80X), HEADER2=('JOBN1 JOBNO DATE-RAN TIME-RAN ', 'CONDITION-CODE'), SECTIONS=(1,8, TRAILER3=(1,80)) /* The output from the above job is JOBN1 JOBNO DATE-RAN TIME-RAN CONDITION-CODE JOB123 123456 22JUL2020 1000 0 JOB123A 121156 22JUL2020 1300 0 JOB123B 125656 22JUL2020 1325 0 JOB123C 120956 22JUL2020 1300 0 JOB123D 121756 22JUL2020 2300 0 Further if you have any questions please let me know Thanks, Kolusu DFSORT Development IBM Corporation ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN