No , I was basically looking for any other way of doing it than what we have implemented.Because , right now we have to design a job sequence which comprises 2 jobs, 1 execute command stage and a sequencer.Just wondering whether this design will help in saving the time that was the main objective of the whole exercise.ray.wurlod wrote:Do you seek something like a review of existing work?
Job Running Logic
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
Re: Advertisement
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
Re: Advertisement
Hi All,pravin1581 wrote:No , I was basically looking for any other way of doing it than what we have implemented.Because , right now we have to design a job sequence which comprises 2 jobs, 1 execute command stage and a sequencer.Just wondering whether this design will help in saving the time that was the main objective of the whole exercise.ray.wurlod wrote:Do you seek something like a review of existing work?
I think we need to reopen this issue as it is not running the way it was supposed to be.First of all the 'cat ' command is not working properly if any parameter is used in place of file path such as 'cat $file_path/count.txt'. It gives error such as cat cannot open file.txt.
And in the trigger link we are using Return Conditional with expression as 0 for the stop link and 1 for the next job.
It always runs that link which has return value of 0 negelecting the value of the count parameter.
Please suggect how this logic can be implemented.
Thanks in advance.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Please post the current version of your code, along with the results of any diagnostic attempts you may have made (for example capturing the actual command that was sent).
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.
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
The command used in the Exec command stage is as followsray.wurlod wrote:Please post the current version of your code, along with the results of any diagnostic attempts you may have made (for example capturing the actual command that was sent).
[/code]
COUNT_VALUE=`cat /file_path/hotel_count_file.txt`;echo $COUNT_VALUE
Code: Select all
Based on the count value the next link should progess, if the Count_Value is 0 then stop job otherwise next link.
This logic has been implemented using trigger using Return Value (conditional). If expression=0 then stop job and and if =1 then next job.
As return value was processing based on 0 and not on COUNT_VALUE we implemented Custom conditional with expression as
Code: Select all
But the result remains the same , the logic is not being implemented based on the Count value.
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
pravin1581 wrote:The command used in the Exec command stage is as followsray.wurlod wrote:Please post the current version of your code, along with the results of any diagnostic attempts you may have made (for example capturing the actual command that was sent).
[/code]
COUNT_VALUE=`cat /file_path/hotel_count_file.txt`;echo $COUNT_VALUE
If COUNT_VALUE>0 Then DSJS.RUNOK Else DSJS.STOPPED for one link and If COUNT_VALUE<0 Then DSJS.RUNOK Else DSJS.STOPPED for the other linkCode: Select all
Based on the count value the next link should progess, if the Count_Value is 0 then stop job otherwise next link. This logic has been implemented using trigger using Return Value (conditional). If expression=0 then stop job and and if =1 then next job. As return value was processing based on 0 and not on COUNT_VALUE we implemented Custom conditional with expression as
Code: Select all
But the result remains the same , the logic is not being implemented based on the Count value.
Still waiting for any suggestions.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
After only two hours?!!
Some of us have to work for a living.
We don't do "urgent" here. If you need urgent help, sign up with your support provider for premium service and learn the true cost of urgent.
Put in some diagnostic calls to DSLogInfo() or UtilityMessageToLog(), for example to report the value of the environment variable COUNT_VALUE.
For example, because of the cat command's behaviour, this may have a trailing newline character.
Why are you testing COUNT_VALUE (the name of the environment variable) rather than $COUNT_VALUE (the value of the environment variable) in your trigger expression?
Some of us have to work for a living.
We don't do "urgent" here. If you need urgent help, sign up with your support provider for premium service and learn the true cost of urgent.
Put in some diagnostic calls to DSLogInfo() or UtilityMessageToLog(), for example to report the value of the environment variable COUNT_VALUE.
For example, because of the cat command's behaviour, this may have a trailing newline character.
Why are you testing COUNT_VALUE (the name of the environment variable) rather than $COUNT_VALUE (the value of the environment variable) in your trigger expression?
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.
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
Apologies for the urgency shown, COUNT_VALUE is the parameter that has been defined in the job, it is not an environmental varaible.It should get its value from the command executed in the Exec Command stage . If we hardcode the file path then the cat command works but when file path is parameterized it is not working. In both the cases the COUNT_VALUE variable is not getting its value.We have even tried using User Variable stage and then Nested Condition stage but the result remain the same.ray.wurlod wrote:After only two hours?!!
Some of us have to work for a living.
We don't do "urgent" here. If you need urgent help, sign up with your support provider for premium service and learn the true cost of urgent.
Put in some diagnostic calls to DSLogInfo() or UtilityMessageToLog(), for example to report the value of the environment variable COUNT_VALUE.
For example, because of the cat command's behaviour, this may have a trailing newline character.
Why are you testing COUNT_VALUE (the name of the environment variable) rather than $COUNT_VALUE (the value of the environment variable) in your trigger expression?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What is the precise value returned by the UNIX command (including all line terminator characters)?
How are you loading that value into your job parameter? Are you, for example, trimming any line terminator and/or field mark characters?
How are you loading that value into your job parameter? Are you, for example, trimming any line terminator and/or field mark characters?
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.
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
Ok, let me explain once more. The basic objective is to run the job based on the count of records in the input table, if the count is 0 then stop the job otherwise run the job.ray.wurlod wrote:What is the precise value returned by the UNIX command (including all line terminator characters)?
How are you loading that value into your job parameter? Are you, for example, trimming any line terminator and/or field mark characters?
1. We first created a job that fires a select count query on the input table and saves that value in the file.
2. In the next step we used a exec command stage to pass the unix cat command and store the value in the file in a variable.
Code: Select all
Count=`cat file_name`
3. In the trigger link the following expression is used :
Code: Select all
If COUNT_VALUE.$CommandOutput >0 Then DSJS.RUNOK Else DSJS.STOPPED for the actual job
If COUNT_VALUE.$CommandOutput <0 Then DSJS.RUNOK Else DSJS.STOPPED for the sequencer.
Is the design ok, or is there a better way to do it.
Thanks in advance.
3. Those are not 'expressions' - you have assignment statements in your triggers.
An expression evaluates to TRUE or FALSE, nothing more, and the value that the expression resolves to determines if the trigger 'fires' (TRUE) or doesn't fire (FALSE). They should simply have the following:
And then whatever is on the other end of the trigger link determines what happens next. And either add another trigger to handle =0 or fold that into an existing trigger.
An expression evaluates to TRUE or FALSE, nothing more, and the value that the expression resolves to determines if the trigger 'fires' (TRUE) or doesn't fire (FALSE). They should simply have the following:
Code: Select all
COUNT_VALUE.$CommandOutput >0
COUNT_VALUE.$CommandOutput <0
-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:
And even then you may need to get rid of the translated line terminator characters.
Code: Select all
Convert(@FM,"",ActivityName.$CommandOutput)
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.
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
In that case the link COUNT_VALUE.$CommandOutput >0 should run when the count is greater than zero but that is not happening.chulett wrote:3. Those are not 'expressions' - you have assignment statements in your triggers.
An expression evaluates to TRUE or FALSE, nothing more, and the value that the expression resolves to determines if the trigger 'fires' (TRUE) or doesn't fire (FALSE). They should simply have the following:
And then whatever is on the other end of the trigger link determines what happens next. And either add another trigger to handle =0 or fold that into an existing trigger.Code: Select all
COUNT_VALUE.$CommandOutput >0 COUNT_VALUE.$CommandOutput <0
The message in the job log is :-
Code: Select all
JobControl (@COUNT_VALUE): Executed: COUNT_VALUE=`cat /file_path/hotel_count_file.txt`
Reply=0
Output from command ====>
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
Where this command is to be used.ray.wurlod wrote:And even then you may needto get rid of the translated line terminator characters.Code: Select all
Convert(@FM,"",ActivityName.$CommandOutput)
What you should be executing is just the cat statement, no assignment (again) and no back-ticks:pravin1581 wrote:In that case the link COUNT_VALUE.$CommandOutput >0 should run when the count is greater than zero but that is not happening.
The message in the job log is :-Code: Select all
JobControl (@COUNT_VALUE): Executed: COUNT_VALUE=`cat /file_path/hotel_count_file.txt` Reply=0 Output from command ====>
Code: Select all
cat /file_path/hotel_count_file.txt
Code: Select all
Convert(@FM,"",COUNT_VALUE.$CommandOutput) >0
Code: Select all
COUNT_VALUE.$CommandOutput<1> >0
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
Thanks for the reply, then should I not use the variable COUNT_VALUE and neither should I assign it the value generated by the cat command. The Exec command should call the cat command only.chulett wrote:What you should be executing is just the cat statement, no assignment (again) and no back-ticks:pravin1581 wrote:In that case the link COUNT_VALUE.$CommandOutput >0 should run when the count is greater than zero but that is not happening.
The message in the job log is :-Code: Select all
JobControl (@COUNT_VALUE): Executed: COUNT_VALUE=`cat /file_path/hotel_count_file.txt` Reply=0 Output from command ====>
That will cause your count to be echo'd to the screen and picked up by the Sequence in the $CommandOutput variable. And then Ray's advice comes into play in your trigger:Code: Select all
cat /file_path/hotel_count_file.txt
Or perhaps more simply:Code: Select all
Convert(@FM,"",COUNT_VALUE.$CommandOutput) >0
Code: Select all
COUNT_VALUE.$CommandOutput<1> >0
Then why should i use COUNT_VALUE.$CommandOutput if I am not supposed to use the COUNT_VALUE variable.I that variable is not declared then I wouldn't get it and what is the convert command doing.