issue while the parameter value

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
dr.murthy
Participant
Posts: 224
Joined: Sun Dec 07, 2008 8:47 am
Location: delhi

issue while the parameter value

Post by dr.murthy »

hi all,

iam facing an issue with the EXEC COMMMAND ACTIVITY,my reqirement is just capture the date value from a file and pass these value to next job as a paramter.i design a job like EXECUTE_COMMAND_ACTIVITY------>JOB_ACTIVITY .in execute command activity i define ccommand as

Code: Select all

more /tmp/practice/sample.txt
then i pass the value to next job activity as a pameter by calling

Code: Select all

Execute_Command_0.$CommandOutput
.
iam getting the error some thing like ch..JobControl (@Job_Activity_7):
Controller problem: Error calling DSSetParam(FNAME), code=-4
[ParamValue/Limitvalue is not appropriate]
any suggestions to resolve this issue
D.N .MURTHY
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The output of the "more" command most likely contains more than just the filename, it will also have a linefeed. Use "echo" on the return value to see what it contains, then you can parse out the actual filename with a SUBSTR() or FIELD() command.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Code: Select all

Convert(@FM,'',Execute_Command_0.$CommandOutput)
Or If the output is a single line then

Code: Select all

Field(Execute_Command_0.$CommandOutput,@FM,1)
You need to remove field characters when setting job parameters.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Searching for "ParamValue/Limitvalue is not appropriate" would have answered all of your questions as you are not the first to encounter it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dr.murthy
Participant
Posts: 224
Joined: Sun Dec 07, 2008 8:47 am
Location: delhi

Post by dr.murthy »

hi,

could you please clear me Execute_Command_0.$CommandOutput
what it will return.lets suppose when execute a command

Code: Select all

echo chh 
through the exex command activity.can we capture the result of the command chh through Execute_Command_0.$CommandOutput.

could you please any body clear me
D.N .MURTHY
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Simplest way to find out is to try it... what happens? $CommandOutput will capture anything the command writes to standard out, i.e. outputs to the 'screen'.
-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 »

The $CommandOutput activity variable will include the output of the command (that is, by default, stdout) with all line terminator characters converted to field mark characters.

A field mark character can be represented in a DataStage expression using the @FM system variable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dr.murthy
Participant
Posts: 224
Joined: Sun Dec 07, 2008 8:47 am
Location: delhi

Post by dr.murthy »

chulett wrote:Simplest way to find out is to try it... what happens? $CommandOutput will capture anything the command writes to standard out, i.e. outputs to the 'screen'. ...


i tried but it returns the value -1 instead of chh
D.N .MURTHY
dr.murthy
Participant
Posts: 224
Joined: Sun Dec 07, 2008 8:47 am
Location: delhi

Post by dr.murthy »

If the output is a single line then

Code: Select all

Field(Execute_Command_0.$CommandOutput,@FM,1)
You need to remove field characters when setting job parameters.[/quote]


hi ,

thanks for your reply,finally i got a solution.i need a one more clarification why we need to use a field function ,when pass the out put result value as a paramter.
D.N .MURTHY
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The $CommandOutput activity variable will include the output of the command (that is, by default, stdout) with all line terminator characters converted to field mark characters.

A field mark character can be represented in a DataStage expression using the @FM system variable.
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