Page 1 of 1

Pass parameter value to routine activity Input Argument

Posted: Tue May 06, 2008 1:29 am
by pratyusha
Hi all
I have a sequence stage which runs five jobs in parallel and creates some files.These files I have to concatenate and create another output file.
For this concatenation,I have written a UNIX script which will take the File Path as parameter.All these days i have been hardcoding this File Path
Now I have to invoke this script after the sequence as a routine activity.I have to use ExecSh routine to do this
My problem is I am able to invoke the script.
In the value expression I have given the path where the script is present and it works
But the File Path hardcoding should be removed and it also has to be passed as a parameter during the sequence run

What will I write in my Value Expression for the routine activity to invoke the script and then use the FilePath parameter as an input for the concatenation script

Posted: Tue May 06, 2008 1:39 am
by BugFree
Define the file path parameter as a job parameters. And give the parameter name in the value expression.

Posted: Tue May 06, 2008 3:27 am
by pratyusha
In the value expression i have now
$SHELL_SCRIPT_PATH
This is calling the script
Now I want to pass the file path parameter
What is the syntax for this?
I have defined the parameter in the Job Parameters also as
$SHELL_SCRIPT_PATH=/app/carsdev/scripts/p3.ksh
$CARS_OUTBOUND_EXTRACT_PATH=/app/carsdev/data/output/
I have tried
$SHELL_SCRIPT_PATH.$CARS_OUTBOUND_EXTRACT_PATH
$SHELL_SCRIPT_PATH($CARS_OUTBOUND_EXTRACT_PATH) etc
I know they are wrong but I am playing around :oops:
Can someone suggest?

Posted: Tue May 06, 2008 7:12 am
by pratyusha
Hi all
Instead of doing it thru Routine Activity I am using command stage now
I use this in the Command box
ksh
and in the parameters box I am giving the path for the script like
#$SHELL_SCRIPT_PATH#p3.ksh
Now this script needs 1 input parameter from datastage .The name of the parameter being #$CARS_OUTBOUND_EXTRACT_PATH#

Now how can I give these two paramters.Any suggestions wud be appreciated

Posted: Tue May 06, 2008 7:58 am
by chulett
Put "#$SHELL_SCRIPT_PATH#p3.ksh #$CARS_OUTBOUND_EXTRACT_PATH#" in the 'parameters' box, without the quotes of course.

Posted: Tue May 06, 2008 8:16 am
by pratyusha
Sorry but I get this error

CopyOfsqDACOutbnd..JobControl (ExecSH): Error when executing command: /app/carsdev/scripts/p3.ksh /app/carsdev/data/output/
*** Output from command was: ***
SH: /app/carsdev/scripts/p3.ksh: cannot execute

Posted: Tue May 06, 2008 8:23 am
by pratyusha
I am sorry.There was a mistake
The job does not abort now but the log stops here
There is no completion for the job.
The output file is created but there is no data in it
The log looks like this

Starting Job CopyOfsqDACOutbnd.
Environment variable settings:
CopyOfsqDACOutbnd..JobControl (@Coordinator): Starting new run of checkpointed Sequence job

There is no more progress from here
Please advise

Posted: Tue May 06, 2008 4:10 pm
by ray.wurlod
Instead of trying to use ExecSH, add an Execute Command activity in your job sequence, and execute the shell script from there.

Posted: Wed May 07, 2008 1:51 am
by pratyusha
I am using Execute Command stage
The log stops here as I have told
I dont know what i am missing

Posted: Wed May 07, 2008 2:35 am
by OddJob
sounds like a parameter isn't being passed. The cat command is receiving 'blank' as its first param.

cat will sit there indefinately if you don't pass it a param e.g. cat > afile.txt

Posted: Wed May 07, 2008 7:01 am
by chulett
pratyusha wrote:I am sorry.There was a mistake
The job does not abort now but the log stops here
What was 'the mistake' and what did you change? As noted, it sounds like the command is hanging, the question is why.