Hi,
I am a beginner in scripting...I have to do a script where I have to read a file which has list of job names, line by line and for every line execute a dsjob command to find the log details of the job and extract only the start time of the job, if it is greater than jan 01 2008 and create an output file which has the jobname that I read followed by a comma and the start time stamp value.
If I execute the dsjob (datastage) command for a job A12TRANJB, the expected results are:
dsjob -jobinfo DDW A12TRANJB
Job Status : NOT RUNNING (99)
Job Controller : not available
Job Start Time : Tue Feb 17 22:17:10 2009
Job Wave Number : 0
User Status : not available
Job Control : not available
Interim Status : NOT RUNNING (99)
Invocation ID : not available
Last Run Time : not available
Job Process ID : 0
Invocation List : A12TRANJB
The highlighted job start time value in line 3 is the one i have to compare and if it is greater than 01/01/08, I have to write that to a file, with the job name, A12TRANJB.
I have a unix coding done for this, I know that there would be lot of mistakes..I have it here below:
HTML Code:
jobname= /apps/Ascential/Projects/jobnames
for line in $jobname
do
dsjob -jobinfo $jobname PRJ | grep `job start time` | cut -f2 -d > newfile
the highlihgted line is a datastage dsjob command which will get the job log details..
can some one please help me in this scripting?
thanks,
Vijay