Solved

VB 5.0 FTP a text file from mainframe to c:

Posted on 1997-12-09
6
482 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
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
change vba from autofit to 13.5 width? 4 29
How does CurrentUser work? 10 37
Spell Check in VB6 13 114
vbModal 12 53
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

831 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