Datastage 8.0 how to get list of jobs run/last run no DSODB

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
MF
Participant
Posts: 1
Joined: Mon May 19, 2008 6:23 am
Location: IE

Datastage 8.0 how to get list of jobs run/last run no DSODB

Post by MF »

Hi Folks,

Need to migrate a customer from version 8.0 to 11.x
I want to get a list of all the projects, jobs they have defined
which are in the thousands.

I would like to get a list of the jobs per project and the date time the
were last run, so that I could put them in a spreadsheet and review with
customer to see if these jobs are really required and eliminate the ones
that they are not running and save me migrating them.
Is there any way I can generate the list in a simple column format for loading into a spreadsheet?

DSODB was only introduced in 8.7 if I recall correctly, so not there in 8.0
Are there other tables in XMETA that I could extract this information from?

Looking to get
- Project
- Job name
- status
- Started
- on date
- last ran
- on date
- elapsed time
- description

I can only think of doing a shell script something like

Code: Select all

for PROJECT in $(/u01/IBM/InformationServer/Server/DSEngine/bin/dsjobs -lprojects)
do
   for JOB in $(/u01/IBM/InformationServer/Server/DSEngine/bin/dsjobs -ljobs ${PROJECT} )
   do
      # /u01/IBM/InformationServer/Server/DSEngine/bin/dsjobs -logdetail ${PROJECT} ${JOB} 
      /u01/IBM/InformationServer/Server/DSEngine/bin/dsjobs -jobinfo ${PROJECT} ${JOB} > ${PROJECT}_${JOB}.jobinfo
      cat ${PROJECT}_${JOB}.jobinfo >> ${PROJECT}_AllJobs.jobinfo
   done
done
but this will give a long list not really in columnar format for easy loading into spreadsheet. That I will have to manipulate/format, which will be messy/time consuming.
Is there a better to do this?

Thanks
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

That is basically how I would do it, but your final output does not need to get redirected to a file, you could parse the output of -jobinfo and simply extract job start time into a variable. You already have project and jobname as variables, so you could echo them out into a CSV output if you wish.

to parse the output you could pipe it to awk and get variables that way.

Code: Select all

$DSHOME/bin/dsjob -jobinfo $proj $job 2>/dev/null | awk -v prj=$proj jb=$job '
/Job Start Time  :/ { day = $1; mon = $2; hhmmss= $3; yyyy=$4 }
END {
        printf( "%s,%s %s %s %s\n", prj, jb, day, mon, hhnnss, yyyy);
}'
Something like that. Google up that awk syntax to get it right... but it can be done and without dumping to a text file.
Post Reply