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
Posts: 232 Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune
Post
by synsog » Fri Oct 15, 2010 5:11 am
Hi
We need to get the list of modified datastage jobs in a text file. Is there a command to list jobs modification dates?
ArndW
Participant
Posts: 16318 Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:
Post
by ArndW » Fri Oct 15, 2010 5:52 am
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
Posts: 232 Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune
Post
by synsog » Fri Oct 15, 2010 6:22 am
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 » Fri Oct 15, 2010 7:01 am
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 » Fri Oct 15, 2010 3:22 pm
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Oct 15, 2010 4:00 pm
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 » Fri Oct 15, 2010 9:59 pm
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Oct 15, 2010 10:05 pm
Ah... cool, thanks.
-craig
"You can never have too many knives" -- Logan Nine Fingers
synsog
Premium Member
Posts: 232 Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune
Post
by synsog » Tue Oct 19, 2010 5:05 am
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Tue Oct 19, 2010 7:19 am
Same way.
-craig
"You can never have too many knives" -- Logan Nine Fingers
synsog
Premium Member
Posts: 232 Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune
Post
by synsog » Tue Oct 19, 2010 7:29 am
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Tue Oct 19, 2010 7:50 am
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
Posts: 232 Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune
Post
by synsog » Tue Oct 19, 2010 8:13 am
I searched for both uvsh and dssh but I couldn't find them.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Tue Oct 19, 2010 8:41 am
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