Page 1 of 1

How to copy a file from a different machine on a network to.

Posted: Wed Jul 13, 2005 3:34 pm
by I_Server_Whale
Hi All,
I need to copy a flatfile from one machine on the network to the DataStage Server box. How do I achieve this? If I should write a DOS command, Can I write the "copy" command in the "ExecDOS" as a before job subroutine?

My Source location is

\\xxxx\yyy\zzzz\output\ART_SAP_TO_FMI.txt

My target location is

E:\datastage\int400\input\

Can I write the below command as the input value for the "ExecDOS" in the before job subroutine?

Code: Select all

copy \\sapfs1\D01\int400\output\ART_SAP_TO_FMI E:\datastage\int400\input\
Will this copy the source file into the target location before the actual job starts? If not, please let me know any other ways of doing it.

Thanks in Advance,
Naveen.

Posted: Wed Jul 13, 2005 4:18 pm
by pnchowdary
Hi Naveen,

You can use the remote copy UNIX command (rcp) in a shell script and use the "ExecSH" as a before job subroutine.

Thanks,
Naveen

Posted: Wed Jul 13, 2005 4:35 pm
by Kryt0n
If it is a mapped drive (or at least accessible from the DS server), would you really need to copy it first? Or is this a design principle?

I'm assuming you are specifying the input file as a parameter, if so, you would still be working on this file during your parsing/transformations rather than the file you put to your DS server.

If it needs to be on the DS server before running the DS job, either copy it manually or add it to a batch job (ideally the one that kicks off your DS job)

Posted: Thu Jul 14, 2005 3:14 am
by Sainath.Srinivasan
Perform an ftp.

Posted: Thu Jul 14, 2005 4:09 am
by Krazykoolrohit
FTP solves the issue all right. but what if the two servers are unix and windows. FTP takes a lot of time to do this.
is there any alternative method to do so?

Posted: Thu Jul 14, 2005 6:02 am
by ray.wurlod
Provided the other machine is visible and your authentication is OK, then a DOS-level COPY command as you suggested will be fine.

The before-job subroutine is executed before anything else happens.

Before any stage is opened, before any connection to a database is opened, before any file is opened, and so on.

So the proposed solution is adequate and sufficient subject to the caveats above.