Solved

VB 5.0 FTP a text file from mainframe to c:

Posted on 1997-12-09
6
474 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
6 Comments
 

Author Comment

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

Expert Comment

by:mrmick
Comment Utility
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
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 8

Accepted Solution

by:
mrmick earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Public Sub, Empty Cell 7 56
Use Multiple Forms 4 38
VBA open file from excel cell 4 33
Add a task in Outlook from access 11 32
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now