Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

event server question

Status
Not open for further replies.

jinkys

Programmer
Sep 11, 2003
67
GB
I have file and a ftp conformation file that is ftp'd onto a UNIX server each day, at which point the event server should pic the file and process it.

The problem being that the files are date stamped (e.g. filename08092004.txt filename08092004.cnf

is there any way that you can use dated filenames within the event server source event definiton?

 
Have you tried using wildcards in your Event Server Source Event definition? e.g. filename*.txt and/or filename*.cnf
 
What we do in this situation in to include the data file name in the confirmation file. So when you trigger on the confirmation file it has the data file name available to the map.
 
ediav8or
I have tried wildcards but this doesn't work in this situation. It will work to check for appearance of .cnf but if 2 files are in the directory from different dates it will process both fiels using wildcards and I only want to process that days file.

janhes
Thanks for that i'll have a look at that method

Another one I'm trying is as seen on a previous post to monitor for the filename*.cnf and use getfilename() function to create the filename for the .txt from the .cnf

Thnaks for suggestions.

 
Another one I'm trying is as seen on a previous post to monitor for the filename*.cnf and use getfilename() function to create the filename for the .txt from the .cnf
"

This is probably the easiest if your files have the same name except for the extension.
 
WORD(REVERSEBYTE(word(REVERSEBYTE(getfilename(infile)),"\",1)),".",1)

gives you the file name without the extension.
 
What version of the tool are you using? Looks like it's running in Unix. Is it on the server the file is 'put' to?

janhes's recommendation sounds good. If the confirmation file doesn't contain the data file name, is it possible to trigger an event that will gather directory information. For example... in Windows/Dos...

c:\path>dir >>directory.log

or

c:\path>dir filename*.txt >>directory.log


New file, directory.log, reflects the contents of the path.
 
First of all, why does the ES leave the files after triggering? Why not have the files moved to an archive directory after being processed? Then you can use a straight wild card and don't have to worry about triggering from old files. You could also run a shell script that does an ls -la etc. to produce a file with just the files you want to use. Get that file and map out the file name you need and pass it to a RUN map as the input file name.


BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top