Solved

Visual Basic FTP and IBM Mainframe functionality?

Posted on 2003-11-01
5
1,856 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 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
2 LAN/WAN on One Server 2 67
How to scan rdp  ''only'' open port 3333? 5 175
DNS issue with resolving request 14 129
DHCP Server not issuing IP Address 7 75
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…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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