scp command not working from datastage

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
midmaxds
Premium Member
Premium Member
Posts: 71
Joined: Mon Oct 26, 2015 11:44 am

scp command not working from datastage

Post by midmaxds »

Hi,
We are calling the scp command using expect utility from our unix server to transfer a file to MDM server.
The command works fine while running from unix.

But when calling from after job sub routine/ Execute shell stage, the file is not getting transferred.

There are no error messages too. The job is completing without any errors.
The script is getting invoked. We added a puts command after the file transfer step to echo "hello" to make sure it is executed, and it prints the output.

Could you please help to identify the issue? Please let me know if more information is needed.
Midhun
UCDI
Premium Member
Premium Member
Posts: 383
Joined: Mon Mar 21, 2016 2:00 pm

Post by UCDI »

Is it possibly a permissions issue on the datastage account?
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

debug the command.

before your SCP in your execute stage do this:

echo $PWD; whoami; echo "scp $blah $blah1"; scp blah blah1;

you will see the output of those echo statements in your sequencer logs of course.
But it will tell you tons.

A) your Current working directory (assumed to be your project directory unless you overwrote that via parms)
B) Your execution user id since you might have credential mapping turned on.
C) command parms to scp at the time of execution.

I'm really surprised that you did not get any feedback in the logs, even with the expect statements.

Also... why would you have an expect unless you do not have an ssh key set up between both systems. If you had an ssh key... no prompts would show up.
midmaxds
Premium Member
Premium Member
Posts: 71
Joined: Mon Oct 26, 2015 11:44 am

Post by midmaxds »

Thanks for the responses.
The user ID has full permissions. So it could not be an issue.

Meanwhile, we tried to a wait command in between and the file is getting transferred now. Thanks again!
Midhun
Post Reply