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

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
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

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

Post 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.
pnchowdary
Participant
Posts: 232
Joined: Sat May 07, 2005 2:49 pm
Location: USA

Post 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
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post 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)
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Perform an ftp.
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply