Solved

Visual Basic FTP and IBM Mainframe functionality?

Posted on 2003-11-01
5
1,854 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Downtime reduced, data recovered by utilizing an Experts Exchange Business Account Challenge The United States Marine Corps employs more than 200,000 active-duty Marines with operations in four continents, all requiring complex networking system…
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 …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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