Page 1 of 1

Running job in another project...

Posted: Mon Feb 10, 2003 2:03 pm
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)?

Posted: Mon Feb 10, 2003 3:34 pm
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

Posted: Mon Feb 10, 2003 3:59 pm
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?

Posted: Mon Feb 10, 2003 5:36 pm
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

Posted: Tue Feb 11, 2003 4:35 am
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

Posted: Tue Feb 11, 2003 8:16 am
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?

Posted: Tue Feb 11, 2003 5:35 pm
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.

Posted: Wed Feb 12, 2003 10:19 am
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:

Posted: Wed Feb 12, 2003 10:37 am
by Triton46
OK, problem somewhat solved. See this thread:

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