Job Running Logic

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

As chullet suggested you just need to specify

Code: Select all

COUNT_VALUE.$CommandOutput<1> >0
Where COUNT_VALUE is the name of the exec command activity in your job sequence.

In the exec command activity just specify cat command.

Please do not quote the entire post while replying. It wastes a lot of space and makes the post difficult to read. Quote only if it is necessary.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

balajisr wrote:As chullet suggested you just need to specify

Code: Select all

COUNT_VALUE.$CommandOutput<1> >0
Where COUNT_VALUE is the name of the exec command activity in your job sequence.

In the exec command activity just specify cat command.

Please do not quote the entire post while replying. It wastes a lot of space and makes the post difficult to read. Quote only if it is necessary.
Thanks for all the replies, when I parameterize the file path the cat does not work.The job itself is getting aborted.The log shows that cat cannot open the file.The cat command has been modified as :

Code: Select all


        cat file_pathfile_name
where file_path is the parameter specifying path of the file.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

you can't pass parameters in the command textbox of Execute Command activity. If you want to pass parameters you need to put them in the parameters textbox of the execute command activity.
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

Minhajuddin wrote:you can't pass parameters in the command textbox of Execute Command activity. If you want to pass parameters you need to put them in the parameters textbox of the execute command activity.
Thanks ,I have done the same. But how will the cat command get its file path. I am not supposed to hardcode it.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

Code your Execute command activity this way:

Code: Select all

Command: cat 
Parameters: #file_pathfile_name#
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

Minhajuddin wrote:Code your Execute command activity this way:

Code: Select all

Command: cat 
Parameters: #file_pathfile_name#
Thanks it worked , I would like to know what the Convert function is doin here, because only it worked and not the ActivityName.$Command output.
thanks for all the suggestions.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Line terminators are converted to field marks (@FM). The Convert() function removes them. When Craig suggested the <1> notation he was attempting to do the same thing, but one can never be totally sure that the result is in the first field (line) of output, which is why I prefer the Convert() approach.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

ray.wurlod wrote:Line terminators are converted to field marks (@FM). The Convert() function removes them. When Craig suggested the <1> notation he was attempting to do the same thing, but one can never be totally sure that the result is in the first field (line) of output, which is why I prefer the Convert() approach.
When we tried using the $CommandOutput function as suggested by Craig it gave reverse results i.e. running for the 0 count and not running when count is 0, even though the expressions used in the respective links were correct but we did not use that <1> notation, what does that notation signify.

Thanks for the reply.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What is returned is a dynamic array, and that notation says you want to check only the first element in the array.

I agree with your point, Ray, and have used both notations. I prefer the one I posted and, when I use it, I ensure what I'm after is always in the first element. If at all possible. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

chulett wrote:What is returned is a dynamic array, and that notation says you want to check only the first element in the array.

I agree with your point, Ray, and have used both notations. I prefer the one I posted and, when I use it, I ensure what I'm after is always in the first element. If at all possible. :wink:
But when I use it in the expression along with the notation it gives me a syntax error.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There must be no space between the activity variable name ($CommandOutput) and the "<" character.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply