Solved

Visual Basic FTP and IBM Mainframe functionality?

Posted on 2003-11-01
5
1,839 Views
Last Modified: 2009-12-16
I've searched high and low but I've come up empty.  How do you use FTP in Visual Basic 6 to send the full range of commands to an IBM Mainframe.  VB's Inet only supports a limited range (e.g. send).  What about "quote" and "site"?  The IBM FTP server has options that allow the FTP client to specify the type of session, for instance -- a JES session.  When "quote site filetype=jes" is sent to the server, the subsequent comannds are interpreted uniquely(i.e. -- "puts" are read into the IBM's Job Entry Subsystem as a batch jobstream, and "DIR" lists the active jobs).

The problem is:  HOW TO GET THE "SITE" COMMAND passed to the server.  When I issue the command nothing happens.  This works fine in the FTP client in DOS (Reflection's inet), but in VB in hangs.

This shows a successful DOS ftp session --- this is all that I'm trying to do in VB.

ftp> quote site filetype=jes
200 SITE command was accepted
ftp> put c:/user/ftptest/test.jcl
200 Port request OK.
125 Sending Job to JES internal reader FIXrecfm 80
250-It is known to JES as JOB27564
250 Transfer completed successfully.
ftp: 200 bytes sent in 0.05Seconds 4.00Kbytes/sec.
ftp> dir
200 Port request OK.
125 List started OK
BVEBO6Y   JOB20347  OUTPUT    4 Spool Files
BVEBO6A   JOB25404  OUTPUT    3 Spool Files
BVEBO6A   JOB27564  INPUT
250 List completed successfully.
ftp: 222 bytes received in 1.92Seconds 0.12Kbytes/sec.
ftp>

Thanks
0
Comment
Question by:jlhuber
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:svenkarlsen
Comment Utility
well, - you could try running the FTP through a shell command with a command list file, - it'll work, but it's ugly (the cmd-window will pop-up).
0
 
LVL 3

Expert Comment

by:nonsence
Comment Utility
hmm. sounds like you're trying to make yourself a vb ftp client of some sort.

here's a place where you might find source code for using winsock to create network connections.
http://www.planet-source-code.com/vb/default.asp?lngWId=1

i can't help you too much since i'm only learning vb6 right now. and what you're doing is more complicated then what i'm learning right now. but i do understand networking and ftp sessions very well, so i know where you're coming from, from a network admin point of view.

have you thought about looking into how to actually program your own custom ftp commands?
0
 

Author Comment

by:jlhuber
Comment Utility
Thanks for the link.  I'll take a look.  I was able to get the ftp to work without the inet FTP GUI that VB gives.  The wininet.dll can be used directly:  

Public Declare Function FtpCommand Lib "wininet.dll" Alias "FtpCommandA" _
  (ByVal hConnect As Long, ByVal fExpectResponse As Boolean, ByVal dwFlags As Long, _
    ByVal lpszCommand As String, ByVal lContext As Long, phFtpCommand As Long) As Boolean


0
 
LVL 3

Accepted Solution

by:
nonsence earned 200 total points
Comment Utility
here's something that might be of use. it's asp, but as least it's code source code with it.
an article on how to make an asp web based ftp client of sorts

http://www.aspalliance.com/articleViewer.aspx?aId=253&vId=1&pId=
0
 
LVL 9

Assisted Solution

by:svenkarlsen
svenkarlsen earned 300 total points
Comment Utility
The FTPCommand of WinInet should do the trick you are looking for, like:

' send a command to retrieve selected file
  strCommand = "RETR " & szDirRemote & szFileRemote
  bRet = FtpCommand(hConnection, True, dwType, strCommand, 0, hFile)

have a look at:

http://www.vbip.com/wininet/wininet-ftp-command-01.asp
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

The Need In an Active Directory enviroment, the PDC emulator provide time synchronization for the domain. This is important since Active Directory uses Kerberos for authentication.  By default, if the time difference between systems is off by more …
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

6 Experts available now in Live!

Get 1:1 Help Now