Need to read only last half hour
Need to read only last half hour
(OP)
Good day to you all!
I have some REXX code that works for me right now, but I need it to work better. I am currently reading everything from a log file, and then sending that over TCP/IP to another product. Works great right now, except by the end of the day I am sending a ton of redundant data, like 50k lines worth of data that the other product has already received and digested. I would like to read only the last half hours worth of data in the log file, as I have an ESP job set to submit my JCl and REXX every fifteen minutes. This would give me some overlap, but nothing like what I have now.
Currently my code to read is:
/* Read all records from the MESSAGES DD into a stem variable */
"EXECIO * DISKR messages (STEM records."
return_code = RC
SAY records.0 ' records read'
Having trouble wrapping my brain around how to make this read only the last half hours worth of stuff. Any help would be greatly appreciated, as I am new to REXX.
I have some REXX code that works for me right now, but I need it to work better. I am currently reading everything from a log file, and then sending that over TCP/IP to another product. Works great right now, except by the end of the day I am sending a ton of redundant data, like 50k lines worth of data that the other product has already received and digested. I would like to read only the last half hours worth of data in the log file, as I have an ESP job set to submit my JCl and REXX every fifteen minutes. This would give me some overlap, but nothing like what I have now.
Currently my code to read is:
/* Read all records from the MESSAGES DD into a stem variable */
"EXECIO * DISKR messages (STEM records."
return_code = RC
SAY records.0 ' records read'
Having trouble wrapping my brain around how to make this read only the last half hours worth of stuff. Any help would be greatly appreciated, as I am new to REXX.
RE: Need to read only last half hour
CODE
Nic
RE: Need to read only last half hour
Nic
RE: Need to read only last half hour
RE: Need to read only last half hour
Another thing, how many records do you generate per 30 minutes? Give a reasonable maximum plus 10% extra.
Nic
RE: Need to read only last half hour
CODE --> rexx
Also note that the 3 variables t_strat, t_length and records_per_half_hour will need to be changed to reflect reality.
Also, no provision has been made for processing records across midnight. I am not going to worry myself about that. Let your local Rexx guru do it. It is, possibly, what he is paid to do. I am not.
Nic
RE: Need to read only last half hour
CODE --> jcl
CODE --> rexx
RE: Need to read only last half hour
2500 records per 30 minutes should be ok then.
But I do need to know the time each record was generated. Being a logfile each record should have time on it. But where? Unless this information is available it would not be possible to do what you want.
Not in rexx, anyway. You could save current the logfile and compare against the next logfile, writing out the differences and simply send the differences. When comparing the new logfile that would have to be saved and used as the 'old' ogfile next time. The compare could easily be done using JOINLEYS option of your sort productg.
Nic
RE: Need to read only last half hour
N 0000000 CP3X 18220 00:00:04.91 JES3 00000281 IRR010I USERID SCRUBBED
N 4000000 CP3X 18220 00:00:04.94 TADZXXXX 00000090 HSIZ009I DATA WRITTEN TO
N 4000000 CP3Y 18220 00:00:04.95 TADZXXXX 00000090 HSIZ045I 3W00 CREATED RE
N 4000000 CP3Y 18220 00:00:04.95 TADZXXXX 00000090 HSIZ047I 3W00 USAGE MONI
N 0000000 CP3X 18220 00:00:04.96 JES3 00000090 IAT6100 (JOB99999) JOB E
S SUB=JOB9990 ORG=LOCAL
N 0000000 CP3X 18220 00:00:04.96 JES3 00000290 IAT6100 (JOB57845) JOB E
S SUB=JOB62360 ORG=LOCAL
N 0020000 CP3Z 18220 00:00:05.03 QRFWLMG 00000281 ICH70001I SCRUBBED LAST
N 0000000 CP3X 18220 00:00:05.04 DXZXXXXX 00000090 IAT2000 JOB DXZXXXXX (JO
N 0020000 CP3X 18220 00:00:05.05 DXZXXXXX 00000281 ICH70001I SCRUBBED LAST
N 4000000 CP3X 18220 00:00:05.04 TADZXXXX 00000090 HSIZ046I 0X00 DELETED RE
N 0000000 CP3X 18220 00:00:05.05 DXZXXXXX 00000090 IEF403I DXZXXXXX - START
N 0020000 CP3X 18220 00:00:05.12 ESP 00000281 ICH70001I SCRUBBED LAST
RE: Need to read only last half hour
The lines with SUB in them could be a problem because they do not have a time but I guess they relate to the previous line - just extra coding.
I really think that the alternative solution, comparring and sending differences, would be the way to go - but not as much fun as a bit of Rexx coding. (JCL coding is fun too!)
Nic