Page 1 of 1

Capturing detail information of job in other category

Posted: Mon Jun 18, 2007 1:04 am
by 47shailesh
In many cases jobs are called by Batch, sometimes jobs(in other category) get aborted due to many reasons like locks on some table, some ORA error.. etc

Is there some way to get exact reason of job failure how that can be implement in the Batch.

Posted: Mon Jun 18, 2007 1:07 am
by ray.wurlod
It usually gets logged, so you can include calls to DSGetLogSummary, DSGetNewestLogId and DSGetLogEntry to retrieve the same.

Posted: Mon Jun 18, 2007 1:41 am
by 47shailesh
Being in Batch how could i use DSGetLogSummary as i do not know the eventid of job(in some other category) that has failed.

Posted: Mon Jun 18, 2007 2:14 am
by ray.wurlod
You know the job name. You can attach that job and use the requisite functions to interrogate its log. Don't forget to detach the job before exiting from your routine.

Re: Capturing detail information of job in other category

Posted: Tue Jun 19, 2007 3:32 am
by sachin1
hello i am new to datastage, but below process is followed by department.

for batch file you may be using DSExecute.exe with parameter as job name.

in this job, go to job-properties-->job-control. in job-control write your code which will use following routines like

DSAttachJob
DSRunJob
DSGetLogSummary
DSDetachJob

you can find help and code for above routines in built-in help of datastage.

then you can execute this job and catch a log. you can get all types of error logged.

Posted: Tue Jun 19, 2007 5:57 am
by 47shailesh
Thankx Ray, Your suggestion sovled my problem :P , but know there is new problem, whatever error reason is stored in a variable and passed to the a job that insert it (error) in a table.

Obstacle comes when job pass the parameter(which have stored error message) throgh the transformer job get aborted as the "identifier becomes too long" becuase the error message is in detail(paragraph),
Do you have any suggestion to resolve this problem.

Posted: Tue Jun 19, 2007 2:34 pm
by ray.wurlod
Use a bigger data type - maybe VarChar(4096)

Posted: Wed Jun 20, 2007 8:44 am
by 47shailesh
How to use datatype other(bigger) than that in DataStage's Varchar becuause in the source stage itself when i click on "view data" i encounter "identifier too long error".

Posted: Wed Jun 20, 2007 5:07 pm
by ray.wurlod
"Identifier" is usually the column or table name, not the text value itself. In DataStage you can set VarChar up to 65535. The restriction, however, may be in the data browser itself rather than in the database connection - post the full error message, which should indicate its source.