How-to Delete remote file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mavrick21
Premium Member
Premium Member
Posts: 335
Joined: Sun Apr 23, 2006 11:25 pm

How-to Delete remote file

Post by mavrick21 »

Hello,

I have a requirement to read files present on remote Windows shared drive and process it further. Once processing is complete the ETL code should be able to delete remote files. To read remote file on Windows shared drive I use FTP stage but I'm unable to figure out how to delete that file from DataStage or UNIX. If the remote server were to be UNIX then I would use rsh but not sure how to proceed since it's Windows server. Any help would be appreciated.

Thanks for your time
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I believe you would use rsh for this as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

On your windows server, install the Cygwin's OpenSSH server and client utilities. Then you should be able to delete the files on the Windows server.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Does not the FTP stage allow an "after" telnet command? You could use this to delete the file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mavrick21
Premium Member
Premium Member
Posts: 335
Joined: Sun Apr 23, 2006 11:25 pm

Post by mavrick21 »

@chullet,
I believe rsh would work on remote Windows machine if MKS toolkit is installed and rsh is configured.

@lstsaur
Not sure if my Windows admin would let me install a Cygwin's server. I'll try Ray's advice first and if it doesn't work then I'll go with Cygwin approach.

@all
Thanks guys.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

For the FTP stage, make sure you've got all of the permissions you'd need. Just because you can ftp somewhere doesn't automatically mean you can telnet there as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
mavrick21
Premium Member
Premium Member
Posts: 335
Joined: Sun Apr 23, 2006 11:25 pm

Post by mavrick21 »

Thanks Craig. I'll keep that in mind :D
jinm
Premium Member
Premium Member
Posts: 47
Joined: Tue Feb 24, 2004 1:59 am

Post by jinm »

ray.wurlod wrote:Does not the FTP stage allow an "after" telnet command? You could use this to delete the file.
in cases where you don't know which files you will get (ex 3 files one day 6 files next day) what if new file emerges just after you have "gotten" your files.

Don't you risk getting 3 files, but in the "after" you will delete 4 files ???
jinm
Premium Member
Premium Member
Posts: 47
Joined: Tue Feb 24, 2004 1:59 am

Post by jinm »

ray.wurlod wrote:Does not the FTP stage allow an "after" telnet command? You could use this to delete the file.
in cases where you don't know which files you will get (ex 3 files one day 6 files next day) what if new file emerges just after you have "gotten" your files.

Don't you risk getting 3 files, but in the "after" you will delete 4 files ???
Post Reply