To run a job from Command line

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

Moderators: chulett, rschirm, roy

Post Reply
jaksani
Participant
Posts: 48
Joined: Tue Mar 01, 2011 12:26 am
Location: Hyderabad

To run a job from Command line

Post by jaksani »

Hi,

I am new to this tool.
I have created a job with a parameter set file, consists of almost ten parameters.
I want to run that job from command line just by giving parameter set file name instead of giving each param.
Please let me know how to do this.

Thanks in Advance!

Regards,
Venkat Jaksani
Thanks & Regards,
Venkat Jaksani
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Make the name of the Parameter set to be one of your job properties, then pass that on the command line as part of the -param option.

Execute $DSHOME/bin/dsjob -run on the command line to see the options for running the job if you're not familiar with all of them.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

To specify a values file use

Code: Select all

-param paramsetname=valuesfilename
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jaksani
Participant
Posts: 48
Joined: Tue Mar 01, 2011 12:26 am
Location: Hyderabad

Post by jaksani »

Hi,

I could not find 'Paramsetname' option in the below

dsjob -run
[-mode <NORMAL | RESET | VALIDATE>]
[-paramfile <filename>]
[-param <name>=<value>]
[-warn <n>]
[-rows <n>]
[-wait]
[-opmetadata <TRUE | FALSE>]
[-disableprjhandler]
[-disablejobhandler]
[-jobstatus]
[-userstatus]
[-local]
[-useid]
<project> <job|jobid>


I have tried below command

dsjob -run -paramfile NameTest -param ValueFilename=Test <consists of param values> OD_PROJECTS_DEV1<Project Name> nametestjob_uivj0<Job Name>

But it is not worked.

Please let me know the corrections to be made to above command.
Thanks & Regards,
Venkat Jaksani
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The -param and -paramfile options are mutually incompatible.

Read the DataStage Programmer's Guide, the section on Command Line Interface.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jaksani
Participant
Posts: 48
Joined: Tue Mar 01, 2011 12:26 am
Location: Hyderabad

Post by jaksani »

Thanks!

I did not find Programmer's guide.I will get it anyway.

For now,please let me know the command to run the job uses set of things mentioned below.

ParameterSet name : NameTest
Value File : Test
Jobname:Nametest
Project: Training
Thanks & Regards,
Venkat Jaksani
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

dsjob [ login_clause ] -run -param NameTest=Test -jobstatus Training Nametest
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jaksani
Participant
Posts: 48
Joined: Tue Mar 01, 2011 12:26 am
Location: Hyderabad

Post by jaksani »

I have given below command

./dsjob -run -param NameTest=Test -jobstatus OD_PROJECTS_DEV1<Project Name> nametestjob_uivj0<job name>

It is throwing below error message.

Error -3 getting information for parameter 'NameTest'

Status code = -3 DSJE_BADPARAM


Please help me.
Thanks & Regards,
Venkat Jaksani
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What do you think 'bad param' might mean? The job does not have a parameter with that exact name, spelling and case.
-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 »

Verify that parameter set NameTest has a values file called Test.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jaksani
Participant
Posts: 48
Joined: Tue Mar 01, 2011 12:26 am
Location: Hyderabad

Post by jaksani »

I have corrected it and ran it successfully.
Thanks for your valuable inputs.

Please let me know where can I get the list of Status Codes and its meaning?
Ex: Status Code=2 or 0 etc.
0 -> for success ful
2 -> ?
Thanks & Regards,
Venkat Jaksani
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Header file dsapi.h or JOBCONTROL.H (which you will find on the server) contains this information. Incidentally, 0 is not "successful". 0 is "running".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply