Page 1 of 1

Retrieve dynamic parameter values of a job

Posted: Sat Feb 13, 2010 2:38 pm
by Theenathayalan
Hi
I am using below command to retrieve the parameter values passed during a job run. I need to collect this information for all jobs in project across multiple servers.

dsjob -logsum <project> <jobname> | grep STARTED | tail -2 | head -1 | tr '\t' '|' | cut -d"|" -f1 | xargs dsjob -logdetail <project> <jobname> | tr '\t' ' ' | grep " = " | tr '^' ' ' >/tmp/outt


Issue is: It gets hanging if the log has too many entries like warnings/errors and does not return.

Is there any way to get the parameter values passed during a job run using dsjob commands.

Thanks

Posted: Sat Feb 13, 2010 2:44 pm
by chulett
Have you looked into "dsjob -jobinfo"? I think it will have that for the most recent job run, if that's what you are after. Or perhaps "-lparams" or a variant thereof.

Posted: Sat Feb 13, 2010 2:58 pm
by Theenathayalan
I tried both of these options but in vain.

-jobinfo does not give current parameters passed.
-lparams and -paraminfo gives only default parameters stored. Not the current prameters.

Posted: Sat Feb 13, 2010 3:35 pm
by chulett
You can get this information using the DSGetParamInfo() function, are you sure you need to do this from a script rather than from job control?

Posted: Sat Feb 13, 2010 3:57 pm
by Theenathayalan
Yes. I would need to do it from script.

Posted: Sat Feb 13, 2010 11:47 pm
by chulett
OK, then it looks like you'll need to read the logs for that. How long did you wait before you decided it was 'hanging'? Why not use the -type STARTED option rather grepping through everything for them?

Posted: Sun Feb 14, 2010 12:51 pm
by kduke
You can run EtlStats on a running job and it will retrieve parameter values too.

Posted: Sun Feb 14, 2010 1:10 pm
by Theenathayalan
I was waiting for more than 1 hour or even more in some instances.

-type STARTED -max <n> helped a lot. It's faster now.

Thanks a lot for your help, Craig !

Posted: Sun Feb 14, 2010 1:15 pm
by Theenathayalan
Resolution Fix:

dsjob -logsum -type STARTED -max <n> <project> <jobname> | tail -2 | head -1 | tr '\t' '|' | cut -d"|" -f1 | xargs dsjob -logdetail <project> <jobname> | tr '\t' ' ' | grep " = " | tr '^' ' ' >/tmp/outt