How to attach a Log File when the jobs fail?
Moderators: chulett, rschirm, roy
How to attach a Log File when the jobs fail?
Please suggest how to attach a Log File when the jobs get fail.
![Exclamation :!:](./images/smilies/icon_exclaim.gif)
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
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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
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
"You can never have too many knives" -- Logan Nine Fingers
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.
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.
I was just in here typing up a question asking what you had in the Command box versus the Parameters box.
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.
![Wink :wink:](./images/smilies/icon_wink.gif)
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
"You can never have too many knives" -- Logan Nine Fingers
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.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It is not possible.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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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
"You can never have too many knives" -- Logan Nine Fingers