Execute Command(using a Script to FTP)

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
sheema
Premium Member
Premium Member
Posts: 204
Joined: Sat Jul 22, 2006 10:20 am

Execute Command(using a Script to FTP)

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

Sheema
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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]
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

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

Where's the "Any" key?-Homer Simpson
sheema
Premium Member
Premium Member
Posts: 204
Joined: Sat Jul 22, 2006 10:20 am

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

Sheema
Post Reply