Solved

Visual Basic FTP and IBM Mainframe functionality?

Posted on 2003-11-01
5
1,848 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
ID: 9664248
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
ID: 9672485
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
ID: 9675556
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
ID: 9680603
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
ID: 9681139
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Title # Comments Views Activity
ntp settings vcenter 4 61
VLAN Tag for chained network device. 11 70
WAN and LAN NIC on Windows Server 2012 11 128
Unable to ping a server in the same subnet 10 91
Greetings, Experts! First let me state that this website is top notch. I thoroughly enjoy the community that is shared here; those seeking help and those willing to sacrifice their time to help. It is fantastic. I am writing this article at th…
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

828 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