I looked around on the forum but not able to exactly execute it for some reason using the custom transfer program.
Requirement
Upload flat file to ftp location at the end of the data extraction from sql database.
Custom batch program to upload ftp file ftp.bat in C:/ drive
@echo off
set USER=%1
set PASSWORD=%2
set LOCAL_DIR=%3
set FILE_NAME=%4
set LITERAL_HOST_NAME=%5
set REMOTE_DIR=%6
echo open %LITERAL_HOST_NAME%>>ftpcommand.txt
echo %USER%>>ftpcommand.txt
echo %PASSWORD%>>ftpcommand.txt
echo lcd %LOCAL_DIR%>>ftpcommand.txt
echo cd %REMOTE_DIR%>>ftpcommand.txt
echo ascii>>ftpcommand.txt
echo get %FILE_NAME%>>ftpcommand.txt
echo disconnect>>ftpcommand.txt
echo bye>>ftpcommand.txt
DI Job design
SC->DF
SC = Set all the ftp parameter as below
$AW_USER =‘userid’;
$AW_PASSWORD =‘password’;
$AW_LOCAL_DIR =‘C:\Documents and Settings\datawarehouse\My Documents'’;
$AW_FILE_NAME=‘test.csv’;
$AW_Host =‘10.10.10.176’;
$AW_Remote_Loc=‘\inbox\volrec'’;
DF = Transfer data from source sql table to flat file
In the flat file I have select yes for custom transfer program and then in
program executable: C:\ftp.bat
Arguments:$AW_USER $AW_PASSWORD $AW_Local_Dir $AW_File_name $AW_HOST $AW_Remote_LOC
I have left User Name and password empty.
The issue is that the global variable value for $AW_User, $AW_Password, etc do not pass and it stays empty. So my ftpcommand.txt file is as below
ftp
$AW_Local_Dir
$AW_File_name
lcd $AW_HOST
cd
ascii
put $AW_Remote_LOC
disconnect
bye
instead of
ftp 10.10.10.176
userid
password
lcd C:\Documents and Settings\datawarehouse\My Documents
test.csv
cd \inbox\volrec
ascii
put test.csv
disconnect
bye
What am I missing here [/b]
thakks (BOB member since 2006-10-24)