Best way to Log a File's Arrival

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
ashishm
Premium Member
Premium Member
Posts: 37
Joined: Thu Jun 16, 2011 8:12 am
Location: india

Best way to Log a File's Arrival

Post by ashishm »

My functional requirement is that if a source file arrives at any time, I create a record in a transmission logfile, with the information about the filename.The Input file has over 8 million records in it, so I dont want a stage which reads the whole file as it may slow processing time, and i have to write only one Output row.


Is there a way to do this in DataStage 8.1? The client cant be persuaded to write a shell script.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: Best way to Log a File's Arrival

Post by SURA »

It will arrive one after another / at the same time ?

DS User
ashishm
Premium Member
Premium Member
Posts: 37
Joined: Thu Jun 16, 2011 8:12 am
Location: india

Re: Best way to Log a File's Arrival

Post by ashishm »

SURA wrote:It will arrive one after another / at the same time ?

DS User
It will arrive one after the other.So the case is let's say if a file arrives in morning, i insert a record in transmisison log,
If the file comes again, I insert another record in the same transmission log
ashishm
Premium Member
Premium Member
Posts: 37
Joined: Thu Jun 16, 2011 8:12 am
Location: india

Re: Best way to Log a File's Arrival

Post by ashishm »

SURA wrote:It will arrive one after another / at the same time ?

DS User
So this is what I have in mind,

I will keep a dummy file, and in the sequencer, check whether the Input file has arrived, using file watcher, if it has arrived, I will Just write an Input row using a Transformer to the Log
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In a Routine activity invoked from a sequence (which might include a Wait For File activity) you can use the OpenSeq statement to open the file (without reading it), then the STATUS statement can return the file's size and lots of other information about the file. Once you have that, simply close the file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply