Page 1 of 1

Bat file returns invalid command in datastage

Posted: Fri Nov 13, 2009 2:58 am
by jinm
To import multible ftp files I created bat file:

ftp -s:E:\data\PROD\TEMPFILES\FINTRANS\GETFINTRANSMD.parm hostname

parm file holds the following content:

username
password
text
cd correct_path
prompt
mget File*.EXP
bye


running bat file from cmd (outside datastage) works perfect
From DS Job tried two things.

cmd stage calling the bat file - which I expected to work with no problem
but it returns

FTPTEMPLTEST..Command_Stage_0: User (hostname:(none)): Invalid command.
Interactive mode Off .

Then I tried file stage with BeforeJobRoutine as
both bat file, as well as with full string :
ftp -s:E:\data\PROD\TEMPFILES\FINTRANS\GETFINTRANSMD.parm hostname

Both returns
*** Output from command was: ***
User (hostname:(none)): Invalid command.


Anybody has the magic touch ???

Posted: Fri Nov 13, 2009 3:32 am
by ArndW
Is drive "E" a local drive or a remotely mounted one?

Posted: Fri Nov 13, 2009 3:33 am
by jinm
ArndW wrote:Is drive "E" a local drive or a remotely mounted one?
A local physical drive

Posted: Fri Nov 13, 2009 3:35 am
by ArndW
Strange indeed. Are you passing a constant string value for "hostname" in your DS job?

Posted: Fri Nov 13, 2009 3:36 am
by jinm
ArndW wrote:Strange indeed. Are you passing a constant string value for "hostname" in your DS job?
No - it is only listed in the batch file

Posted: Fri Nov 13, 2009 3:38 am
by jinm
ArndW wrote:Strange indeed. Are you passing a constant string value for "hostname" in your DS job?
No - it is only listed in the batch file

Posted: Fri Nov 13, 2009 3:40 am
by ArndW
If you put an echo in the bat file does that print out to the log, i.e. does the BAT file get called correctly?

Posted: Fri Nov 13, 2009 4:18 am
by jinm
empty entry

Posted: Fri Nov 13, 2009 4:18 am
by jinm
RESOLVED :)

Removed hostname from bat file and started params file with open host.
and removede TEXT
TEXT was what initiated the "invalid command"

new param file:

open hostname
username
password
cd correct path
prompt
lcd Targetdirectory
mget FILES*.EXP
bye

Thanks for the promp assistance

Posted: Fri Nov 13, 2009 7:34 am
by chulett
What was 'text' supposed to accomplish? Did you perhaps mean 'ascii' instead?

Please mark your post as Resolved using the button at the top of the page. Thanks.

Posted: Fri Nov 13, 2009 7:37 am
by jinm
Thought I had marked it already

TEXT = ASCII :shock: