DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
abc123



Group memberships:
Premium Members

Joined: 25 Aug 2006
Posts: 605

Points: 5472

Post Posted: Thu Dec 05, 2019 10:23 am Reply with quote    Back to top    

DataStage® Release: 9x
Job Type: Parallel
OS: Unix
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.
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43085
Location: Denver, CO
Points: 222463

Post Posted: Sat Dec 07, 2019 5:31 am Reply with quote    Back to top    

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. Wink

_________________
-craig

"You can never have too many knives" -- Logan Nine Fingers
Rate this response:  
Not yet rated
abc123



Group memberships:
Premium Members

Joined: 25 Aug 2006
Posts: 605

Points: 5472

Post Posted: Sat Dec 07, 2019 9:03 am Reply with quote    Back to top    

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.
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43085
Location: Denver, CO
Points: 222463

Post Posted: Sun Dec 08, 2019 10:04 pm Reply with quote    Back to top    

Exclamation 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
Rate this response:  
Not yet rated
abc123



Group memberships:
Premium Members

Joined: 25 Aug 2006
Posts: 605

Points: 5472

Post Posted: Mon Dec 09, 2019 9:33 am Reply with quote    Back to top    

Craig, thank you for your response.

1)
I have a sequence job design like this:

Code:

JobActivity1--------->ExecuteCommand---------> JobActivity2
     |                      |
     ~                      ~
TerminatoryActivity1 TerminatoryActivity2

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.
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54582
Location: Sydney, Australia
Points: 295988

Post Posted: Mon Dec 09, 2019 5:35 pm Reply with quote    Back to top    

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 ...

_________________
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rate this response:  
Not yet rated
abc123



Group memberships:
Premium Members

Joined: 25 Aug 2006
Posts: 605

Points: 5472

Post Posted: Tue Dec 10, 2019 4:25 am Reply with quote    Back to top    

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.
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54582
Location: Sydney, Australia
Points: 295988

Post Posted: Wed Dec 11, 2019 5:42 pm Reply with quote    Back to top    

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 Seq ...

_________________
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rate this response:  
Not yet rated
UCDI



Group memberships:
Premium Members

Joined: 21 Mar 2016
Posts: 383

Points: 3950

Post Posted: Mon Dec 30, 2019 11:46 am Reply with quote    Back to top    

you can also use the (? logwarn ?) datastage capability to throw a warning on the log after the run command stage, using its output or whatever to (bypass or trigger?) the warning. This may be what you said you didn't want.
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours