Solved

VB 5.0 FTP a text file from mainframe to c:

Posted on 1997-12-09
6
485 Views
Last Modified: 2008-02-01
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.
0
Comment
Question by:tdej437
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:tdej437
ID: 1444334
If you have an answer, please choose not the converting, it  will slowdown performance!!
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1444335
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.





0
 
LVL 4

Expert Comment

by:rantanen
ID: 1444336
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
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Accepted Solution

by:
mrmick earned 100 total points
ID: 1444337
Thanks to rantanen's help, I'll write you a procedure that will convert a string in EBCDIC format to ASCII format, but you'll have to double the points and promise an "A" grade.

This would enable you to FTP download the file into a string in EBCDIC format, call the EBCDICtoASCII procedure, and then save it as a text file on your local machine in ASCII format.

Just up the points and post a comment "OK - do it" or reject this solution as an acceptable answer.
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1444338
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.
0
 

Expert Comment

by:kevrob
ID: 2606709
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.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question