Page 1 of 1

Routine for job list in a category

Posted: Tue Nov 14, 2006 8:27 pm
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 :?:

Posted: Tue Nov 14, 2006 9:22 pm
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.

Posted: Tue Nov 14, 2006 9:51 pm
by narasimha
Thanks! :D

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