?
Solved

Visual Basic FTP and IBM Mainframe functionality?

Posted on 2003-11-01
5
Medium Priority
?
1,872 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
[X]
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
  • 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 400 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 600 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

The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

Question has a verified solution.

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

This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
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 …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

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