Link to home
Start Free TrialLog in
Avatar of tdej437
tdej437

asked on

VB 5.0 FTP a text file from mainframe to c:

I need to get a file from the mainframe with the ftp prot.
Herefore I use the Inet control. I set all properties like they should be and when i get the file over i get binary. How can i get it in a TEXT-FILE on my root( not in a string variabele)???? When I do a usual ftp the file is in text format. Please, help me. It's urgent!!
All help is welcome.
First I want to thank mrmick for his two proposed answers, but I already do
Inet1.Execute ftp://url , "get 'tech.by592.v01.prod' c:\test.txt" .although the problem is the mainframe uses EBCDIC code, that's why the file is on my PC in binary. How can I specify that the file must be in ASCII or convert the file from bin to ASCII.
Avatar of tdej437
tdej437

ASKER

If you have an answer, please choose not the converting, it  will slowdown performance!!
When you request a file using FTP, You get it AS IS.  If you need to convert it to ASCII - you have to do that after you have received it.  Your question here isn't related to FTP.  It should be "How can I convert an EBCDIC text file to an ASCII text file?"

I would suggest you just loop through each character and change each EBCDIC character to its ASCII equivalent.  If you are unable to implement this suggestion… Edit the question, delete it, get a refund on the points, and re-ask it with the above title.  You're much more likely to get the help you're seeking.  I'd help you but I have no information on the EBCDIC character set.





As mrmick said...no other way than tranlation.

There are commercial products available which do this tranlation on-the-fly, but I am not familiar with them. You could start checking from your mainframe manufacturer's site.

If you want to start writing your own translator, conversion tables are available eg at

http://as400bks.rochester.ibm.com/cgi-bin/bookmgr/bookmgr.cmd/BOOKS/QBKANL02/APPENDIX1.6.8.2
ASKER CERTIFIED SOLUTION
Avatar of mrmick
mrmick

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, by the way, If you choose "OK - do it", please provide an FTP site, path and filename that contains a file using the EBCDIC character set to aid in testing a procedure before offering it to you.
Ive got the same problem with an AS400 file. Can you not set ftp to transfer in ascii somehow?

You can do this with FTP from dos using the 'ascii' command to get ASCII and 'binary' if you want EBCDIC.

It seems pretty sad if microsoft have release a cut down version of an FTP control where you cant set the transfer type.

The only otherway is by using a batch file and waiting for the batch file to finish. This seems the easiest option but with a lot less control.