dsjob command help

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
svhari76
Participant
Posts: 48
Joined: Tue Nov 16, 2010 5:04 pm

dsjob command help

Post by svhari76 »

Hi All

I am trying to execute the sequencer from command prompt and i used following command.

Code: Select all

 ./dsjob -server Servername -user username -password password -run -param SrcDir="Dir path" -param SrcFile="FileName"-warn 5000 Project  Jobname

The job has been kicked off, but failed because of the file not being able to find in the job.

In the job default src file name is A.txt(doesn't exist in directory) and I am passing file name as B.txt from command prompt and B.txt file exists in the Src directory location.The file name in the job is referrence( something like #SrcFile# instead of A.txt).

If i rename the B.txt as A.txt and run the job, it runs fine.

Basically the job is not taking the paramter value from command prompt.

Can some one please let me know what am i doing wrong here?
Hari
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What happens if you put in the space you are missing in front of "-warn"?
-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 »

Do it this way.

Code: Select all

-param 'SrcDir=Dir path'
Mamu Kim
svhari76
Participant
Posts: 48
Joined: Tue Nov 16, 2010 5:04 pm

Post by svhari76 »

Chulett - It has space aftre warn .
kduke - I tried as you suggested, but still job fails.

Any other suggestions?
Hari
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

svhari76 wrote:Chulett - It has space aftre warn.
It doesn't have one in what you posted, hence the suggestion. :?

Can you post an accurate version of what you actually tried to run after the change Kim suggested so we can see what it was you ran? Give us real values rather than made up examples if you'd like people to be able to help properly.
-craig

"You can never have too many knives" -- Logan Nine Fingers
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Can you show us the parameter you used in the file stage? Did you fully qualify the path of the file with your variable or did you just pass the filename?
svhari76
Participant
Posts: 48
Joined: Tue Nov 16, 2010 5:04 pm

Post by svhari76 »

I tried with both single Quote and double quote options for the params.I have 4 other paramters which i wanted to take the default ones that i defined in the job.(So i am not passing them)

Code: Select all

./dsjob -server Server1 -user User1 -password password -run -param "SrcDir=/dvl/etl/projects/Project1/Source"-param "SrcFile=PCC.txt" -warn 5000 ProjectName SequencerName
Hari
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You only need the quotes if there are spaces in any of the parameter values, so try again without any. And you still show the command without the proper whitespace between all the bits. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
svhari76
Participant
Posts: 48
Joined: Tue Nov 16, 2010 5:04 pm

Post by svhari76 »

The spaces are getting deleted when i am editing this message with dummy values.

I tried this as well still it fails because job can not get the file name from commadn prompt.

Code: Select all

./dsjob -server Server1 -user User1 -password  password  -run  -param   SrcDir=/dvl/etl/projects/Project1/Source  -param   SrcFile=PCC.txt  -warn 5000 ProjectName SequencerName

Hari
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Things should be being passed fine, it would seem, so I'm assuming your issue is on the actual usage side. Since there's no final delimiter in your pathname, you'd need to include one when you actually assemble the parameters:

#SrcDir#/#SrcFile#

Or if you are doing this in your stage:

#SrcDir##SrcFile#

Make sure you add a trailing "/" to what you pass from the command line.

This is the information that PaulVL was asking for, btw.
-craig

"You can never have too many knives" -- Logan Nine Fingers
svhari76
Participant
Posts: 48
Joined: Tue Nov 16, 2010 5:04 pm

Post by svhari76 »

In my job the source file path has been defined as #SrcDir#/#SrcFile#,
Job has individual parameters like SrcDir, SrcFile etc. More over in the director logs i am seeing my hardcoded file name rather than passed file name missing note.
Hari
svhari76
Participant
Posts: 48
Joined: Tue Nov 16, 2010 5:04 pm

Post by svhari76 »

Ok, Now i should be able to pass the parameter to Sequencer, but this is not getting passed to my job from sequencer.

Code: Select all

./dsjob -server  Server -user  userid  -password  password -run -param SrcFile=PCC.txt  -warn 5000 Project SequencerName 
My sequencer suppose to pass the paramteres to my job.(All parameters are defined in the way they are in sequencer and mapped those paramteres in sequencer.

Is there any way that i can pass all the parameters in a file?( idon't have lparamfile,paramfile option in dsjob - DS7.x)
Hari
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

This just gets more confusing as we go deeper down the rabbit hole. :?

What makes you think your Sequence job is not passing the parameters properly to any jobs it runs? Are you using the Job Activity stage to run the jobs or some other mechanism?
-craig

"You can never have too many knives" -- Logan Nine Fingers
svhari76
Participant
Posts: 48
Joined: Tue Nov 16, 2010 5:04 pm

Post by svhari76 »

Job Activity stage.

Before job activity stage i have execute commadn stage and i am seeing the passed file name coming in for this command. But when i execute the job from job activity stage it is not getting passed to job. I can see in the job logs that it is looking for default file and fails.(since it is not there, but for sure i have the file that i am passing in.)
Hari
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Hmm.. look on the Job tab of the Job activity - make sure that the parameter values are actually being set correctly. Then look in the job sequence log for a "job run requested" message, which should show the parameter values being passed to the job. Then look in the related log for the job itself, for the "job starting" event, which should show the actual parameter values received by the job.
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