General discussion

Locked

Reading fileFTPd from mainframe using VB

By MWEST ·
I am trying to read a file that has been FTPd from an IBM mainframe to my PC. The file on the mainframe has some text and some "packed" data. When this file is FTPd and converted from EBCDIC to ASCII, about 6 bytes of this "packed" data throughout the file are coverted to the ASCII equivalent code for the EOF (end of file). Therefore, when I try to read this file using VB, I prematurely encounter end of file due to these characters that have been converted. Is there anyway that I can read past these quasi end of file markers and reach the real end of file using VB.

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Reading fileFTPd from mainframe using VB

by Mark_T In reply to Reading fileFTPd from mai ...

Can you send on a sample file and the few lines of code you're using to open/read in the lines.

I'll have a go if you'd like.

Collapse -

Reading fileFTPd from mainframe using VB

by MWEST In reply to Reading fileFTPd from mai ...

I did not receive an adequate answer to my question/problem.

Collapse -

Reading fileFTPd from mainframe using VB

by RRV In reply to Reading fileFTPd from mai ...

There are 2 options. If you ftp from mainframe you'll have option to convert to ASCII. Easy is to use ftpgetfile API from VB and use ASCII as format parameter and get the file from mainframe to your PC and after than use filesystem object in VB to read the file line by line or character by charater.

RV

Collapse -

Reading fileFTPd from mainframe using VB

by MWEST In reply to Reading fileFTPd from mai ...

I had already tried this one, and it doesn't work.

Collapse -

Reading fileFTPd from mainframe using VB

by Jerry E In reply to Reading fileFTPd from mai ...

Search microsoft.com for inputb this function will read binary from the file.

Collapse -

Reading fileFTPd from mainframe using VB

by MWEST In reply to Reading fileFTPd from mai ...

I tried this also. However, each record has binary and non-binary data. I could not get this to work.

Collapse -

Reading fileFTPd from mainframe using VB

by david.kolb In reply to Reading fileFTPd from mai ...

I have encountered the same problem before where accented names translated fromEBCDIC to an EOF mark. I assume that you are using the standard file open with input or line input. I got around the problem by using a binary read to read the text files. If the records are fixed length it is no problem but if they are variable length you will need to read the entire file into a string variable and then use the Instr function to locate the CRLF characters, if you need to navigate and extract information from the file.

Collapse -

Reading fileFTPd from mainframe using VB

by MWEST In reply to Reading fileFTPd from mai ...

This seemed to point me in the right direction. The records are not fixed length, so the comment about reading the entire file into a string variable and parse it helped.

Collapse -

Reading fileFTPd from mainframe using VB

by MWEST In reply to Reading fileFTPd from mai ...

This question was closed by the author

Back to Web Development Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums