Hi All,
I have a requirement where i need capture the list of the jobs where a specific parameter is being used.
Query i am using
LIST DS_JOBS WITH JOBTYPE = 3 AND EVAL "TRANS('DS_JOBOBJECTS','J\':@RECORD<5>:'\ROOT',14,'X')" LIKE ...ABC...
Where ABC is my parameter.
My issue is, I am getting complete list of jobs which are using the parameter starting with ABC and its even pulling the jobs which uses ABC_D parameter.
Any suggestions on how to modify query to get the desired result.
Thanks
List of jobs uses a specific parameter
Moderators: chulett, rschirm, roy
You could brute force the search with a script like this:
Then just grep in that repository path for your parms. If you are about to do a ton of searches over and over... might be the way to go.
Code: Select all
#!/usr/bin/ksh
##
## Description: Create a list of parms for each job and put into repository directory .
##
DSHOME=`cat /.dshome`;export DSHOME;
hName=`hostname`
set -A projects `$DSHOME/bin/dsjob -lprojects 2>/dev/null;`
for pEntry in ${projects[*]}; do
echo "Working in $pEntry";
set -A jList `$DSHOME/bin/dsjob -ljobs $pEntry 2>/dev/null;`
for jEntry in ${jList[*]}; do
echo `$DSHOME/bin/dsjob -lparams $pEntry $jEntry 2>/dev/null;` > /fsdsadm/scripts/fsa/repository/$hName.$pEntry.$jEntry.parmlist;
done
done
If you are using Operations Console, then following query will give desired results ...
Code: Select all
SELECT distinct X.ProjectName, X.FOLDERPATH, X.JobName, P.PARAMNAME, P.PARAMVALUE
FROM DSODB.JOBRUN R
JOIN DSODB.JOBEXEC X ON R.JOBID = X.JOBID
JOIN DSODB.JOBRUNPARAMSVIEW P ON R.RUNID = P.RUNID
WHERE P.PARAMNAME = <parameternm>
-- AND R.RUNSTARTTIMESTAMP > (Current_timestamp - 7 days)
ORDER BY 1, 2, 3