Delete file after FTP

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

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

Post by chulett »

First suggestion would be to start your own post. If you really feel the need to include this one in the conversation, link to it.

Second suggestion would be to correct your 'Telnet prompt' value. The default in the stage isn't always appropriate, you'll need to correct it to match what your telnet session is actually seeing.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

chulett wrote:First suggestion would be to start your own post. If you really feel the need to include this one in the conversation, link to it.

Second suggestion would be to correct your 'Telnet prompt' value. The default in the stage isn't always appropriate, you'll need to correct it to match what your telnet session is actually seeing.
Sorry for continuing in the same link but i dont know how to link it.

Regarding the telnet prompt, below are the settings in my job.

Number of Telnet Promps: 2
Telnet Prompt 1: login
Telnet Reply 1: dsadm
Telnet Prompt 2: password
Telnet Reply 2: dsadm

here dsadm is the user name we are using to login in DS and dsadm is the password as well. Please let me know if I need to change any settings.

And how to find whats the prompt the telnet session is expecting?
Aim high
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is the prompt perhaps "login: " rather than "login"?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

ray.wurlod wrote:Is the prompt perhaps "login: " rather than "login"?
I tried "login:" but it didnt work either. But I have a basic doubt. Please clear the same.

Datastage is installed in Server A and the path where I am trying to do Ftp is server B. So in the telnet user/password, I have given the user/password which I use to login to connect to DS. Also in the parameter "Remote telnet Port" , I have given the telnet port number of DS Server(A). Is this correct?

Also the FTP connection mode is set to Passive. Should i set it to Active?
Aim high
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

I just read that Telnet is insecure and ssh should be used to transfer the files. is this correct? If yes then how can I do this using DS? Shell Script?
Aim high
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I just read that gays cause earthquakes. Is it true? (It was in the Hobart Mercury (newspaper - one of Rupert Murdoch's) so it must be true.)

Come on, attribute your sources. None of this "I heard" or "my invisible friend told me" please!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

ray.wurlod wrote:I just read that gays cause earthquakes. Is it true? (It was in the Hobart Mercury (newspaper - one of Rupert Murdoch's) so it must be true.)
:) got the point... So coming back to the problem.. which server telnet port number i need to provide and how to find the telnet login prompt?
Aim high
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Telnet uses well-known port number 23. SSH uses well-known port number 22. It is possible to change these assignments, but almost never worth it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

nkln@you wrote:Sorry for continuing in the same link but i dont know how to link it.
Come on... a link is a URL to the post in question. You get that from the Forum view or the address bar in your brower and then you paste it into your post. It's not rocket science.
nkln@you then wrote:Regarding the telnet prompt, below are the settings in my job.

Number of Telnet Promps: 2
Telnet Prompt 1: login
Telnet Reply 1: dsadm
Telnet Prompt 2: password
Telnet Reply 2: dsadm

here dsadm is the user name we are using to login in DS and dsadm is the password as well. Please let me know if I need to change any settings.

And how to find whats the prompt the telnet session is expecting?
You manually issue the telnet command from the command line and note the prompts that you get, then make the stage match.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

chulett wrote: And how to find whats the prompt the telnet session is expecting?
You manually issue the telnet command from the command line and note the prompts that you get, then make the stage match.
When I issued the telnet command, no prompt came at all. Instead a new blank screen opened up. Can you Please guide on this.
Aim high
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You need to telnet somewhere, did you do that or just type 'telnet'? So, telnet to the server in question and see what happens. Note that you may need to fully qualify the server name:

telnet xxxxxx

telnet xxxxxx.yyyyyy.com
-craig

"You can never have too many knives" -- Logan Nine Fingers
deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

Re: Delete file after FTP

Post by deva »

srimitta wrote:Hi,

I have a job which pulls data from unix box using DataSatge ftp stage, and on sucessful run I need to delete source file.

Source file is on different Unix box and my DataStage server is on different Unix box.

Any thoughts........

Thanks
Mitta
Hi,
we can do in many ways, it is very simple if you wirte a shall script . IN that shall script , first grep the status , then if you want move or can delete file. Call that script in Datastage job(after subroutine).
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

ftp is so 90's. You need to use scp. You setup an RSA secured key one time between two machines. Then, ssh and scp work without any password prompts. You use scp just like cp, except you denote the file location/destination with a server hostname in the filename. It even uses wildcards! Checkitout.... 8)
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:lol: Ken, dragging the conversation into the 21st century, who woulda thunk it?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Yep, and ssh can execute remote commands easily too.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply