List of jobs uses a specific parameter

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

List of jobs uses a specific parameter

Post by raji33 »

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
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

You could brute force the search with a script like this:

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

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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you want a specific parameter then don't use "LIKE ...ABC..." as that is a wildcard search. Worst case get rid of the "..." on either side, does that not get you want you want if you do that?
-craig

"You can never have too many knives" -- Logan Nine Fingers
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

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
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post by raji33 »

Thanks Chulett. Its working.
Post Reply