Pass parameter value to routine activity Input Argument

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
pratyusha
Participant
Posts: 50
Joined: Wed Nov 22, 2006 4:58 am

Pass parameter value to routine activity Input Argument

Post 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
BugFree
Participant
Posts: 82
Joined: Wed Dec 13, 2006 6:02 am

Post by BugFree »

Define the file path parameter as a job parameters. And give the parameter name in the value expression.
Ping me if I am wrong...
pratyusha
Participant
Posts: 50
Joined: Wed Nov 22, 2006 4:58 am

Post 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?
pratyusha
Participant
Posts: 50
Joined: Wed Nov 22, 2006 4:58 am

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Put "#$SHELL_SCRIPT_PATH#p3.ksh #$CARS_OUTBOUND_EXTRACT_PATH#" in the 'parameters' box, without the quotes of course.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pratyusha
Participant
Posts: 50
Joined: Wed Nov 22, 2006 4:58 am

Post 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
pratyusha
Participant
Posts: 50
Joined: Wed Nov 22, 2006 4:58 am

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pratyusha
Participant
Posts: 50
Joined: Wed Nov 22, 2006 4:58 am

Post by pratyusha »

I am using Execute Command stage
The log stops here as I have told
I dont know what i am missing
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

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