Newbie questions on Error Handling

Formally known as "Mercator Inside Integrator 6.7", DataStage TX enables high-volume, complex transactions without the need for additional coding.

Moderators: chulett, rschirm

Post Reply
LisaM
Participant
Posts: 6
Joined: Sun Jan 29, 2006 1:38 pm

Newbie questions on Error Handling

Post by LisaM »

Hello there,

I need to deal with some error handling in my DS TX maps, however, not sure where to start. Any help/information will be greatly appreciated!

Thanks,

Lisa

1. How do I stop the map and return user defined error messages when unexpected values were encounted?

2. What is the recommedation in terms of reject process? i.g. What function to use, reject file setup and reject threashold?
kris
Participant
Posts: 160
Joined: Tue Dec 09, 2003 2:45 pm
Location: virginia, usa

Re: Newbie questions on Error Handling

Post by kris »

Hi Lisa,
LisaM wrote: 1. How do I stop the map and return user defined error messages when unexpected values were encounted?
There are several ways how errors can be reported.
Some of the basic error processing details:
You can have basic cases, 1. where you need reject the row if you have error(according to the business rule you validate data for those columns for errors and capture boolean values in stage variables and use them in contraints) 2. report informational warning but still process the row and default the data for those columns(can be done as above but allow the rows to targets and also write informational error to error file or table).
LisaM wrote: 2. What is the recommedation in terms of reject process? i.g. What function to use, reject file setup and reject threashold?
There is no recommendation or rule in terms fo reject process. Its done according to your system requirements for the project. Depends on what information do the business wants and how and where do they want to store (errors, warnings and logs) in tables or files.

I have a scenario that I can discuss littlebit about:

Scenario one:
One of my client wanted us to build a process where lot of error processing involved.There were 3 types of errors:1. header/tail validations fail-reject file, 2 error-reject row and report error, 3. warning-report warning but process the record, 4-errors more than threshold(80% of total records)-reject the file. Every file we process, they wanted a error file sent out to a server with all the errors with corresponding error_id and the bad data and along with the entire rejected record.

To achive all the above, we devided this entire processing to several small peices and took advantage of pre-processing steps(some level of validations) in unix(which are easy and faster) with shell scripts . If that passes then call the job for more filed validations where we capture errors and warnings. As of now we are processing files in temporary tables because if we reach threshold we should be able to reject the file and not affect our target tables with any of this data. basically you process the file in temporary tables and you write all different error and warning files with the error file layouts and then process all the error and warning file and write one last error file with header and tail and also calculate theshold if you pass then take the data to affect target otherwise you do not. And send the error file to where they want.

Hope this would help.
Cheers,
Kris~
~Kris
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post by janhess »

Lisa

1 You can define validation rules in the type tree and use the reject function in a map rule to reject any records that fail the validation.
Or you can test values in your map rule and send error records to an error file.

2 You usually use the REJECT function to reject records that fail validation as defined in the type tree.
LisaM
Participant
Posts: 6
Joined: Sun Jan 29, 2006 1:38 pm

Post by LisaM »

Thanks a lot for both of you... I finally found those functions for error handling such as fail and reject. :)
mondweep
Participant
Posts: 1
Joined: Wed Mar 29, 2006 3:13 am
Location: London

Post by mondweep »

LisaM wrote:Thanks a lot for both of you... I finally found those functions for error handling such as fail and reject. :)
Are your application maps running in isolation or are they part of an EAI DSTX framework? As far as my understanding goes, it should be part of a framework with router map and interface map- a map that would trigger the correct application map depending on the nature of the incoming file format ---surely you would intend to process files or messages with different formats. For each of the format, there has to be different application maps. The call to the application map should be dependent on some key fields or the incoming file name.

If your situation is as above, you would need to include specific error cards to store required information eg. filename, timestamp, error code, error reason and error message. In case an error occurs, the application map writes to the error card using GETANDSET function. At the end of processing the incoming message or file, the application map outputs the error card to the framework interface maps. These maps check to see if the error code is anything greater than 0(0 might indicate no error). If yes, it does not output the message to output channel and writes the error information on the database table.
Mondweep Chakravorty
Developer
Post Reply