List of jobs where a parameter is used
Moderators: chulett, rschirm, roy
List of jobs where a parameter is used
Is there any way to find out ; all the datastage jobs where a particular parameter from a Parameter set is used ?
Sweta
In Advanced Find You can run a search for jobs using the parameter-set, but not the parameter itself.
Export all the jobs containing the paramter-set to a .dsx-file (design-only) and search the file for the name of the parameter.
Export all the jobs containing the paramter-set to a .dsx-file (design-only) and search the file for the name of the parameter.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
There are the grateful those are happy." Francis Bacon
Hi Sweta,
not as cumbersome as You may think:
You can use DataStage to do the filtering.
Read the file sequentially, find the identifier in the line following the string "BEGIN_DSJOB", and write that to a Stage-variable.
In the following lines search for the parameter name using the Index()-Function. Set a stage-variable to True when the parameter name is found.
Write one row to the output for every job You find the parameter-name in. There is Your list...
not as cumbersome as You may think:
You can use DataStage to do the filtering.
Read the file sequentially, find the identifier in the line following the string "BEGIN_DSJOB", and write that to a Stage-variable.
In the following lines search for the parameter name using the Index()-Function. Set a stage-variable to True when the parameter name is found.
Write one row to the output for every job You find the parameter-name in. There is Your list...
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
There are the grateful those are happy." Francis Bacon
Chuck Smith has already built that for you with his "DataStage tools" offerings. Check out the 'Search' or 'List' code... if it doesn't already do what you need, modify it so it does. ![Wink :wink:](./images/smilies/icon_wink.gif)
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Write a Server routine called FindParameter with one argument, 'Arg1' with the following code:
It will return a comma separated list of jobs with the parameter passed in as a Arg1.
Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
EQUATE Comma TO ","
Ans = ""
JobList = DSGetProjectInfo(DSJ.JOBLIST)
JobCount = DCOUNT(JobList,Comma)
FOR i = 1 TO JobCount
JobName = FIELD(JobList,Comma,i)
JobHandle = DSAttachJob(JobName,DSJ.ERRNONE)
ParameterList = CONVERT(Comma,@FM,DSGetJobInfo(JobHandle,DSJ.PARAMLIST))
LOCATE Arg1 IN ParameterList SETTING Pos ELSE Pos = 0
IF Pos THEN Ans<-1> = JobName
Dummy = DSDetachJob(JobHandle)
NEXT i
Ans = CONVERT(@FM,Comma,Ans)