Running job in another project...

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

Post Reply
Triton46
Charter Member
Charter Member
Posts: 83
Joined: Fri Feb 07, 2003 8:30 am

Running job in another project...

Post by Triton46 »

I know you can run a dsjob -run script, but I am looking to run a batch job in Project1 which will kick off a DS job in Project2.

Can this be done through the batch job? with DSAttachJob (JobName, DSJ.ERRFATAL)?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

NO.
Everything done within a batch job (= job conrol routine) is entirely within the project.
What you would need to do is to invoke dsjob with -project and other options, probably via a call to DSExecute with the Shell argument set to the operating system shell value.


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Triton46
Charter Member
Charter Member
Posts: 83
Joined: Fri Feb 07, 2003 8:30 am

Post by Triton46 »

No way to trick DSAttachJob to do a change directory?

We have three jobs...

Master1Batch = passes table_name, schema_name, and where clause
CustomerBatch = passes these parameters in a loop to the job
CustomerJob = runs the OCI with the above as dynamic parameters

CustomerJob now sits in another project. If I use dsjob, can I pass these same parameters over to CustomerJob?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Still NO (for tricking DSAttach job).

dsjob takes as many -param options are you require

dsjob -project Project -user fred -password nurk -param table="table" -param schema="schema" -param whereclause="custno is not null" -run


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There's nothing wrong with having a job in Project1 write its parameter values to a text file, and having a job in Project2 read its parameter values from that text file.


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Triton46
Charter Member
Charter Member
Posts: 83
Joined: Fri Feb 07, 2003 8:30 am

Post by Triton46 »

quote:There's nothing wrong with having a job in Project1 write its parameter values to a text file, and having a job in Project2 read its parameter values from that text file.

No, we do some of that already. The problem is that these jobs are inline with other dependecies after them. Is it possible to run dsjob from a batch job?

[Edit]
OK, I think I have the gist of it now. I kick of DSExecute to call the ksh script. Now, in the ksh script I place my dsjob command.

The batch job that calls DSExecute contains the parameters that I want to pass to ksh for dsjob. Can I place these in the DSExecute line? We have NO documentation at my site. Thanks for the assistance.

[Edit][Edit]
Where do you declare the jobname in dsjob?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

dsjob [ other arguments ] -run projectname jobname

You have ALL the documentation; it is installed with DataStage client software, in a folder called Docs. The only manuals that may be missing are those for plug-in stage types, which are in the Packages folder on the server CD, or downloaded when you download the stage software.
Triton46
Charter Member
Charter Member
Posts: 83
Joined: Fri Feb 07, 2003 8:30 am

Post by Triton46 »

All I have is a one page summary of the DSExecute subroutine. I need some working examples. The one I got off of this site does not work.

Call DSExecute("UV","/datastage/DataStage/Projects/DRDWSysRes/test_run.ksh", Output, ErrCode)
If ErrCode 0 Then
GoTo MissingFiles
End
MissingFiles:
Call DSLogWarn("WARNING WARNING DANGER DANGER", "DimCONTROL")
NormalExit:
Triton46
Charter Member
Charter Member
Posts: 83
Joined: Fri Feb 07, 2003 8:30 am

Post by Triton46 »

OK, problem somewhat solved. See this thread:

http://www.tools4datastage.com/forum/to ... C_ID=83776
Post Reply