How to get categoryname,jobname,job dependency.
Moderators: chulett, rschirm, roy
How to get categoryname,jobname,job dependency.
My requirement is to get all jobs names and their corresponding job category name, and job depenency in formatted output from current datastage project.
I have create one test job where using DSGetProjectInfo (DSJ.JOBLIST), but I got only job list in the current project.
Any hints or help will be greatly appreicated.
Thanks in Advance.
I have create one test job where using DSGetProjectInfo (DSJ.JOBLIST), but I got only job list in the current project.
Any hints or help will be greatly appreicated.
Thanks in Advance.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: How to get categoryname,jobname,job dependency.
All of the DataStage API functions only operate in the current project. To work with a separate project you will need to use dsjob (which has to be told which project to attach itself to). You can, of course, invoke dsjob through DSExecute(), etc.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Create simple job with Transformer stage and linkt to it a sequential file stage for capturing out in text or csv format.sshettar wrote:Hi rafik2k ,
Could you let me know how did go about creating the test job of urs which displayed all the jobnames of the current project
Thanks in advance
In transformer do the following;
1. Create one output coulmn say (jobName varchar(100))
2. put derivation for the column as:
Code: Select all
ereplace(DSGetProjectInfo(DSJ.JOBLIST), ",", CHAR(13):CHAR(10))
3. put one constraint on output link as
Code: Select all
@INROWNUM<1
That's it, compile and run the job.
I got this logic from Craig, Thanks Craig!
Thanks
Thanks Ray!ray.wurlod wrote:UV or Hashed File stage querying DS_JOBS excluding any where name begins with a "/" or "" character, returning columns NAME and CATEGORY (both VARCHAR). ...
Do I need to create a job for same? Can you please explain me little bit more details with syntax.
Thanks in advance
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Yes you need to create a job. Use a UV stage or a Hashed File stage to extract rows from DS_JOBS. The table is DS_JOBS, the two VarChar columns are NAME and CATEGORY and the selection criterion is that NAME does not begin with a slash or backslash character. In a UV stage this is a WHERE clause on the Selection tab; in a Hashed File stage it is a WITH phrase on the Selection tab. Do whatever you need to downstream of this.
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.