Using output of Execute Command as param to Job Activity

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
DHallam
Participant
Posts: 20
Joined: Fri Nov 07, 2008 9:32 am

Using output of Execute Command as param to Job Activity

Post by DHallam »

Hi,

I've got an Execute Command activity called GenerateJobGuid that runs uuidgen which outputs a 36 character guid to the console.

I've then got a Job Activity that requires a String parameter called jobGuid.

I have set this value to be

Code: Select all

GenerateJobGuid.$CommandOutput
but when I run the job I get the error:

Code: Select all

MyJob..JobControl (@ExecuteJob): Controller problem: Error calling DSSetParam(jobGuid), code=-4
[ParamValue/Limitvalue is not appropriate]
I'm guessing that the output isn't a String and it's failing to pass the value in.

Can someone please let me know how I can take the value returned from the command and pass it successfully to the parallel job?

Many thanks,

Dave
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Re: Using output of Execute Command as param to Job Activity

Post by priyadarshikunal »

DHallam wrote:Hi,

I've got an Execute Command activity called GenerateJobGuid that runs uuidgen which outputs a 36 character guid to the console.

I've then got a Job Activity that requires a String parameter called jobGuid.

I have set this value to be

Code: Select all

GenerateJobGuid.$CommandOutput
but when I run the job I get the error:

Code: Select all

MyJob..JobControl (@ExecuteJob): Controller problem: Error calling DSSetParam(jobGuid), code=-4
[ParamValue/Limitvalue is not appropriate]
I'm guessing that the output isn't a String and it's failing to pass the value in.

Can someone please let me know how I can take the value returned from the command and pass it successfully to the parallel job?

Many thanks,

Dave
Use the search option first. There are a lot of threads for this.
viewtopic.php?p=308527&highlight=#308527

Look for the post from Craig. Well the code I have written there will work but it uses two functions and can be done with only one :idea:

Use the following

Code: Select all

GenerateJobGuid.$CommandOutput<1>
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
DHallam
Participant
Posts: 20
Joined: Fri Nov 07, 2008 9:32 am

Post by DHallam »

Many thanks for that. I did have a search through the forums before posting but couldn't see what might be relevant.

I tried using the

Code: Select all

GenerateJobGuid.$CommandOutput<1>
syntax but is errors with Expected: expression so I just used

Code: Select all

field(convert(@FM,',', GenerateJobGuid.$CommandOutput),',',1)
which works perfectly.

Many thanks for your help.

Dave
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

DHallam wrote:Many thanks for that. I did have a search through the forums before posting but couldn't see what might be relevant.

I tried using the

Code: Select all

GenerateJobGuid.$CommandOutput<1>
syntax but is errors with Expected: expression so I just used

Code: Select all

field(convert(@FM,',', GenerateJobGuid.$CommandOutput),',',1)
which works perfectly.

Many thanks for your help.

Dave
yes it works fine but its a kind of overkilling as Craig said.

try to use

Code: Select all

convert(@FM,'', GenerateJobGuid.$CommandOutput)
It should also work fine.

Regards,
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
DHallam
Participant
Posts: 20
Joined: Fri Nov 07, 2008 9:32 am

Post by DHallam »

Yes, that's right, sorry - that works too.
Post Reply