How to list jobs modification dates?

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

Moderators: chulett, rschirm, roy

synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

How to list jobs modification dates?

Post 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?
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Search for DS_AUDIT.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Post by synsog »

Can I access DS_AUDIT through a bat script?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Assuming DSND = descending, but "EXP"?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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;
Last edited by ray.wurlod on Sat Oct 16, 2010 5:09 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... cool, thanks.
-craig

"You can never have too many knives" -- Logan Nine Fingers
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

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

Post by chulett »

Same way.
-craig

"You can never have too many knives" -- Logan Nine Fingers
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

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

Post by chulett »

Did you try a simple Windows search? Nowadays I would look for (and use) "dssh" rather than "uvsh".
-craig

"You can never have too many knives" -- Logan Nine Fingers
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Post by synsog »

I searched for both uvsh and dssh but I couldn't find them.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply