How to attach a Log File when the jobs fail?

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Amber
Participant
Posts: 8
Joined: Mon Nov 16, 2015 7:17 pm
Location: Sydney

How to attach a Log File when the jobs fail?

Post by Amber »

Please suggest how to attach a Log File when the jobs get fail.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:!: Split out from the original topic here.

Amber, there was all kinds of discussion in that old thread - did none of it help? Did you try any of it? I'd also be curious if you are using Sequence jobs to drive the jobs you want to send notifications out for as that makes it much easier. Or is your issue about not having Sequence jobs in the mix?

If you have tried some things and had issues or have specific questions, please let us know. Otherwise this is a pretty broad topic.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

First, the log is not a file; it's a table in the repository database.

You can view the log either from the Director client or from the Log View in Designer client.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Amber - just deleted your new post which asked this same question again. Come back to this conversation and clarify for us what you need, what you've tried and maybe even ask a question or two.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Received in a private message from Amber. Posting it here so that anyone in our merry band of misfits can help:

I am new to datastage. Using 11.3 on windows.

I am trying to attach a logfile if a job gets failed for each & every job.

I am using execute command task & then notification activity.

I am trying to pass Jobname as parameter in the command which it picks up. But it also appends the Jobname parameters at the end of the command, which I do not require.

This is my command task

C:\IBM\InformationServer\Server\DSEngine\bin\dsjob -logsum project_name #Job_Activity_0.$JobName# > E:\Failed_Job_logs\Datastage\joblog1.txt

After running the job, it fails. This is what I can see in log

C:\IBM\InformationServer\Server\DSEngine\bin\dsjob -logsum project_name sample_job E:\Failed_Job_logs\Datastage\joblog1.txt sample_job

So you see, sample_job is appended as well.

Can you please suggest how can I get rid off this problem.

Thanks in advance
-craig

"You can never have too many knives" -- Logan Nine Fingers
Amber
Participant
Posts: 8
Joined: Mon Nov 16, 2015 7:17 pm
Location: Sydney

Post by Amber »

I removed the parameter from Parameters section. Just use the parameter in the command. Then it will not append.

Thanks Craig for posting this topic to the forum.

But what I am trying to achieve is that I want to reuse this command task & notification activity for all my jobs. Hence I need the jobname in a variable. Still working on this.
Any help would be appreciated.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I was just in here typing up a question asking what you had in the Command box versus the Parameters box. :wink:

Kind of looks to me like you already have the "job name in a variable":
Job_Activity_0.$JobName

That would feed the JobName the JobActivity stage ran to any downstream activity. Can you clarify your need please? Curious if what you are still working on is the name of the file written to / attached or something you want in the body of the email or something else entirely.

Examples would be good of what you have in mind.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Amber
Participant
Posts: 8
Joined: Mon Nov 16, 2015 7:17 pm
Location: Sydney

Post by Amber »

Hi,

Yes, Job_Activity_0.$JobName is a variable, But it will keep changing for all other jobs. Like I have to modify the command for all job activities Job_Activity_1.$JobName, Job_Activity_2.$JobName, Job_Activity_3.$JobName. I was just wondering if it is possible to define the variable at project level and enter the value at run level. So that parameter name is same across all the command tasks.

Since I have 200+ jobs, I just want to re-use the same command task for all jobs.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry but I'm a little lost. You have 200+ jobs... in a single Sequence job?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Amber wrote:I was just wondering if it is possible to define the variable at project level and enter the value at run level. So that parameter name is same across all the command tasks.
It is not possible.

This might be a case for creating the job control routine manually (perhaps based on the code generated by compiling the sequence).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Amber, would like to continue to help with this if you're still in the market for some help. If we had a clearer picture of the issue, i.e. your current design, then I would imagine we (the folks here) could help shape a better solution for you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply