Page 1 of 1

Getting all jobnames under a particular category

Posted: Fri Sep 14, 2007 10:59 am
by Madhu1981
Hi All,

I have to get the list of job names from a particular category and put them into a sequential file.

I have written a routine

$INCLUDE DSINCLUDE JOBCONTROL.H

*---- Start Processing

*---- Fectch Job Parameters

sleep 20

var1 = 'TARGET_RI_FILES\CLAIMS\INST_CLAIM'

strFileName = '/tmp' : "/" :'JobNames_List.dat'
Call DSLogInfo(strFileName, "Job Control")

OpenSeq strFileName To objFileVar
Else
Create objFileVar
Else
ABORT
End
End

open "DS_JOBS" to DsJobs else ABORT

CMD = "SELECT DS_JOBS WITH CATEGORY = ":var1

EXECUTE CMD CAPTURING Output

LOOP

WHILE READNEXT ID DO

READ DsJobsRec FROM DsJobs, ID Then

JobName = DsJobsRec<0>

WriteSeq JobName To objFileVar Then
End

END

REPEAT

CloseSeq objFileVar

ErrorCode = 0 ;* set this to non-zero to stop the stage/jo


The routine has ran succesfully, but when I opened the file, it contains nothing!!

When i replace the code as

JobName = DsJobsRec<3> then I am getting the list of category names. and

JobName = DsJobsRec<5> then I am getting the list of Job Numbers!!

Can you suggest what is the filed number that I have to give to get the filenames

Thanks
Madhu

Posted: Fri Sep 14, 2007 3:12 pm
by ray.wurlod
WriteSeq ID To objFileVar Then ...

Posted: Fri Sep 14, 2007 7:55 pm
by kduke
JobName = ID

Is also important.

Posted: Mon Sep 24, 2007 7:10 am
by Madhu1981
Thanks a ton guys..!!