Re: Help with technique to identify data for last time/date an event occurred
%let macfile= %QUOTE( IF ID=30 and subtype=5; ) ; %include sourclib(type30); PROC SORT DATA=TYPE30_5; BY JOB DESCENDING READTIME; DATA TIMES; BY JOB; IF FIRST.JOB THEN PUTLOG JOB= JESNR= READTIME= TERMTIME= ABEND=; Barry -Original Message- From: IBM Mainframe Discussion List On Behalf Of Lizette Koehler Sent: Friday, July 24, 2020 1:25 PM 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 JOB123123456 22Jul20201000 0 JOB123123356 22Jul2020 0 JOB123120056 22Jul20200100 0 JOB123A 121156 22Jul20201300 0 JOB123B 122356 22Jul20200100 0 JOB123B 125656 22Jul20201325 0 JOB123C 120956 22Jul20201300 0 JOB123D 121756 22Jul20202300 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 JOB123123456 22Jul20201000 0 JOB123B 125656 22Jul20201325 0 JOB123C 120956 22Jul20201300 0 JOB123D 121756 22Jul20202300 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
Re: Help with technique to identify data for last time/date an event occurred
W dniu 25.07.2020 o 00:34, Paul Gilmartin pisze: On Fri, 24 Jul 2020 12:40:17 -0700, Sri h Kolusu wrote: //SYSINDD * OPTION SKIPREC=1 $ SKIP HEADER INREC OVERLAY=(81:23,4,UFF,EDIT=(), $ YEAR 20,3,CHANGE=(2,C'JAN',C'01', $ MONTH TO NUM C'FEB',C'02', C'MAR',C'03', ... If one has control over the input format, one can simplify coding by requiring the *standard* ISO 8601 format for dates. https://xkcd.com/1179/ ISO 8601 also mitigates the burden of locale-sensitive coding. Sometimes we have no power to demand standard coding for dates. In such cases DFSORT is good tool to solve it. In the past I created DFSORT procedure to sort days of week, polish names of course Proper order is: poniedziałek wtorek środa czwartek piątek sobota niedziela (translation: monday, tuesday... sunday). BTW: american way of coding dates is the proof nobody's perfect. mm/dd/yy? Who invented it??? It's even more messed up than baseball game! ;-) -- Radoslaw Skorupka Lodz, Poland == Jeśli nie jesteś adresatem tej wiadomości: - powiadom nas o tym w mailu zwrotnym (dziękujemy!), - usuń trwale tę wiadomość (i wszystkie kopie, które wydrukowałeś lub zapisałeś na dysku). Wiadomość ta może zawierać chronione prawem informacje, które może wykorzystać tylko adresat.Przypominamy, że każdy, kto rozpowszechnia (kopiuje, rozprowadza) tę wiadomość lub podejmuje podobne działania, narusza prawo i może podlegać karze. mBank S.A. z siedzibą w Warszawie, ul. Senatorska 18, 00-950 Warszawa,www.mBank.pl, e-mail: kont...@mbank.pl. Sąd Rejonowy dla m. st. Warszawy XII Wydział Gospodarczy Krajowego Rejestru Sądowego, KRS 025237, NIP: 526-021-50-88. Kapitał zakładowy (opłacony w całości) według stanu na 01.01.2020 r. wynosi 169.401.468 złotych. If you are not the addressee of this message: - let us know by replying to this e-mail (thank you!), - delete this message permanently (including all the copies which you have printed out or saved). This message may contain legally protected information, which may be used exclusively by the addressee.Please be reminded that anyone who disseminates (copies, distributes) this message or takes any similar action, violates the law and may be penalised. mBank S.A. with its registered office in Warsaw, ul. Senatorska 18, 00-950 Warszawa,www.mBank.pl, e-mail: kont...@mbank.pl. District Court for the Capital City of Warsaw, 12th Commercial Division of the National Court Register, KRS 025237, NIP: 526-021-50-88. Fully paid-up share capital amounting to PLN 169.401.468 as at 1 January 2020. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Help with technique to identify data for last time/date an event occurred
On Fri, 24 Jul 2020 12:40:17 -0700, Sri h Kolusu wrote: > >//SYSINDD * > OPTION SKIPREC=1 $ SKIP HEADER > INREC OVERLAY=(81:23,4,UFF,EDIT=(), $ YEAR >20,3,CHANGE=(2,C'JAN',C'01', $ MONTH TO NUM > C'FEB',C'02', > C'MAR',C'03', >... If one has control over the input format, one can simplify coding by requiring the *standard* ISO 8601 format for dates. https://xkcd.com/1179/ ISO 8601 also mitigates the burden of locale-sensitive coding. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Help with technique to identify data for last time/date an event occurred
Thank you very much -Original Message- From: IBM Mainframe Discussion List 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 22JUL20201300 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 22JUL20201000 0 JOB123 123356 22JUL2020 0 JOB123 120056 22JUL20200100 0 JOB123A 121156 22JUL20201300 0 JOB123B 122356 22JUL20200100 0 JOB123B 125656 22JUL20201325 0 JOB123C 120956 22JUL20201300 0 JOB123D 121756 22JUL20202300 0 //SORTOUT DD SYSOUT=* //SYSINDD * OPTION SKIPREC=1 $ SKIP HEADER INREC OVERLAY=(81:23,4,UFF,EDIT=(), $ 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 22JUL20201000 0 JOB123A 121156 22JUL20201300 0 JOB123B 125656 22JUL20201325 0 JOB123C 120956 22JUL20201300 0 JOB123D 121756 22JUL20202300 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
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 22JUL20201300 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 22JUL20201000 0 JOB123 123356 22JUL2020 0 JOB123 120056 22JUL20200100 0 JOB123A 121156 22JUL20201300 0 JOB123B 122356 22JUL20200100 0 JOB123B 125656 22JUL20201325 0 JOB123C 120956 22JUL20201300 0 JOB123D 121756 22JUL20202300 0 //SORTOUT DD SYSOUT=* //SYSINDD * OPTION SKIPREC=1 $ SKIP HEADER INREC OVERLAY=(81:23,4,UFF,EDIT=(), $ 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 22JUL20201000 0 JOB123A 121156 22JUL20201300 0 JOB123B 125656 22JUL20201325 0 JOB123C 120956 22JUL20201300 0 JOB123D 121756 22JUL20202300 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
Re: Help with technique to identify data for last time/date an event occurred
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 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 > > JOB123123456 22Jul20201000 0 > > JOB123123356 22Jul2020 0 > > JOB123120056 22Jul20200100 0 > > JOB123A 121156 22Jul20201300 0 > > JOB123B 122356 22Jul20200100 0 > > JOB123B 125656 22Jul20201325 0 > > JOB123C 120956 22Jul20201300 0 > > JOB123D 121756 22Jul20202300 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 > > > > JOB123123456 22Jul20201000 0 > > JOB123B 125656 22Jul20201325 0 > > JOB123C 120956 22Jul20201300 0 > > JOB123D 121756 22Jul20202300 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
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 JOB123123456 22Jul20201000 0 JOB123123356 22Jul2020 0 JOB123120056 22Jul20200100 0 JOB123A 121156 22Jul20201300 0 JOB123B 122356 22Jul20200100 0 JOB123B 125656 22Jul20201325 0 JOB123C 120956 22Jul20201300 0 JOB123D 121756 22Jul20202300 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 JOB123123456 22Jul20201000 0 JOB123B 125656 22Jul20201325 0 JOB123C 120956 22Jul20201300 0 JOB123D 121756 22Jul20202300 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