REXX Log Wrap
Am looking for a REXX script similiar to ZLOGWRAP. I am currently using the ZTASKSTA to record the number of active connections and logging them in to a seperate log. We want this to log to get wrapped up every 24 hrs similiar to SWITCH_TOD settings in edmprof.dat. I was thinking of using the same functionality in the ZTASKSTA rexx.
I suggest the following:
/* create one logfile per day */
clientip = edmgetv( 'SESSION', 'IPADDR')
call edmget 'ZCVT'
clogfile = ZCVT.LOGDIR || '\MYLOG-' || date(s) || '-' || ZCVT.MGRID || '.log'
Then compile an arbitrary line to write to log, e.g.:
logline = 'This line will be written to log'
And finally send to disk:
rc = lineout(clogfile,date(s) || " " || time() || ' <' || clientip || '> '|| logline)
rc = lineout(clogfile)
Thanks a lot.
In the similiar way could we record this value every one hour in the same log every day? Like if the IP count is taken around 04:00 AM, the next count should take by 05:00 AM and next 06:00 AM and write it in the same log file?