Page 1 of 1

Execute Command(using a Script to FTP)

Posted: Wed Jul 26, 2006 1:45 pm
by sheema
I have a sequence job,in that i am using a Execute Command activity to FTP a file to a mainframe server.I am getting the Exit status for the FTP script as 0,but it says file or directory not found.Where as the file is present in that directory.
I have manually checked transferred the file,it is getting FTPed.

Below is the output which i am getting from the Execute Command

TestFTP..JobControl (@Execute_Command_0): Executed: /usr/ascential/work/Scripts/Other/FTP.sh cenvse prog ftp /usr/ascential/work/OutputFiles/ReportFactory/ G_ws_mov_hist_out.txt /usr/ascential/work/Logs/Other
Reply=0
Output from command ====>
G_ws_mov_hist_out.txt: A file or directory in the path name does not exist.


The Script which i am using to FTP file is below

remote_server="${1}"
remote_user="${2}"
remote_passwd="${3}"
remote_path="${4}"
remote_file="${5}"
local_path="${6}"
local_file="${7}"
log_path="${8}"


ftp -v -n $remote_server << eof >> $log_path/$local_file.log
user "$remote_user" "$remote_passwd"
lcd $local_path
cd $remote_path
prompt
put $local_file $remote_file
eof

Any hint in this matter will help me.

Posted: Wed Jul 26, 2006 1:50 pm
by DSguru2B
Seems like there is a space before the file name
ftp /usr/ascential/work/OutputFiles/ReportFactory/ G_ws_mov_hist_out.txt [/b]

Posted: Wed Jul 26, 2006 1:53 pm
by kris007
Reply =0 means that the command executed was correct syntax wise.

The output from the command is the message you need to look for. Did you try executing your statement outside DataStage from the command line? Were you able to run it successfully? From the output, it is pretty clear that you are messing it up somewhere with the paths.

Posted: Wed Jul 26, 2006 4:06 pm
by sheema
Yes,I have tried it from the command line,it is working fine.

I have tried Transferring the same file to same ETL server ,but a different directory.Than it is working fine,that says there is nothing wrong with the
source file path.