Monitors a physical file like Unix tail command. Auto refresh the display and show new records.
This tool was written out of frustration when required to repeatedly hit Enter key on DSPPFM command while monitoring log files (PF-DTA) for incoming transactions. I wrote this for me but I hope it will benefit you too.
First, upload the source to your AS/400 using FTP or other similar means, then set the correct source type for each member:
- PVFMONUSR RPGLE
- PVFMONUSU C
- PVFMONUSD DSPF
Compile the DSPF first using option 14. Then the RPGLE and C using option 15. Finally, issue CRTPGM PGM(PVFMONUSR) MODULE(PVFMONUSR PVFMONUSU). If you run into any difficulties with the source code, please verify that:
- The source physical file ('PF') is at least 112 in length, for example, CRTSRCPF FILE(QRPGLESRC) RCDLEN(112).
- The code page of the PF and your job is 37, for example, CHGJOB CCSID(37).
- The FTP mode of transfer was set to ASCII during upload.
CALL PVFMONUSR.
Enter the file, library and member of the PF-DTA you wish to monitor. Press Enter. If your LIB/FILE,MBR path is valid, the screen will load and the navigation keys are displayed at the bottom of the display.
When new entries are written to the monitored file, the display will refresh and highlight those new entries. Counter and timer at bottom right of the screen shows how many records were read in the last refresh and how long it's been since new entries were found. You can navigate left/right (like DSPPFM) if your records are longer.
You will require ILE C compiler in addition to RPG and DDS. The program will always read last record entry, so if your file is not sequential or if your PF make use of REUSEDLT, then this program is not for you. Program was written in Free-Format RPG.