If you specify the key as job name plus date plus time and sort descending
and keep only 1, DFSORT should give you what you want.

> -----Original Message-----
> From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On
> Behalf Of Lizette Koehler
> Sent: Friday, July 24, 2020 11:25 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Help with technique to identify data for last time/date an event
occurred
> 
> I have the following data
> 
> 
> 
> 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
> 
> 
> 
> 
> 
> I am not sure what would be the best way to get the following output
> 
> 
> 
> I just want the job (plus details) from the last run.  So if a job name
runs
> 10 times, what is the very last time it ran
> 
> 
> 
> JOB123    123456  22Jul2020    1000           0
> 
> JOB123B  125656  22Jul2020    1325           0
> 
> JOB123C  120956  22Jul2020    1300           0
> 
> JOB123D  121756  22Jul2020    2300           0
> 
> 
> 
> 
> 
> I can put it in an Excel and possibly use LAST or MIN/MAX functions
> 
> 
> 
> I can probably code REXX to do this
> 
> 
> 
> Maybe even DFSORT/ICETOOL
> 
> 
> 
> 
> 
> Just not sure what would be the easiest.  I will have several million
> entries where I just need the last time a specific job ran.
> 
> 
> 
> 
> 
> 
> 
> Thanks
> 
> 
> 
> 
> 
> 
> ----------------------------------------------------------------------
> 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

Reply via email to