Start Loop in DS7.1

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

Hi,

I dont understand why there are so many features missing in DS7.1
I can not select a routine from sdk and assign it to the parameter in 7.1 in the job activity stage
I dont have anything coming on the right side which I can browse through.
If I manually enter the lookup routine, its throwing an error.
eg: My input is of string type and I tried enetring the below for the parameter.

UtilityHashLookup('TestHashLookup',#InvocationID#,1)
where I declared invocation ID as parameter in job sequence.
Please let me know how to proceed.
Thanks,
Madhavi
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Ok do this, connect routine activity to a job activity. When you open the 'Value Expression' for the job parameter inside the job activity and right click on it, what do you see. Do you see 'Acitivy Variable'. If you do then choose $ReturnValue from it and you can safely call the UtilityHashLookup() in the routine activity.
If you dont have such an option then you need to implement it by some other way.
Like maybe taking the UtilityHashLookup() out of the picture.
Something like, use a sequential file stage to read your csv file and say the value you want to be passed to the other job is 'Value'.
In the transformer you can use UtilityRunJob(JobName,Param1=INLINK.Value,0,0).
This way for each value in the csv file, you will run the job. You can also write a small routine and pass the INLINK.Value to that routine as an argument and inside that routine call the UtilityRunJob() or even DSRunJob(). This way you can have error handling coded too.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

pmadhavi wrote:...I dont understand why there are so many features missing in DS7.1...
:D I've never looked at software improvements that way, I prefer to view it as "look at all the nice things they put in the new version that we didn't have before". It's like wondering why those people at Ford were so silly as to not offer the Model T with electric windows and heated seats.
I think in your actual code you will need to remove the hash marks (#) for the compiler to detect the parameter value.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ArndW wrote:
pmadhavi wrote:...I dont understand why there are so many features missing in DS7.1...
:D I've never looked at software improvements that way, I prefer to view it as "look at all the nice things they put in the new version that we didn't have before".
Exactly. I certainly hope older version are 'missing' features that newer versions have. Perhaps you will reconsider my earlier advice to upgrade.

The 7.1 version was emminantly skippable IMHO and, as noted, the new version includes quite a number of enhancements and improvements that would make your life much easier.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Its due to the constraints of the OP with respect to DS version, OS that a work arounds are provided.
Atleast if the OP was on unix, life would have become so much easier :lol:
I would say Craig has a very valid point. Just upgrade.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

DSguru2B wrote:Its due to the constraints of the OP with respect to DS version, OS that a work arounds are provided.
Atleast if the OP was on unix, life would have become so much easier :lol:
I would say Craig has a very valid point. Just upgrade.
Hi,
Whenever I am compiling a job, I am getting the following error.
Can not get exclusive access to executable file for job <jobname>-job may be being monitored.

Then I have to manually kill the process to compile again. Please let me know what could be the reason.

If I run a job from a routine, I am facing this issue.
Thanks,
Madhavi
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

You might have a DataStage Director Monitor window open or the Job is in a running state while you are trying to compile that Job and hence that error. Make sure you close that window and the job is not running and then compile the Job. And then let us know if you are still not able to compile the job.
Kris

Where's the "Any" key?-Homer Simpson
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

YOu are either monitoring that job or the log file for that job is open. Get rid of either. You should be fine then.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

I have a sequence job which consists of 3 jobs

As Guru suggested I created a job in which source is the csv file and in the transformer I called a routine which in turn runs the sequence job.

But before runnign the main job, if i try to compile the other jobs in the sequence I am gettign that error.

I am not able to killthe process also. All the jobs are conmpletely done without any warnings in the previous runs; but still I am getting the error.
Thanks,
Madhavi
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Did you make sure that the director is not open during that time, specifically a monitor window or the log file.
If yes, then just as a debugging attempt, remove the name of the sequence job from your main job, put some dummy jobs name. Close it and then try to recompile the sequence jobs. They should have no connection but you never know.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

Hi Guru,
I hope u remeber my job.

I need to run a set of jobs for each input coming out of the csv file.
I gave 2 values in the file. The job ran successfully for the first value but for the second value, it did not run and the status is showing @false(ie=0)
and the warning that I am getting in the main job is:
<jobname>..Transformer_0 (DSRunJob): Job control error (-2)
(DSRunJob) Job TestInvocation is not in a runnable state
Thanks,
Madhavi
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You dont need to make the job multiinstance now. Take the multiinstance out. If you still want to make it multi instance, make sure you are sending in unique Invocation Ids.
Also, did your jobs for the first value from the csv execute successfully?
If it did, then why is it saying that its not in a runnable state?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

I diasabled the mutli instance option long back.
Only for the first value of the csv file, the job is running successfully.
But for 2nd onwards, it is showing the following warning in the main job
<jobname>..Transformer_0 (DSRunJob): Job control error (-2)
(DSRunJob) Job <sequencejob> is not in a runnable state
Thanks,
Madhavi
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

I diasabled the mutli instance option long back.
Only for the first value of the csv file, the job is running successfully.
But for 2nd onwards, it is showing the following warning in the main job
<jobname>..Transformer_0 (DSRunJob): Job control error (-2)
(DSRunJob) Job <sequencejob> is not in a runnable state
Thanks,
Madhavi
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Show me the syntax of your UtilityRunJob(). Just copy paste the derivation for me.
Also, i just tested your scenario out, it works perfectly fine for me.
Also go into the job log of your Sequence job and check out its status in the last run. After the first run, somehow its not in a runnable state.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply