Absent Member.
Absent Member.
489 views

REXX Log Wrap

Hi,

 

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.

 

Thanks,

Vinod

0 Likes
2 Replies
Micro Focus Contributor
Micro Focus Contributor

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)

 

Absent Member.
Absent Member.

Hi,

 

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?

 

Regards

Vinod

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.