Datastage has a property in which it allows users to suppress or demote a warning from the Datastage log file. Although this is one thing ive never seen be used that much it’s still something worth knowing. Datastage allows users to carry out this task by the use of Message handlers. This can be done either at a job level or at a project level. Lets have a look on how to set the message handlers in Datastage.
As you can see from the design we are reading from a sequential file, sorting the data and then writing back to the sequential file. Now since the sequential file stage does not run in parallel we will get the below warning in the Datastage logs
Now if we need to suppress this particular warning from the job logs we should do the following.
- Right click the warning and select the ‘add rule to message handler’ option
- This will give you a new window. In that window, select the ‘Add rule to message handler’ option and then click add rule
- You then enter the name of the new message handler you are creating and click OK.
Your message handler has been created. The next time you run your job the warning won’t be present in your logs. The list of messages handled will be present in your job log. It will be the last entry before the ‘Control’ entry.
The message handler you have just created is a local message handler that will be applied only to this job. However you can use apply this message handler to all the jobs in your project by setting it in your administrator. The option will be present in the ‘Parallel’ tab of your respective project.
The message handler I selected was the one I had just created.
Moving Message Handlers
Most of the time, I hear people wanting to know if you can export your message handlers similar to the way you export your Datastage jobs. As far as I know, its not possible. You will have to manually move your message handler files from one environment to the other. You can find these files at D:\IBM\InformationServer\Server\MsgHandlers on Windows, and the respective folder in UNIX. Copying these files to the environment of your choice is how you transfer the message handlers between environments