Sunday, March 6, 2011

Message Handlers in Datastage and Job level message handler not found error while compile

Reference from IBM help of Tool

Message Handler Manager
This section describes how to manage message handlers that have been defined in WebSphere DataStage for use with parallel jobs.

What are message handlers?
·          When you run a parallel job, any error messages and warnings are written to an error log and can be viewed from the Director. You can choose to handle specified errors in a different way by creating one or more message handlers.
·         A message handler defines rules about how to handle messages generated when a parallel job is running. You can, for example, use one to specify that certain types of message should not be written to the log.
·         You can edit message handlers in the Designer or in the WebSphere DataStage Director. The recommended way to create them is by using the Add rule to message handler feature in the Director (see Adding Rules to Message Handlers in WebSphere DataStage Director Client Guide).
·         You can specify message handler use at different levels:
Project Level: You define a project level message handler in the WebSphere DataStage Administrator, and this applies to all parallel jobs within the specified project.
Job Level: From the Designer you can specify that any existing handler should apply to a specific job.
·         When you compile the job, the handler is included in the job executable as a local handler (and so can be exported to other systems if required). You can also add rules to handlers when you run a job from the Director (regardless of whether it currently has a local handler included).
·         This is useful, for example, where a job is generating a message for every row it is processing. You can suppress that particular message.
·         When the job runs it will look in the local handler (if one exists) for each message to see if any rules exist for that message type. If a particular message is not handled locally, it will look to the project-wide handler for rules. If there are none there, it writes the message to the job log.
·         Note message handlers do not deal with fatal error messages, these will always be written to the job log.
·         You can view, edit, or delete message handlers from the Message Handler Manager. You can also define new handlers if you are familiar with the message IDs (although note that WebSphere DataStage will not know whether such messages are warnings or informational).
·         The preferred way of defining new handlers is by using the add rule to message handler feature.


Add rule to message handler window:

Use this window to add rules to message handlers 'on the fly' from within the Director. In job menu have the add rule to message handler. Using this method, you can add rules to handlers that are local to the current job, to the project default handler, or to any previously-defined handler. To add rules in this way, highlight the message you want to add a rule about in the job log and choose Add rule to message handler... from the job log shortcut menu or from the Job menu on the menu bar. The Add rule to message handler dialog box appears. 

image








image


To add a rule:
Using this method, you can add rules to handlers that are local to the current job, to the project default handler, or to any previously-defined handler.
The window contains the following controls and fields:
Add Rule
User the options in this area of the window to specify the handler to which you want to add the new rule.
Add rule to local runtime handler
Choose this option to add the rule to the local handler for the job currently displaying messages in the job log view. If the job currently has no handler, adding messages here will create one.
      Add rule to project-level message handler
This option is enabled if you have a project-level message handler defined (this is done from the Administrator client). Choose it to add to the message handler currently assigned as the default for this project.
      Add rule to chosen message handler
Choose this option to add to an existing message handler. Select a message handler from the Message Handler list or select (new) to define a new handler.
Action
Choose an action to take when a job generates a message of the specified type. Choose from:
Suppress from log
The message is not written to the job's log as it runs.
Promote to Warning
Promote an informational message to a warning message.
Demote to Informational
Demote a warning message to become an informational one.

Message
Use the options in the message area of the window to define the message that you are adding.
      Message ID
The unique message ID that identifies this particular type of message.
            Message type
Indicates the type of message. Can be one of:
·         Info
·         Warning
·         Control
·         Fatal
Only informational and warning messages can be added to a message handler.
Example of message text
An example of the text that typically accompanies this type of message. This is taken from the message you have selected.
     Add Rule
     Click this button to add the new rule to the chosen message handler.
     Edit Handler
     Click this button to open the Edit Message Handlers window.


Message Handler File Format
A message handler is a plain text file and has the suffix .msh.It is stored in the folder called MsgHandlers in the WebSphere DataStage server install directory. The following is an example message file.
TUTL 000031 1 1 The open file limit is 100; raising to 1024...
TFSC 000001 1 2 APT configuration file...
TFSC 000043 2 3 Attempt to Cleanup after ABORT raised in stage...

Each line in the file represents message rule, and comprises four tab-separated fields:
·         Message ID . Case-specific string uniquely identifying the message
·         Type. 1 for Info, 2 for Warn
·         Action . 1 = Suppress, 2 = Promote, 3 = Demote
·         Message . Example text of the messageCompiling


