Hi All
I have a flat file (csv) with 40 columns, i want to FTP the flatfile to other place. Here my question is can i ftp flatfile with 40 columns using Datastage FTP Stage. If so can u pls tell me how can i FTP Flatfile.
I m trying in my job as,
SequentialFile -----> FTP Stage.
but i m unable to ftp the file.
I m not using any transfomer stage in between sequential stage and FTP stage.
File is not getting ftping.
Can u pls tell me what are the steps i need to follow.
Thanks in Advance
SAS
I want to FTP Flatfile (Urgent, pls tell me the solution)
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 62
- Joined: Wed Dec 08, 2004 2:26 am
Re: I want to FTP Flatfile (Urgent, pls tell me the solution
Yes, you can! Even one with 40 columns.sasidhar_kari wrote:I have a flat file (csv) with 40 columns, i want to FTP the flatfile to other place. Here my question is can i ftp flatfile with 40 columns using Datastage FTP Stage.
Why not?but i m unable to ftp the file.
That's fine. Perhaps not ideal, but shouldn't stop it from working.I m not using any transfomer stage in between sequential stage and FTP stage.
Again, why not? What kind of error messages are you getting? Have you tried ftp'ing the file from the command line to verify that you have the proper information for the target system - host, userid, password, target directory, etc - all are valid? Have you tried setting the Trace Level up higher than zero in the stage to gather more information?File is not getting ftping.
First make sure you can ftp the file to the intended location outside of a DataStage job. Then, the only steps after that are to properly configure the FTP Stage in your job to match.Can u pls tell me what are the steps i need to follow.
No, it's not. We're all volunteers here, are glad to help and - here's the key - post when we can. If you truly have an 'urgent' need for an answer, call your Support provider and tell them it's urgent.Urgent, pls tell me the solution
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 64
- Joined: Fri Jul 16, 2004 7:53 am
HI SAS,
Some more inputs about FTP Stage, whenever you involve in FTP staging try to have some checking before and after the FTP stage. You can use your own logic to check whether the FTP has been completed successfully or not.. for example, you can have header and footer on your file and check for the same on the file after the FTP. can you provide some information on what is the problem you are actually facing...
I hope this information will be useful...
Thanks
Sudharsanan AN
Some more inputs about FTP Stage, whenever you involve in FTP staging try to have some checking before and after the FTP stage. You can use your own logic to check whether the FTP has been completed successfully or not.. for example, you can have header and footer on your file and check for the same on the file after the FTP. can you provide some information on what is the problem you are actually facing...
I hope this information will be useful...
Thanks
Sudharsanan AN
-
- Premium Member
- Posts: 62
- Joined: Wed Dec 08, 2004 2:26 am
Thanks Sudarsanan for u r replay,
Now i m able to FTP the file from my Dev server to FTP Server.
Now the problem is in the output after FTP, i need to use TAB Delimiter . I mean i need TAB Delimited output file. I m using 009 as tab delimiter in the FTP stage it self but in the output file '0' is coming in between the values like SIN123 0 AWB456 0 239 0 . Actually my original data is
SIN123 AWB456 239. zero is coming between the values. Can any one help me in this regard.
Thanks in Advance.
SAS
Now i m able to FTP the file from my Dev server to FTP Server.
Now the problem is in the output after FTP, i need to use TAB Delimiter . I mean i need TAB Delimited output file. I m using 009 as tab delimiter in the FTP stage it self but in the output file '0' is coming in between the values like SIN123 0 AWB456 0 239 0 . Actually my original data is
SIN123 AWB456 239. zero is coming between the values. Can any one help me in this regard.
Thanks in Advance.
SAS
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Are you having zeroes AND tabs between your data, or just zeroes?
Either way you can use Ereplace() or Change(). For example;Note that the second argument has three characters, space zero space, because this is how you described your data.
If there are no spaces the problem is more difficult unless your data are in fixed-width format, in which case you can use substring techniques to extract individual field values, and concatenation to assemble the required result.
Tip: Create a stage variable svTab, initialized to Char(9) and not derived, and use this instead of Char(9) for tab. That way you only evaluate the function Char(9) once.
Either way you can use Ereplace() or Change(). For example;
Code: Select all
Ereplace(InLink.TheString), " 0 ", Char(9), -1, 0)
If there are no spaces the problem is more difficult unless your data are in fixed-width format, in which case you can use substring techniques to extract individual field values, and concatenation to assemble the required result.
Tip: Create a stage variable svTab, initialized to Char(9) and not derived, and use this instead of Char(9) for tab. That way you only evaluate the function Char(9) once.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 62
- Joined: Wed Dec 08, 2004 2:26 am
Since the FTP stage is metadata driven it can hork up your data during the process if everything isn't exactly right. It sounds like somehow the FTP stage thinks it needs to add the zeroes for you. What is the delimiter setting you are using in the FTP stage itself?
A 'trick' you might want to try with the FTP stage. If your flat file has already been created to look like what it should look like on the target system (and it usually has been) - then lie about it. By 'lie' I mean define the record as a single, long string in the feeder Sequential File stage.
So, for a delimited file, pick the longest the record could be and tell it that you have a single Varchar field of that size. Set the delimiter in the Sequential stage to something not in the data - like a pipe or a caret. Won't matter what you tell it the delimiter is to use in the FTP stage as it won't add one. The only problem becomes the quote character, so set that to blank ('000' in the Sequential, literally blank from what I recall in the FTP stage) so it won't add quotes around each record as it sends them.
Something to consider if you have issues getting it to work as is...
A 'trick' you might want to try with the FTP stage. If your flat file has already been created to look like what it should look like on the target system (and it usually has been) - then lie about it. By 'lie' I mean define the record as a single, long string in the feeder Sequential File stage.
So, for a delimited file, pick the longest the record could be and tell it that you have a single Varchar field of that size. Set the delimiter in the Sequential stage to something not in the data - like a pipe or a caret. Won't matter what you tell it the delimiter is to use in the FTP stage as it won't add one. The only problem becomes the quote character, so set that to blank ('000' in the Sequential, literally blank from what I recall in the FTP stage) so it won't add quotes around each record as it sends them.
Something to consider if you have issues getting it to work as is...
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers