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
Solved

VB 5.0 FTP a text file from mainframe to c:

Posted on 1997-12-09
6
484 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

839 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