regarding DSRUNJOB JOBCONTROL SUBROUTINE

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

vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

regarding DSRUNJOB JOBCONTROL SUBROUTINE

Post by vijaykumar »

Hi gurus,
my job design is odbc--->transformer---->odbc.
i want to make use of DSRUNJOB job control subroutine.
i went to job properties, click on jobcontrol tab.
how should i specify my jobcontrol routine.
syntax:VARIABLE=DSRUNJOB(JOBHANDLE,RUNMODE).
is this syntax correct, and where should i specify this sub-routine, shall i write manually. plz help me.
i want to make use of this sub-routine.
plz help me.
cheers;
vijay
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: regarding DSRUNJOB JOBCONTROL SUBROUTINE

Post by chulett »

vijaykumar wrote:i want to make use of DSRUNJOB job control subroutine.
Before we get too far into this, how about explaining why you think you want to do this? What kind of job are you thinking about running there? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post by vijaykumar »

hi gurus,
i want to run the job which iam designing.
that means can i use this sub-routine and run the job.
is that going to happen.
what i mean is my design is
odbc--->transformer--->odbc.
i want to include this subroutine in the jobproperties tab and run the job.
plz help me am i going in the right way. can i use this sub-routine in my job.
cheerss;
vijay
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Ok i am confused. You want to code the DSJobRun in the jobcontrol or the before/after subroutine section. If the later, you cannot run the same job in its before/after subroutine. It will crash and burn.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

vijaykumar wrote:i want to run the job which iam designing. that means can i use this sub-routine and run the job. is that going to happen.
That's what I was afraid of and why I asked why. :?

No. You either need to run the job you've designed from the Director or create a Sequence job that runs the job via a Job Activity stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

If you want to run the job using command line, you can run using dsjob -run.
Or are you trying to achieve something else here?
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post by vijaykumar »

hi gurus,
i just wanted to make use of this sub-routine, i never faced such scenerio,i want to analyze how this subroutine works.

iam specifying in jobcontrol subroutine.
what i understood from gurus is that its not possible to specify DSJOBRUN sub- routine for the job which iam working on in the designer, if i want to specify this subroutine, i need to create a sequencer and in the triggers tab specify this routine.
am i correct, plz help me.

cheers;
vijay
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

First of all you need to get your terminology right.
Job control in subroutine--> tells us that you want to run that same job in its subroutine. You can use DSRunJob() function in JobControl. But not in the same job's properties
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

What is your goal/objective? You can't plug in things just because they can be plugged in?

Is there something you are trying to achieve? Atleast try to describe your objective in a clarified way.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Are you writing a batch job to run your job?
Something like this?
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post by vijaykumar »

hi gurus,
iam not creating a batch to run this job, iam just running the job normally.
As gurus explained me that we shouldn't use this sub-routine to include in the job-properties of the same job which iam working on.
its possible in the before -subroutine.
my design is odbc--->transformer--->odbc the o/p of which iam joining with odbc, instead of running normally, i want to make use of sub-routine and run and make use of o/p to join another odbc source. is it possible.
Another doubt, before job-subroutine and after jobsub-routine have some default routines, i can't find this job control subroutine, how can i specify this sub-routine, plz help me in analyzing.am i going in right way

cheers;
vijay
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You got it wrong again.
Take a deep breath, close your eyes for 10 seconds and then read the following.
- It is not possible to add job control code of the same job that you are working on in its job properties. When you go to Job properties, to the Job Control tab. You will see a drop down option. You will not find the name of your current job.

- To run the same job in its before/after subroutine is not a good idea at all. It will not work. For the very same reason that you are trying to execute a running job again in its before/after subroutine.

-The before/after subroutines that you see are shipped with the product. If you want more you have to code them yourself.

-DSJobRun() is not a sub-routine. It is a function.

I hope its clear now.
And as Whale said, you cannot plug in things just because you can. It might not always work.
You can run the job using the designer or director. If you want to run a bunch of jobs you can build a sequence job.
If your still confused, i suggest you take DS 101 class.
Last edited by DSguru2B on Wed Dec 27, 2006 2:32 pm, edited 1 time in total.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

vijaykumar wrote: my design is odbc--->transformer--->odbc the o/p of which iam joining with odbc, instead of running normally, i want to make use of sub-routine and run and make use of o/p to join another odbc source. is it possible.
Why not redirect the output of your obdc stage into another obdc stage, something like this.

Code: Select all

odbc--->transformer--->odbc--->transformer--->odbc
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Vijay, Can you describe what exactly you are trying to do? Do you want to run a job and use its output in the other job? Or is it you trying to do something within a job (run a part of job which is not possible) or something else. Till now we are only speculating what you need?

Sam
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DSRunJob() function can not be used in the way proposed. However there is an SDK function called UtilityRunJob() that can be so used.

But do you really want to run a DataStage job for each row processed by your main job?

If so, do not complain about rows/sec. It will be abominable.
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