Page 1 of 1

including reason of rejection of row in reject file

Posted: Fri Jun 16, 2006 12:52 am
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

Posted: Fri Jun 16, 2006 1:52 am
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)

Posted: Fri Jun 16, 2006 2:16 am
by bhaskarjha
hi, i wann a way to give message to user what the row is getting rejected

Posted: Fri Jun 16, 2006 6:16 am
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.

Posted: Fri Jun 16, 2006 7:06 am
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

Posted: Fri Jun 16, 2006 7:11 am
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.

Posted: Fri Jun 16, 2006 7:45 am
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

Posted: Fri Jun 16, 2006 7:53 am
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.

Posted: Fri Jun 16, 2006 1:15 pm
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.