Routine for job list in a category

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
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Routine for job list in a category

Post by narasimha »

What is the best way to get a comma separated list of jobs in a category?
I wrote a Basic routine to get a list in this format

Code: Select all

JobA
JobB
JobC
I was looking for something like using a Routine

Code: Select all

JobA,JobB,JobC
Any pointers :?:
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

Why You want to have it in a comma Seperated Values. Any way you have written a routine to list jobs , so further extend your routine.

Loop the output and append it to the same variable Some thing like

Code: Select all

Ans = ""
cmd="SELECT NAME FMT '60L' FROM DS_JOBS WHERE NAME NOT LIKE '\\%' SUPPRESS COLUMN HEADING COUNT.SUP;
Call DSExecute("UV", cmd, JobList, sysretcode)
JobCount=DCount(JobList,@FM)
For JobVal = 1 To JobCount Step 1
  JobName = Field(JobList,@FM,JobVal)
  Ans :=  Jobname : ','
Next JobVal
Note : I Just typed the code here, i didnt checked it in DS, Just use this as a sample and write your own code.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Thanks! :D

Had some issues with the @FM. :oops:
Got my routine working now.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
Post Reply