FTP Documents to a Mainframe

I needed to upload some documents to an IBM mainframe. The problem was that the mainframe's default type was variable block and the dataset needed to be fixed block. So, by running the following agent with the MVSFTP.BAT below I achieved the results required.

ftp -s:g:\informat\common\scttos\command.ftp
>g:\informat\common\scttosoutput.ftp

This has only been tested on a Windows client.


Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim TaskID As Integer
Dim ftpOutput As String
Set uidoc = workspace.CurrentDocument

'''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''
' Build the command file for the FTP to use
'''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''

Open "g:\informat\common\scttos\command.ftp" For Output As #1
Print #1, "open ftp.YourSite.Org"
Print #1, Inputbox$("Enter your user id")
Print #1, Inputbox$("Enter your password")
Print #1, "quote site lrecl=80 recfm=fb blksize=7440"
Print #1, "put g:\informat\common\scttos\";"temp.txt";" ";Inputbox$("Enter your Host filename")
Print #1, "quit"
Close #1

'''''''''''''''''''''''''''
'''''''''''''''''''''''''''
' Run the FTP
'''''''''''''''''''''''''''
'''''''''''''''''''''''''''
TaskID = Shell("g:\informat\common\scttos\mvsftp.bat",1)

'''''''''''''''''''''''''''
'''''''''''''''''''''''''''
' Wait for the FTP to get started and delete the command file
'''''''''''''''''''''''''''
'''''''''''''''''''''''''''
Sleep 10
Kill "g:\informat\common\scttos\command.ftp"
Kill "g:\informat\common\scttos\temp.txt"
'''''''''''''''''''''''''''
'''''''''''''''''''''''''''
' Report the results to the user
'''''''''''''''''''''''''''
'''''''''''''''''''''''''''
Open "g:\informat\common\scttos\output.ftp" For Input As #1
ftpOutput = Input$(Lof(1),#1)
If (Instr(1, ftpOutput, "250") <> 0) Then
ftpOutput = ftpOutput + Chr$(10)+ "TRANSFER WAS SUCCESSFUL"
Else
ftpOutput = ftpOutput + Chr$(10)+ "TRANSFER HAS FAILED"
End If
Messagebox ftpOutput, MB_OK, "FTP Output"
Close #1

This was first published in November 2000

Dig deeper on Domino Resources

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close