including reason of rejection of row in reject file

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
bhaskarjha
Participant
Posts: 67
Joined: Thu Apr 06, 2006 7:13 am

including reason of rejection of row in reject file

Post by bhaskarjha »

hi
i am collecting all records in reject file , i wann to include the reason for each row that is getting reject,

here i have added one more column in reject file as REASON, nw i wann the message which comes in the director for rejected row to see in this column , is there any way to do this
Bhaskar Jha
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Lacking sufficient information I am assuming your job design ends something like the following.

Code: Select all

----->  Transformer  ----->  Database
               |       out
               | rej
               V
          RejectFile
You use link variables on the rej link:
  • out.SQLSTATE VarChar(12)

    out.DBMSCODE VarChar(12)

    out.LASTERR VarChar(2000)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bhaskarjha
Participant
Posts: 67
Joined: Thu Apr 06, 2006 7:13 am

Post by bhaskarjha »

hi, i wann a way to give message to user what the row is getting rejected
Bhaskar Jha
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Still lacking information.
If your target is database and if you collecting the information on the reject records, the way ray sais would do. Add another column where you can supply the link variables to get more information.
Allong with that you will have the rejected record as well.
Not sure what you need more.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
bhaskarjha
Participant
Posts: 67
Joined: Thu Apr 06, 2006 7:13 am

Post by bhaskarjha »

i added one column in target, which is a seq file , and with the help of DSStageLastErr function , its not giving any information as why this row is rejected , it just informs that row is rejected.
i wann information as if it is getting rejected because of key column being null or say datetime overflow

Plz tell me what are the exact input u wann from my side
Bhaskar Jha
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

For that you have to code accordingly. Like a batch script. Even then you wont be able to get warning message for each and every row. That information is present in the log files which is getting filled during the exection of the job, so there is no way you can get that info inside that same job. After the completion of this job, you should execute another job control, or batch job that goes in and runs commands to get the log files, specifically with type other than info.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
bhaskarjha
Participant
Posts: 67
Joined: Thu Apr 06, 2006 7:13 am

Post by bhaskarjha »

can i get a way to bring the warning message i.e. displayed in director to job(target file is seq) by using some routine
Bhaskar Jha
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

As i mentioned. You need to do this after that particular job has finished.
You can use

Code: Select all


dsjob -logsum -type WARNING PROJECTNAME JOBNAME
All of this is listed in Server Job Developer's Guide in dsbooks.

If you want to code it in a routine, or even in the derivation in the transformer, look at the DSGetLogSummary() function.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
lclapp
Premium Member
Premium Member
Posts: 21
Joined: Wed May 19, 2004 2:43 pm

Post by lclapp »

My assumption is that you are writing to a RDMS. If so then the reject reasons are available for each record if you utilize the reject link. You can get the DBMSCODE, LASTERR,REJECTEDCODE and SQL State.
Post Reply