Setting Command Output to the job parameter

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
datisaq
Participant
Posts: 154
Joined: Wed May 14, 2008 4:34 am

Setting Command Output to the job parameter

Post by datisaq »

I have a job design:

Execute Command Activity ----> Job Activity Stage.

In Execute Command activity stage i'm reading a sequential file which is having only one value using the "cat" command.

The output of the "cat" is passed to the parameter of the job which is called in next stage.
MaxVal(Prameter) ---> $CommandOutput.

But my job is getting aborted, when i'm setting the above value.

Can anyone tell me how to set the command output to the parameter?

Any help will greatly appreciated..
IBM Certified - Information Server 8.1
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Do we have to guess your error? Here's mine! [drumroll] The dreaded "[ParamValue/Limitvalue is not appropriate]" error? If so, a search for that phrase will reveal the solution.
-craig

"You can never have too many knives" -- Logan Nine Fingers
arvind_ds
Participant
Posts: 428
Joined: Thu Aug 16, 2007 11:38 pm
Location: Manali

Post by arvind_ds »

Use a variable activity stage after your execute command stage and in the value expression of variable stage use field function to retrieve the output of execute command and pass the variable's value further to your next job activity stage in your job sequence.

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

Post by chulett »

You should be able to do that directly in the Job Activity parameter assignment field... assuming we know what the actual problem is.
-craig

"You can never have too many knives" -- Logan Nine Fingers
datisaq
Participant
Posts: 154
Joined: Wed May 14, 2008 4:34 am

Post by datisaq »

You're absolutely correct craig the problem is the same.
I set the datatype as "integer" in the sequential file and i kept quote as "none".But the same error.

Could you please tell me craig how to resolve this..

Please help me out..
IBM Certified - Information Server 8.1
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I already did! It's been reported and solved here many times, search for that phrase to find them.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ajay.vaidyanathan
Participant
Posts: 53
Joined: Fri Apr 18, 2008 8:13 am
Location: United States

Setting Command Output to the job parameter

Post by ajay.vaidyanathan »

Hi,
U cannot directly use MAX() in $CommandOutput. If dis is wat u r doing, den its wrong. If gettin MAX value is wat ur requirement all about, den try fetchin it at ur UNIX lvl interface b4 performin it at DS lvl. Once u 've ur MAX value frm UNIX, den u can go ahead n use it in ur job usin a Command Activity stage n later use $CommandOutput to fetch its value.

Hope dis resolves ur prob requirement. Let me know if dis has helped u out r not.
Regards
Ajay
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Good Lord, is that a sample of your work site documention / composition skills? Please cease with the texty-chatty-dis-den-dat-ur-wat crap and use a professional level of English here. Use all of your fingers to type, not just your thumbs and spell out your dang words. Please. :evil:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

The only word missing there is "innit"
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Word! [gangsta pose]
-craig

"You can never have too many knives" -- Logan Nine Fingers
ajay.vaidyanathan
Participant
Posts: 53
Joined: Fri Apr 18, 2008 8:13 am
Location: United States

Setting Command Output to the job parameter

Post by ajay.vaidyanathan »

Sorry guys....will definitely keep it in mind.....
Regards
Ajay
datisaq
Participant
Posts: 154
Joined: Wed May 14, 2008 4:34 am

Post by datisaq »

Thanks Craig, i got the output after searching in the forum.
IBM Certified - Information Server 8.1
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

8) Thanks, always best to search first as (more than likely) you're not the first to encounter the problem.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply