Retrieve dynamic parameter values of a job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Theenathayalan
Participant
Posts: 15
Joined: Fri Jul 06, 2007 4:48 pm

Retrieve dynamic parameter values of a job

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

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

"You can never have too many knives" -- Logan Nine Fingers
Theenathayalan
Participant
Posts: 15
Joined: Fri Jul 06, 2007 4:48 pm

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

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

"You can never have too many knives" -- Logan Nine Fingers
Theenathayalan
Participant
Posts: 15
Joined: Fri Jul 06, 2007 4:48 pm

Post by Theenathayalan »

Yes. I would need to do it from script.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

You can run EtlStats on a running job and it will retrieve parameter values too.
Mamu Kim
Theenathayalan
Participant
Posts: 15
Joined: Fri Jul 06, 2007 4:48 pm

Post 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 !
Theenathayalan
Participant
Posts: 15
Joined: Fri Jul 06, 2007 4:48 pm

Post 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
Post Reply