Urgent Regarding FTP stage
Moderators: chulett, rschirm, roy
Urgent Regarding FTP stage
Can anyone help me with this issue ?
i have to develop a job that will ftp files from remote server to my local and also rename the ftped file once the ftp is done.
like if i have text1.txt i ftp that to my local and then rename it to text2.txt on the remote server side.
also it must be done for more than one file.
help me.
Programmer Analyst,
Cognizant,
Chennai.
i have to develop a job that will ftp files from remote server to my local and also rename the ftped file once the ftp is done.
like if i have text1.txt i ftp that to my local and then rename it to text2.txt on the remote server side.
also it must be done for more than one file.
help me.
Programmer Analyst,
Cognizant,
Chennai.
There is no need to 'rename' the file on the other side in DataStage anymore than you need to do that in a 'regular' ftp. The name of the file that you feed into the ftp stage doesn't need to bear any resemblance to the file name on your ftp target.
Simply supply the 'new' name in the ftp stage.
-craig
Simply supply the 'new' name in the ftp stage.
-craig
Well, let me see..
In it's simplest form, let's say you have a job with only a Sequential Stage and an FTP stage. In the Sequential stage you specify that directory and name of the file to be transferred, in your example 'text1.txt' is the file name. In the FTP stage on the General / Properties tab you supply Server Name to FTP to plus the Userid and Password required to log on. On the Input / Properties tab you then have to specify the 'Remote Path', ie where you want the file to go, and also the 'Remote File Name' ie what you want it called on the target server. To continue your example, you would put 'text2.txt' in as the 'Remote File Name' and that's what it will be called on the target server, no renaming required.
Does that answer your question now or am I missing something in what you are actually trying to do?
-craig
In it's simplest form, let's say you have a job with only a Sequential Stage and an FTP stage. In the Sequential stage you specify that directory and name of the file to be transferred, in your example 'text1.txt' is the file name. In the FTP stage on the General / Properties tab you supply Server Name to FTP to plus the Userid and Password required to log on. On the Input / Properties tab you then have to specify the 'Remote Path', ie where you want the file to go, and also the 'Remote File Name' ie what you want it called on the target server. To continue your example, you would put 'text2.txt' in as the 'Remote File Name' and that's what it will be called on the target server, no renaming required.
Does that answer your question now or am I missing something in what you are actually trying to do?
-craig
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
hey guys,
thanx very much for those answers, that clearly explains about how should i go about doing thingz with an FTP Stage, still (sorry..) i dont think you have understood my question guys.
I have an ftp server and iam ftping things to my local(that doesnt matter i know) but my question was to download files not a single file..using a single job that runs once.
Also after i ftp the files to my local, the filenames must be changed on the server side..not surely on the client side.
please do help me.
Programmer Analyst,
Cognizant,
Chennai.
thanx very much for those answers, that clearly explains about how should i go about doing thingz with an FTP Stage, still (sorry..) i dont think you have understood my question guys.
I have an ftp server and iam ftping things to my local(that doesnt matter i know) but my question was to download files not a single file..using a single job that runs once.
Also after i ftp the files to my local, the filenames must be changed on the server side..not surely on the client side.
please do help me.
Programmer Analyst,
Cognizant,
Chennai.
I don't think u can ftp multiple flenames ..I think u might need to go two job strategy and run the second Job(ur actual job) with different filenames....U can read the filenames from a sequential file containing all filenames if the filenames are all fixed.
If ur DS server is on windows can't u execute a batch file(in Exec DOS command) this kept on ur server and commands inside manuplating on the Ftp server side(i.e renaming the file etc)....
Hope this might help...
If ur DS server is on windows can't u execute a batch file(in Exec DOS command) this kept on ur server and commands inside manuplating on the Ftp server side(i.e renaming the file etc)....
Hope this might help...
For the second answer what i meant was if u have batch file in which u can have connect to the server through ftp comand
and within that all the commands pertainning to the local server...
I am talking abt .bat files in windows we create to automate generally the ftp's etc...
So through the EXEC DOS option run....
I think if u connect using FTP mode u can give the rename command forgotten the command u can check it out...
Or check out the rsh command also
and within that all the commands pertainning to the local server...
I am talking abt .bat files in windows we create to automate generally the ftp's etc...
So through the EXEC DOS option run....
I think if u connect using FTP mode u can give the rename command forgotten the command u can check it out...
Or check out the rsh command also
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Within FTP you can use MPUT to send, or MGET to retrieve, multiple files based on a regular expression. Use PROMPT to disable FTP prompting for each name resolved via a wildcard.
You can also supply a list of file names (even on stdin) for FTP to process.
Check out the man page for the ftp command on your server. Or, if on a Windows platform, get into ftp in a DOS shell then use the help subcommand. Here you will learn about RENAME and the other subcommands referred to by earlier posters.
You can also supply a list of file names (even on stdin) for FTP to process.
Check out the man page for the ftp command on your server. Or, if on a Windows platform, get into ftp in a DOS shell then use the help subcommand. Here you will learn about RENAME and the other subcommands referred to by earlier posters.
How do you use the mget command in the FTP stage? I need to ftp some data files from an unix box. The number of files will vary each day, but they are named the same with a ".##' appended i.e. datafile.01, datafile02...
Due to restrictions on the user id I use to FTP, I can not do a telnet command. Otherwise I would do a "cat datafile.* > bigdatafile" and FTP over bigdatafile. Looking for a solution that will still use the FTP stage and be straight forward for our operations team to support and troubleshoot.
I would like to use the Mget command, but not sure how to use with the FTP stage.
Appreciate any help or advice you have.
Thanks
Due to restrictions on the user id I use to FTP, I can not do a telnet command. Otherwise I would do a "cat datafile.* > bigdatafile" and FTP over bigdatafile. Looking for a solution that will still use the FTP stage and be straight forward for our operations team to support and troubleshoot.
I would like to use the Mget command, but not sure how to use with the FTP stage.
Appreciate any help or advice you have.
Thanks
-
- Premium Member
- Posts: 385
- Joined: Tue Oct 07, 2003 4:55 am