Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

How to FTP to host(Mainframe)?

$
0
0

Hi,

 

I am trying to send files over to an ftp server on Mainframe using scripts that is provided in this link, but I can't get it to work.

The problem is the sendfile method concatinates the source file name to the MVS dataset name which causes the issue.

 

Here's my code (FTPConn is a connecation mgr for FTP):

 

Imports

System

Imports

System.Data

Imports

System.Math

Imports

Microsoft.SqlServer.Dts.Runtime

 

PublicClass ScriptMain

PublicSub Main()

 

Dim mgr As ConnectionManager

mgr = Dts.Connections("FTPConn")

 

Dim conn As FtpClientConnection

conn = New FtpClientConnection(mgr.AcquireConnection(DBNull.Value))

 

Dim toFiles AsString

toFiles =

"ftpp.a.b.xxxxx.yyyyyy.int"

 

Dim fromFiles(0) AsString

fromFiles(0) =

"c:\test.txt"

 

Try

conn.Connect()

conn.SendFiles(fromFiles, toFiles,

True, True)

Catch ex As Exception

 

 

Finally

conn.Close()

EndTry

 

 

Dts.TaskResult = Dts.Results.Success

EndSub

 

End

Class

 

 

 

Output:

 

SSIS package "Package.dtsx" starting.

Error: 0xC001602A at Package, Connection manager "FTPConn": An error occurred in the requested FTP operation. Detailed error description: 200 Representation type is Ascii NonPrint

200 Port request OK.

501 Invalid data set name "ftpp.a.b.xxxxx.yyyyyy.int/test.txt". Use MVS Dsname conventions.


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>