Bat file returns invalid command in datastage

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
jinm
Premium Member
Premium Member
Posts: 47
Joined: Tue Feb 24, 2004 1:59 am

Bat file returns invalid command in datastage

Post 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 ???
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Is drive "E" a local drive or a remotely mounted one?
jinm
Premium Member
Premium Member
Posts: 47
Joined: Tue Feb 24, 2004 1:59 am

Post by jinm »

ArndW wrote:Is drive "E" a local drive or a remotely mounted one?
A local physical drive
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Strange indeed. Are you passing a constant string value for "hostname" in your DS job?
jinm
Premium Member
Premium Member
Posts: 47
Joined: Tue Feb 24, 2004 1:59 am

Post 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
jinm
Premium Member
Premium Member
Posts: 47
Joined: Tue Feb 24, 2004 1:59 am

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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?
jinm
Premium Member
Premium Member
Posts: 47
Joined: Tue Feb 24, 2004 1:59 am

Post by jinm »

empty entry
Last edited by jinm on Fri Nov 13, 2009 4:19 am, edited 1 time in total.
jinm
Premium Member
Premium Member
Posts: 47
Joined: Tue Feb 24, 2004 1:59 am

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
jinm
Premium Member
Premium Member
Posts: 47
Joined: Tue Feb 24, 2004 1:59 am

Post by jinm »

Thought I had marked it already

TEXT = ASCII :shock:
Post Reply