How to get an Alert Message when a File is being Written

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

How to get an Alert Message when a File is being Written

Post by cosec »

I have a File to Capture rejected records....Is it Possible to get an alert everytime this File is written to...? If so how..thanks....(without using job sequence)
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, it is possible (perhaps even easy) to do something like this. The question is what sort of an alert message? You can put a transform stage in the stream that writes to this reject file, and add a specific call to write a log message (the sdk routine "UtilityWarningToLog" will do that). Or you can put a before-stage or after-stage call in that transform to issue just one call to a program, or script, or routine of your choice.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you mark the constraint as a 'Reject Row' you'll automatically get an 'alert' (read 'warning') logged with the total row count rejected if anything goes down it. As noted, the answer is heavily dependant on what kind of 'alert' you want.
-craig

"You can never have too many knives" -- Logan Nine Fingers
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Post by cosec »

Thanks for the Input...I would like the alert to be written to a Log File. For eg whenever there are rejected records I would like it to indicate that on the log...(I am assuming I will have to do some scripting in order to display that in the batch log)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What 'batch log'? Sounds like you may need to write an after-job routine to get a LinkRowCount and write to your 'log file' if the value is > 0.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply