I have an Execute Command stage that does a:
cat filename
There is a Job Activity stage before it in the sequence job which produces a file. I would like the Execute Command stage to produce a warning at run-time. I know that I can do an After-Job Subroutine in the job in the Job Activity stage and do an ExecSh and remove the file but I want to do it at run-time without changing existing code.
Making an Execute Command stage produce a warning
Moderators: chulett, rschirm, roy
Sorry but you're going to need to clarify this. Produce a warning? When, under what circumstances? And please clarify what that has to do with your "remove the file" remark. Rather than give an unrelated answer, I'd rather make sure we're answering the right question.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Craig, thank you for your response.
1)
I have a sequence job design like this:
JobActivity1--->ExecuteCommand ---> JobActivity2
| |
~ ~
TerminatoryActivity1 TerminatoryActivity2
JobActivity1 produces a flat file. I would like to raise a warning in the ExecuteCommand stage so that execution moves to the TerminatorActivity stage. So JobActivity1 will execute successfully without a warning.
2)
I am also trying to raise a warning in the DataStage job that is called by the JobActivity1 stage but have failed so far. I can do it by stopping the job monitor but I was hoping to do it through some other way.
1)
I have a sequence job design like this:
JobActivity1--->ExecuteCommand ---> JobActivity2
| |
~ ~
TerminatoryActivity1 TerminatoryActivity2
JobActivity1 produces a flat file. I would like to raise a warning in the ExecuteCommand stage so that execution moves to the TerminatorActivity stage. So JobActivity1 will execute successfully without a warning.
2)
I am also trying to raise a warning in the DataStage job that is called by the JobActivity1 stage but have failed so far. I can do it by stopping the job monitor but I was hoping to do it through some other way.
Please edit your response and wrap your sequence example in code tags so the whitespace is preserved and we can see what's where properly. You will need to lather-rinse-repeat with the preview button and tweak until it all lines up properly. It won't look correct until you preview, btw.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Craig, thank you for your response.
1)
I have a sequence job design like this:
NOTE: I had to use a caret to show the arrow pointer.
JobActivity1 produces a flat file. I would like to raise a warning in the ExecuteCommand stage so that execution moves to the TerminatorActivity2 stage. So JobActivity1 will execute successfully without a warning.
2)
I am also trying to raise a warning in the DataStage job that is called by the JobActivity1 stage but have failed so far. I can do it by stopping the job monitor but I was hoping to do it through some other way.
1)
I have a sequence job design like this:
Code: Select all
JobActivity1--------->ExecuteCommand---------> JobActivity2
| |
~ ~
TerminatoryActivity1 TerminatoryActivity2
JobActivity1 produces a flat file. I would like to raise a warning in the ExecuteCommand stage so that execution moves to the TerminatorActivity2 stage. So JobActivity1 will execute successfully without a warning.
2)
I am also trying to raise a warning in the DataStage job that is called by the JobActivity1 stage but have failed so far. I can do it by stopping the job monitor but I was hoping to do it through some other way.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Add an invalid command to the pipeline in the Execute Command activity.
For example, if you have cat myfile as the command, change it to cat myfile ; test -f nonexistentfile
The test command will have a non-zero exit status, which will cause a condition that can be captured by a Failure (or even Otherwise) trigger in the Execute Command activity.
For example, if you have cat myfile as the command, change it to cat myfile ; test -f nonexistentfile
The test command will have a non-zero exit status, which will cause a condition that can be captured by a Failure (or even Otherwise) trigger in the Execute Command activity.
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.
Ray, thank you very much for your response.
I want to do it without making any code change on the ExecuteCommand stage. This is because, I want to test my error handler on the ExecuteCommand stage just like it would happen in production. I can delete the file in the JobActivity stage before the ExecuteCommand stage but once again that is changing code.
I was wondering if there was a way to mimic an error on the ExecuteCommand stage at run-time. Looks like there isn't.
Would it be possible to do it in a DataStage job? I tried putting a string in a number column but Oracle wouldn't allow it. I can stop the job monitor and produce a warning in the job in the job activity stage but I was trying to see if there was some other way.
I want to do it without making any code change on the ExecuteCommand stage. This is because, I want to test my error handler on the ExecuteCommand stage just like it would happen in production. I can delete the file in the JobActivity stage before the ExecuteCommand stage but once again that is changing code.
I was wondering if there was a way to mimic an error on the ExecuteCommand stage at run-time. Looks like there isn't.
Would it be possible to do it in a DataStage job? I tried putting a string in a number column but Oracle wouldn't allow it. I can stop the job monitor and produce a warning in the job in the job activity stage but I was trying to see if there was some other way.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Short answer - no.
It might be an interesting thing to have in a test suite, such as the continuous integration (DevOps) capabilities of MettleCI but, as far as I am aware, there's nothing in Sequence jobs as they stand that allow you to trigger warnings when there's no reason to.
Actually you can, but it's a major hack. Go to the Job Control tab of Job Properties and copy all of the code that's there. Then create a server job and paste the code into its Job Control tab. Then modify that code to your heart's content; unmodified it will have the same functionality as the original generated code.
It might be an interesting thing to have in a test suite, such as the continuous integration (DevOps) capabilities of MettleCI but, as far as I am aware, there's nothing in Sequence jobs as they stand that allow you to trigger warnings when there's no reason to.
Actually you can, but it's a major hack. Go to the Job Control tab of Job Properties and copy all of the code that's there. Then create a server job and paste the code into its Job Control tab. Then modify that code to your heart's content; unmodified it will have the same functionality as the original generated code.
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.