Page 1 of 2
How to list jobs modification dates?
Posted: Fri Oct 15, 2010 5:11 am
by synsog
Hi
We need to get the list of modified datastage jobs in a text file. Is there a command to list jobs modification dates?
Posted: Fri Oct 15, 2010 5:52 am
by Sainath.Srinivasan
Search for DS_AUDIT.
Posted: Fri Oct 15, 2010 5:52 am
by ArndW
The DS_AUDIT hashed file contains this information. You could get this information by executing the following command from TCL:
LIST DS_AUDIT BY.DSND DTM BREAK.ON INSTANCE DET.SUP MAX DTM MODIFIER
If you want to put this into a text file, you could write a Server job to read this file and write it to a text file. The "DTM" (date-time-modified, position 5) column and the "MODIFIER" (pos 6) column are both multivalue fields.
Posted: Fri Oct 15, 2010 6:22 am
by synsog
Can I access DS_AUDIT through a bat script?
Posted: Fri Oct 15, 2010 7:01 am
by ArndW
You can execute TCL commands from .bat scripts and get that data. CD to your project directory and then "uvsh.exe LIST DS_AUDIT BY.DSND DTM BREAK.ON INSTANCE DET.SUP MAX DTM MODIFIER NO.PAGE". The output goes to stdout and can be processed from your .bat script.
Posted: Fri Oct 15, 2010 3:22 pm
by ray.wurlod
It might be better to use BY.EXP.DSND rather than BY.DSND.
Redirect the output of the uvsh.exe command into a file as required.
Posted: Fri Oct 15, 2010 4:00 pm
by chulett
Assuming DSND = descending, but "EXP"?
Posted: Fri Oct 15, 2010 9:59 pm
by ray.wurlod
Exploded. DTM is a multi-valued field. The equivalent SQL query is
Code: Select all
SELECT INSTANCE, DTM COL.HDG 'Last modified', MODIFIER FROM UNNEST DS_AUDIT ON MODS WHERE CLASS = '2' ORDER BY DTM DESC, INSTANCE;
Posted: Fri Oct 15, 2010 10:05 pm
by chulett
Ah... cool, thanks.
Posted: Tue Oct 19, 2010 5:05 am
by synsog
Hi all,
Thanks for the inputs and sorry for the delayed response.
Now i need help in exectuting these commands in a batch file then getting the result in a text file.
I can do it in Unix like -
$ path/to/uvsh/uvsh "select query" > my_text.txt
but how do I do this in a batch(DOS based) file?
Posted: Tue Oct 19, 2010 7:19 am
by chulett
Same way.
Posted: Tue Oct 19, 2010 7:29 am
by synsog
Craig,
I am unable to find the path to uvsh on my system. Please help me on that. I tried echo %DSHOME% but its not set
![Sad :(](./images/smilies/icon_sad.gif)
Posted: Tue Oct 19, 2010 7:50 am
by chulett
Did you try a simple Windows search? Nowadays I would look for (and use) "dssh" rather than "uvsh".
Posted: Tue Oct 19, 2010 8:13 am
by synsog
I searched for both uvsh and dssh but I couldn't find them.
Posted: Tue Oct 19, 2010 8:41 am
by chulett
Are you searching on the DataStage server? Do you know where your DSEngine directory is? There should be a "bin" directory under there with all of the appropriate executables in it, I would think.