Getting all jobnames under a particular category

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Madhu1981
Participant
Posts: 69
Joined: Wed Feb 22, 2006 7:49 am

Getting all jobnames under a particular category

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

WriteSeq ID To objFileVar Then ...
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

JobName = ID

Is also important.
Mamu Kim
Madhu1981
Participant
Posts: 69
Joined: Wed Feb 22, 2006 7:49 am

Post by Madhu1981 »

Thanks a ton guys..!!
Post Reply