ExecSH(Not getting the results as expected)

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
sundar
Participant
Posts: 30
Joined: Thu Sep 01, 2005 10:34 am

ExecSH(Not getting the results as expected)

Post by sundar »

Hi,

I am having a shellScript which appends two files into a another file.
The script has two parameters file1 and file2 and I am appending to another file say file4.I want use this script using my ExecSH routine in my transformer before sub routine.
the Input value I am passing is

sh D:\\folder1\\sam1 D:\\folder1\\file1 D:\\folder1\\file2

where sam1 is shellscript name,file1 is first file(passing as parameter) and file2(passing as parameter) is my second file.
Inside my script I having a file called file4 which gets both file1 and file2 contents.

The job is executing fine.In the log also I can see that the command has executed but when I check the output in my fle4 I am able to see any contents.

The script is working fine when I test it through command line prompt.

Kindly let me know how to pass the Input value arg if the script contains parameters in ExecSh routine.

Regards,
sundar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

sundar,

could you add some echo or type commands to your script that print out the parameters as the script sees them? Perhaps the command isn't being called the way you expect it; i.e. the parameters aren't resolved correctly or there is an issue with a relative or absolute path.
sundar
Participant
Posts: 30
Joined: Thu Sep 01, 2005 10:34 am

Post by sundar »

Hi ArndW,

Thank you very much.Its working fine.Only one problem I have is the concatenated file is getting created at the repository(ie inside my project folder).Kindly let me know if I can do this to get it created in other folder.

Thank you,
Sundar.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Either fully path it or specifically 'cd' to the directory you want to create the file in before you do the concatenation. When you use a relative file path from a DataStage job, that is relative to the Project the job is running in as that is the 'current working directory'.
-craig

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