Regarding ftp stage,want to ftp files from remote server

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
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Regarding ftp stage,want to ftp files from remote server

Post by shaonli »

Hi,

I need to design a job which will import all XML files in a directory of a remote server and put it into a specific path of a DS server.
Then a job will run which will process all the xml files.
How to import all the XML files(names are different) to DS server.
I looked into ftp stage.But I have not found the option to mention the path of DS server.
Please suggest.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create a script on the DataStage server. If the file names conform to a pattern you can use MGET.

Don't use the FTP stage; it tries to transfer a line at a time, and the concept of "line" in XML documents is rather vague.
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 »

They are typically one very long line and thus not at all suitable for the FTP Stage. Stick with a scripted solution.
-craig

"You can never have too many knives" -- Logan Nine Fingers
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post by VCInDSX »

chulett wrote:They are typically one very long line and thus not at all suitable for the FTP Stage. Stick with a scripted solution. ...
Hi Craig, Ray,
As I too am interested in an FTP job, to upload a compressed file from the DS Server to an FTP site, I was wondering how one should plan the error handling from the scripting job.
If a script at the OS level (.bat or .cmd in Windows, e.g.) is launched by an ExecuteSH or ExecuteCommand, how much information can be grabbed from the FTP script upon its completion, especially in case of different types of failures (FTP Permission, Invalid Accounts, interrupted transfer et al...)?
I would appreciate your insight from your odysseys as you both are very experienced in the various aspects of Datastage.

Thanks in advance,
-V
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry, but I can't really speak to a .bat file solution except in generic terms. Scripts should be as robust as possible. Assume nothing. Check as much of the output as you possibly can. :wink:

From a UNIX standpoint, at the very least we capture the $? status and alarm when that is non-zero. For ftp, which we typically control in a 'here document' stype, we 'tee' off a copy of any output to a temp file. Post ftp one could grep the temp file for errors of any kind. Snippet:

Code: Select all

  ftp -ni your.server.com <<!! | tee /tmp/xx$$.out
  user userid password
  asc
  cd wherever
  get whatever
  quit
!!
Hope that helps.
-craig

"You can never have too many knives" -- Logan Nine Fingers
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post by VCInDSX »

Hi Craig,
Thanks for the details. Appreciate it much.
I guess i need to work a bit more on handling these log files when things don't go well with the FTP.
Our DS job has to notify a support team (email notification) with enough details about the job's status after the FTP is executed.
I should, either provide the log information in a separate file and leave it to the support team to review them, or try to parse the error and then load them into the email and/or DS Log.
Need to think a little more which way to go....

Thanks for your time,
-V
Post Reply