I am writing FTP log to a file every day(same file), I need to read this file every day and send an e-mail when there are error message.
I am planning to read from the end-of file until the begining of that day's log so that I will be reading only that day's log, planning to send an e-mail when I encounter any error message.
If possible Can any one suggest me how to get the file pointer so that I can read from the end of file? OR how to do SEEK -1.
Thanks
How to read the file from the end
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In DataStage BASIC SEEK filevariable,offset,location postitions the file pointer offset characters away from location, and offset can be negative or positive. For location 0 means current location, 1 means beginning of file and 2 means end of file.
If the file is not too big to read as a single dynamic array, you might be able to leverage the REVREMOVE statement. Use SETREM to position the remove pointer to end of file (Len(string)+1) first.
If the file is not too big to read as a single dynamic array, you might be able to leverage the REVREMOVE statement. Use SETREM to position the remove pointer to end of file (Len(string)+1) first.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.