Specifying Parallel Job Defaults
You specify date/time and number formats for a job on the Defaults page.
You can also specify a local message handler for the job. The Message Handler for Parallel Jobs field allows you to choose a message handler to be included in this job. The message handler will be
compiled with the job and become part of its executable. The drop-downlist offers a choice of currently defined message handlers.

image

 Edit message hanlers rule:

 image


To open the Message Handler Manager, choose Tools à Message Handler Manager in director or designer. The Edit Message Handlers dialog box appears.
Use the Edit Message Handlers window to view, edit, or delete message handlers or to create a new one.
Action from the drop-down list.
Possible Actions are:Messages can be suppressed from the log (Information and
Warning messages only), promoted (from Information to Warning) or demoted (from
warning to Information).
·         Suppress from log. The message is not written to the job’s log as it runs.
·         Promote to Warning. Promote an informational message to a warning message.
·         Demote to Informational. Demote a warning message to become an informational one.




image


The window contains the following controls and fields:
Edit project level message handler
This option is only available if you have a project-level message handler defined (this is done from the Administrator client). Choose this option to edit the message handler currently assigned as the default for this project.
Edit chosen message handler
Choose this option to edit an existing message handler. Select a message handler from the drop-down list or select (new) to define a new handler.
Message type
An icon indicates whether the message is a warning or informational (this field is blank if this is a message you have added manually)
Message ID
The unique message ID that identifies a particular type of message.
Action
Choose an action to take when a job generates a message of the specified type. Choose from:
·         Suppress from log. The message is not written to the job's log as the job runs.
·         Promote to Warning. Promote an informational message to a warning message.
·         Demote to Informational. Demote a warning message to become an informational one.
Save
Click this button to save the message handler you have been editing. A submenu offers the choice of Save Message Handler to overwrite the current handler, or Save Message Handler As to save the edited handler as new. If you choose Save Message Handler As, a dialog box asks you to enter the name for the new handler. 
Message hadles project level in administrator in parallel tab:
Message Handler for Parallel Jobs
Allows you to specify a message handler for all the parallel jobs in this project. You define message handlers in the Designer or Director. They allow you to specify how certain warning or information messages generated by parallel jobs are handled. Choose one of the predefined handlers from the drop-down list. 
image

 
Disable message handler: run option general page:

Disabling Message HandlersWhen you run a parallel job you can disable any message handler that have been defined for that job. For parallel jobs, you can define message handlers, which specify that particular types of informational or warning messages are suppressed from the log. Message handlers can be assigned to jobs at the project level (from the Administrator), the Job Design level (from the Designer), or for individual job runs (from the Director). You can define a handler from the Director, or from the Designer
To disable message handling:. Message handlers are disabled on the General page of the Job Run Options dialog box.
·         Select Disable project-level message handling to disable the handler that has been defined in the Administrator to apply to all jobs in the project.
·          Select Disable compiled-in job-level message handling to disable a local handler that has been compiled into this particular job. The message handlers are only disabled for this particular job run.

In dsjob, have option to disable the message handler,
·         -disableprjhandler use this to disable any error message handler that has been set on a project wide basis
·         -disablejobhandler use this to disable any error message handler that has been set for this job (see WebSphere DataStage Director Client Guidefor a description of message handlers).

image

 
The General page allows you to specify that the job should generate operationalmeta data, suitable for use by MetaStage. It also allows you todisable any message handlers that have been specified for this job run

see WebSphere DataStage Director Client Guide for a description of message handlers.

          

1.                  1.   Which two methods can be used for adding messages to a message handler? (Choose two.)
A.    Import message handler from existing message handler dsx.
B.    Drag and drop a message from the job log onto the message handler.
C.    Type in the message rule by hand.
D.    Use the add rule to message handler interface.

Answer: CD

2.       When Defining a message handler, which three actions can be specified for a message? (Choose three )
A.      Demote to “Warning”
B.      Suppress from log.
C.      Demote to “Informational”
D.      Promote to “Warning”
E.       Promote to “Fatal”
Answer: B,D,

3 comments:

  1. Hi Jigna,

    Useful article about Message Handler............Thank you so much.

    ReplyDelete
  2. The images with good examples helped me a lot to understand the stages step by step. Thanks for sharing dude.



    DataStage


    ReplyDelete
  3. Thanks for Article.It's Good learning on Message Handler

    ReplyDelete